author | jwilhelm |
Thu, 03 Oct 2013 21:36:29 +0200 | |
changeset 20398 | b206c580c45f |
parent 17383 | 3665c0901a0d |
child 22844 | 90f76a40ed8a |
child 22234 | da823d78ad65 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
2 |
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3676
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3676
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3676
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "code/nmethod.hpp" |
|
27 |
#include "compiler/compileBroker.hpp" |
|
28 |
#include "opto/compile.hpp" |
|
29 |
#include "opto/node.hpp" |
|
30 |
#include "opto/phase.hpp" |
|
1 | 31 |
|
32 |
#ifndef PRODUCT |
|
33 |
int Phase::_total_bytes_compiled = 0; |
|
34 |
||
35 |
elapsedTimer Phase::_t_totalCompilation; |
|
36 |
elapsedTimer Phase::_t_methodCompilation; |
|
37 |
elapsedTimer Phase::_t_stubCompilation; |
|
38 |
#endif |
|
39 |
||
40 |
// The next timers used for LogCompilation |
|
41 |
elapsedTimer Phase::_t_parser; |
|
42 |
elapsedTimer Phase::_t_optimizer; |
|
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
43 |
elapsedTimer Phase::_t_escapeAnalysis; |
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
44 |
elapsedTimer Phase::_t_connectionGraph; |
1 | 45 |
elapsedTimer Phase::_t_idealLoop; |
46 |
elapsedTimer Phase::_t_ccp; |
|
47 |
elapsedTimer Phase::_t_matcher; |
|
48 |
elapsedTimer Phase::_t_registerAllocation; |
|
49 |
elapsedTimer Phase::_t_output; |
|
50 |
||
51 |
#ifndef PRODUCT |
|
52 |
elapsedTimer Phase::_t_graphReshaping; |
|
53 |
elapsedTimer Phase::_t_scheduler; |
|
1498 | 54 |
elapsedTimer Phase::_t_blockOrdering; |
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
55 |
elapsedTimer Phase::_t_macroEliminate; |
1 | 56 |
elapsedTimer Phase::_t_macroExpand; |
57 |
elapsedTimer Phase::_t_peephole; |
|
58 |
elapsedTimer Phase::_t_codeGeneration; |
|
59 |
elapsedTimer Phase::_t_registerMethod; |
|
60 |
elapsedTimer Phase::_t_temporaryTimer1; |
|
61 |
elapsedTimer Phase::_t_temporaryTimer2; |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
62 |
elapsedTimer Phase::_t_idealLoopVerify; |
1 | 63 |
|
64 |
// Subtimers for _t_optimizer |
|
65 |
elapsedTimer Phase::_t_iterGVN; |
|
66 |
elapsedTimer Phase::_t_iterGVN2; |
|
17383 | 67 |
elapsedTimer Phase::_t_incrInline; |
1 | 68 |
|
69 |
// Subtimers for _t_registerAllocation |
|
70 |
elapsedTimer Phase::_t_ctorChaitin; |
|
71 |
elapsedTimer Phase::_t_buildIFGphysical; |
|
72 |
elapsedTimer Phase::_t_computeLive; |
|
73 |
elapsedTimer Phase::_t_regAllocSplit; |
|
74 |
elapsedTimer Phase::_t_postAllocCopyRemoval; |
|
75 |
elapsedTimer Phase::_t_fixupSpills; |
|
76 |
||
77 |
// Subtimers for _t_output |
|
78 |
elapsedTimer Phase::_t_instrSched; |
|
79 |
elapsedTimer Phase::_t_buildOopMaps; |
|
80 |
#endif |
|
81 |
||
82 |
//------------------------------Phase------------------------------------------ |
|
83 |
Phase::Phase( PhaseNumber pnum ) : _pnum(pnum), C( pnum == Compiler ? NULL : Compile::current()) { |
|
2131 | 84 |
// Poll for requests from shutdown mechanism to quiesce compiler (4448539, 4448544). |
1 | 85 |
// This is an effective place to poll, since the compiler is full of phases. |
86 |
// In particular, every inlining site uses a recursively created Parse phase. |
|
87 |
CompileBroker::maybe_block(); |
|
88 |
} |
|
89 |
||
90 |
#ifndef PRODUCT |
|
91 |
static const double minimum_reported_time = 0.0001; // seconds |
|
92 |
static const double expected_method_compile_coverage = 0.97; // % |
|
93 |
static const double minimum_meaningful_method_compile = 2.00; // seconds |
|
94 |
||
95 |
void Phase::print_timers() { |
|
96 |
tty->print_cr ("Accumulated compiler times:"); |
|
97 |
tty->print_cr ("---------------------------"); |
|
98 |
tty->print_cr (" Total compilation: %3.3f sec.", Phase::_t_totalCompilation.seconds()); |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
99 |
tty->print (" method compilation : %3.3f sec", Phase::_t_methodCompilation.seconds()); |
1 | 100 |
tty->print ("/%d bytes",_total_bytes_compiled); |
101 |
tty->print_cr (" (%3.0f bytes per sec) ", Phase::_total_bytes_compiled / Phase::_t_methodCompilation.seconds()); |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
102 |
tty->print_cr (" stub compilation : %3.3f sec.", Phase::_t_stubCompilation.seconds()); |
1 | 103 |
tty->print_cr (" Phases:"); |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
104 |
tty->print_cr (" parse : %3.3f sec", Phase::_t_parser.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
105 |
tty->print_cr (" optimizer : %3.3f sec", Phase::_t_optimizer.seconds()); |
1 | 106 |
if( Verbose || WizardMode ) { |
8319 | 107 |
if (DoEscapeAnalysis) { |
108 |
// EA is part of Optimizer. |
|
109 |
tty->print_cr (" escape analysis: %3.3f sec", Phase::_t_escapeAnalysis.seconds()); |
|
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
110 |
tty->print_cr (" connection graph: %3.3f sec", Phase::_t_connectionGraph.seconds()); |
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
111 |
tty->print_cr (" macroEliminate : %3.3f sec", Phase::_t_macroEliminate.seconds()); |
8319 | 112 |
} |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
113 |
tty->print_cr (" iterGVN : %3.3f sec", Phase::_t_iterGVN.seconds()); |
17383 | 114 |
tty->print_cr (" incrInline : %3.3f sec", Phase::_t_incrInline.seconds()); |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
115 |
tty->print_cr (" idealLoop : %3.3f sec", Phase::_t_idealLoop.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
116 |
tty->print_cr (" idealLoopVerify: %3.3f sec", Phase::_t_idealLoopVerify.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
117 |
tty->print_cr (" ccp : %3.3f sec", Phase::_t_ccp.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
118 |
tty->print_cr (" iterGVN2 : %3.3f sec", Phase::_t_iterGVN2.seconds()); |
8319 | 119 |
tty->print_cr (" macroExpand : %3.3f sec", Phase::_t_macroExpand.seconds()); |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
120 |
tty->print_cr (" graphReshape : %3.3f sec", Phase::_t_graphReshaping.seconds()); |
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
121 |
double optimizer_subtotal = Phase::_t_iterGVN.seconds() + Phase::_t_iterGVN2.seconds() + |
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
122 |
Phase::_t_escapeAnalysis.seconds() + Phase::_t_macroEliminate.seconds() + |
1 | 123 |
Phase::_t_idealLoop.seconds() + Phase::_t_ccp.seconds() + |
12158
f24f2560da32
7147744: CTW: assert(false) failed: infinite EA connection graph build
kvn
parents:
8319
diff
changeset
|
124 |
Phase::_t_macroExpand.seconds() + Phase::_t_graphReshaping.seconds(); |
1 | 125 |
double percent_of_optimizer = ((optimizer_subtotal == 0.0) ? 0.0 : (optimizer_subtotal / Phase::_t_optimizer.seconds() * 100.0)); |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
126 |
tty->print_cr (" subtotal : %3.3f sec, %3.2f %%", optimizer_subtotal, percent_of_optimizer); |
1 | 127 |
} |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
128 |
tty->print_cr (" matcher : %3.3f sec", Phase::_t_matcher.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
129 |
tty->print_cr (" scheduler : %3.3f sec", Phase::_t_scheduler.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
130 |
tty->print_cr (" regalloc : %3.3f sec", Phase::_t_registerAllocation.seconds()); |
1 | 131 |
if( Verbose || WizardMode ) { |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
132 |
tty->print_cr (" ctorChaitin : %3.3f sec", Phase::_t_ctorChaitin.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
133 |
tty->print_cr (" buildIFG : %3.3f sec", Phase::_t_buildIFGphysical.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
134 |
tty->print_cr (" computeLive : %3.3f sec", Phase::_t_computeLive.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
135 |
tty->print_cr (" regAllocSplit : %3.3f sec", Phase::_t_regAllocSplit.seconds()); |
1 | 136 |
tty->print_cr (" postAllocCopyRemoval: %3.3f sec", Phase::_t_postAllocCopyRemoval.seconds()); |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
137 |
tty->print_cr (" fixupSpills : %3.3f sec", Phase::_t_fixupSpills.seconds()); |
1 | 138 |
double regalloc_subtotal = Phase::_t_ctorChaitin.seconds() + |
139 |
Phase::_t_buildIFGphysical.seconds() + Phase::_t_computeLive.seconds() + |
|
140 |
Phase::_t_regAllocSplit.seconds() + Phase::_t_fixupSpills.seconds() + |
|
141 |
Phase::_t_postAllocCopyRemoval.seconds(); |
|
142 |
double percent_of_regalloc = ((regalloc_subtotal == 0.0) ? 0.0 : (regalloc_subtotal / Phase::_t_registerAllocation.seconds() * 100.0)); |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
143 |
tty->print_cr (" subtotal : %3.3f sec, %3.2f %%", regalloc_subtotal, percent_of_regalloc); |
1 | 144 |
} |
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
145 |
tty->print_cr (" blockOrdering : %3.3f sec", Phase::_t_blockOrdering.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
146 |
tty->print_cr (" peephole : %3.3f sec", Phase::_t_peephole.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
147 |
tty->print_cr (" codeGen : %3.3f sec", Phase::_t_codeGeneration.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
148 |
tty->print_cr (" install_code : %3.3f sec", Phase::_t_registerMethod.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
149 |
tty->print_cr (" -------------- : ----------"); |
1 | 150 |
double phase_subtotal = Phase::_t_parser.seconds() + |
151 |
Phase::_t_optimizer.seconds() + Phase::_t_graphReshaping.seconds() + |
|
152 |
Phase::_t_matcher.seconds() + Phase::_t_scheduler.seconds() + |
|
1498 | 153 |
Phase::_t_registerAllocation.seconds() + Phase::_t_blockOrdering.seconds() + |
1 | 154 |
Phase::_t_codeGeneration.seconds() + Phase::_t_registerMethod.seconds(); |
155 |
double percent_of_method_compile = ((phase_subtotal == 0.0) ? 0.0 : phase_subtotal / Phase::_t_methodCompilation.seconds()) * 100.0; |
|
156 |
// counters inside Compile::CodeGen include time for adapters and stubs |
|
157 |
// so phase-total can be greater than 100% |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
158 |
tty->print_cr (" total : %3.3f sec, %3.2f %%", phase_subtotal, percent_of_method_compile); |
1 | 159 |
|
160 |
assert( percent_of_method_compile > expected_method_compile_coverage || |
|
161 |
phase_subtotal < minimum_meaningful_method_compile, |
|
162 |
"Must account for method compilation"); |
|
163 |
||
164 |
if( Phase::_t_temporaryTimer1.seconds() > minimum_reported_time ) { |
|
165 |
tty->cr(); |
|
166 |
tty->print_cr (" temporaryTimer1: %3.3f sec", Phase::_t_temporaryTimer1.seconds()); |
|
167 |
} |
|
168 |
if( Phase::_t_temporaryTimer2.seconds() > minimum_reported_time ) { |
|
169 |
tty->cr(); |
|
170 |
tty->print_cr (" temporaryTimer2: %3.3f sec", Phase::_t_temporaryTimer2.seconds()); |
|
171 |
} |
|
3676
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
172 |
tty->print_cr (" output : %3.3f sec", Phase::_t_output.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
173 |
tty->print_cr (" isched : %3.3f sec", Phase::_t_instrSched.seconds()); |
3bac3e882cd3
6862956: PhaseIdealLoop should have a CFG verification mode
never
parents:
2131
diff
changeset
|
174 |
tty->print_cr (" bldOopMaps : %3.3f sec", Phase::_t_buildOopMaps.seconds()); |
1 | 175 |
} |
176 |
#endif |