1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
620 void set_has_irreducible_loop(bool z) { _has_irreducible_loop = z; }
621
622 // JSR 292
623 bool has_method_handle_invokes() const { return _has_method_handle_invokes; }
624 void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }
625
626 Ticks _latest_stage_start_counter;
627
628 void begin_method() {
629 #ifndef PRODUCT
630 if (_printer) _printer->begin_method(this);
631 #endif
632 C->_latest_stage_start_counter.stamp();
633 }
634
635 void print_method(CompilerPhaseType cpt, int level = 1) {
636 EventCompilerPhase event;
637 if (event.should_commit()) {
638 event.set_starttime(C->_latest_stage_start_counter);
639 event.set_phase((u1) cpt);
640 event.set_compileID(C->_compile_id);
641 event.set_phaseLevel(level);
642 event.commit();
643 }
644
645
646 #ifndef PRODUCT
647 if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
648 #endif
649 C->_latest_stage_start_counter.stamp();
650 }
651
652 void end_method(int level = 1) {
653 EventCompilerPhase event;
654 if (event.should_commit()) {
655 event.set_starttime(C->_latest_stage_start_counter);
656 event.set_phase((u1) PHASE_END);
657 event.set_compileID(C->_compile_id);
658 event.set_phaseLevel(level);
659 event.commit();
660 }
661 #ifndef PRODUCT
662 if (_printer) _printer->end_method();
663 #endif
664 }
665
666 int macro_count() const { return _macro_nodes->length(); }
667 int predicate_count() const { return _predicate_opaqs->length();}
668 int expensive_count() const { return _expensive_nodes->length(); }
669 Node* macro_node(int idx) const { return _macro_nodes->at(idx); }
670 Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);}
671 Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); }
672 ConnectionGraph* congraph() { return _congraph;}
673 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;}
674 void add_macro_node(Node * n) {
675 //assert(n->is_macro(), "must be a macro node");
676 assert(!_macro_nodes->contains(n), "duplicate entry in expand list");
677 _macro_nodes->append(n);
|
1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
620 void set_has_irreducible_loop(bool z) { _has_irreducible_loop = z; }
621
622 // JSR 292
623 bool has_method_handle_invokes() const { return _has_method_handle_invokes; }
624 void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }
625
626 Ticks _latest_stage_start_counter;
627
628 void begin_method() {
629 #ifndef PRODUCT
630 if (_printer) _printer->begin_method(this);
631 #endif
632 C->_latest_stage_start_counter.stamp();
633 }
634
635 void print_method(CompilerPhaseType cpt, int level = 1) {
636 EventCompilerPhase event;
637 if (event.should_commit()) {
638 event.set_starttime(C->_latest_stage_start_counter);
639 event.set_phase((u1) cpt);
640 event.set_compileId(C->_compile_id);
641 event.set_phaseLevel(level);
642 event.commit();
643 }
644
645
646 #ifndef PRODUCT
647 if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
648 #endif
649 C->_latest_stage_start_counter.stamp();
650 }
651
652 void end_method(int level = 1) {
653 EventCompilerPhase event;
654 if (event.should_commit()) {
655 event.set_starttime(C->_latest_stage_start_counter);
656 event.set_phase((u1) PHASE_END);
657 event.set_compileId(C->_compile_id);
658 event.set_phaseLevel(level);
659 event.commit();
660 }
661 #ifndef PRODUCT
662 if (_printer) _printer->end_method();
663 #endif
664 }
665
666 int macro_count() const { return _macro_nodes->length(); }
667 int predicate_count() const { return _predicate_opaqs->length();}
668 int expensive_count() const { return _expensive_nodes->length(); }
669 Node* macro_node(int idx) const { return _macro_nodes->at(idx); }
670 Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);}
671 Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); }
672 ConnectionGraph* congraph() { return _congraph;}
673 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;}
674 void add_macro_node(Node * n) {
675 //assert(n->is_macro(), "must be a macro node");
676 assert(!_macro_nodes->contains(n), "duplicate entry in expand list");
677 _macro_nodes->append(n);
|