annotate src/share/vm/c1/c1_Compilation.cpp @ 17524:89152779163c

Merge with jdk8-b132
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 11:59:32 +0200
parents 4ca6dc0799b6
children 52b4284cb496
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17524
89152779163c Merge with jdk8-b132
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14909
diff changeset
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1397
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1397
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1397
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
26 #include "c1/c1_CFGPrinter.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
27 #include "c1/c1_Compilation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
28 #include "c1/c1_IR.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
29 #include "c1/c1_LIRAssembler.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
30 #include "c1/c1_LinearScan.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
31 #include "c1/c1_MacroAssembler.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
32 #include "c1/c1_ValueMap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
33 #include "c1/c1_ValueStack.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1964
diff changeset
34 #include "code/debugInfoRec.hpp"
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
35 #include "compiler/compileLog.hpp"
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
36 #include "c1/c1_RangeCheckElimination.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 _t_compile,
a61af66fc99e Initial load
duke
parents:
diff changeset
41 _t_setup,
a61af66fc99e Initial load
duke
parents:
diff changeset
42 _t_buildIR,
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
43 _t_optimize_blocks,
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
44 _t_optimize_null_checks,
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
45 _t_rangeCheckElimination,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
46 _t_emit_lir,
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _t_linearScan,
a61af66fc99e Initial load
duke
parents:
diff changeset
48 _t_lirGeneration,
a61af66fc99e Initial load
duke
parents:
diff changeset
49 _t_lir_schedule,
a61af66fc99e Initial load
duke
parents:
diff changeset
50 _t_codeemit,
a61af66fc99e Initial load
duke
parents:
diff changeset
51 _t_codeinstall,
a61af66fc99e Initial load
duke
parents:
diff changeset
52 max_phase_timers
a61af66fc99e Initial load
duke
parents:
diff changeset
53 } TimerName;
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 static const char * timer_name[] = {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 "compile",
a61af66fc99e Initial load
duke
parents:
diff changeset
57 "setup",
a61af66fc99e Initial load
duke
parents:
diff changeset
58 "buildIR",
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
59 "optimize_blocks",
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
60 "optimize_null_checks",
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
61 "rangeCheckElimination",
0
a61af66fc99e Initial load
duke
parents:
diff changeset
62 "emit_lir",
a61af66fc99e Initial load
duke
parents:
diff changeset
63 "linearScan",
a61af66fc99e Initial load
duke
parents:
diff changeset
64 "lirGeneration",
a61af66fc99e Initial load
duke
parents:
diff changeset
65 "lir_schedule",
a61af66fc99e Initial load
duke
parents:
diff changeset
66 "codeemit",
a61af66fc99e Initial load
duke
parents:
diff changeset
67 "codeinstall"
a61af66fc99e Initial load
duke
parents:
diff changeset
68 };
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static elapsedTimer timers[max_phase_timers];
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static int totalInstructionNodes = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 class PhaseTraceTime: public TraceTime {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
75 JavaThread* _thread;
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
76 CompileLog* _log;
12162
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
77 TimerName _timer;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public:
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
80 PhaseTraceTime(TimerName timer)
12162
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
81 : TraceTime("", &timers[timer], CITime || CITimeEach, Verbose),
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
82 _log(NULL), _timer(timer)
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
83 {
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
84 if (Compilation::current() != NULL) {
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
85 _log = Compilation::current()->log();
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
86 }
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
87
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
88 if (_log != NULL) {
12162
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
89 _log->begin_head("phase name='%s'", timer_name[_timer]);
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
90 _log->stamp();
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
91 _log->end_head();
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
92 }
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
93 }
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
94
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
95 ~PhaseTraceTime() {
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
96 if (_log != NULL)
12162
e47de6dfec5d 8022456: LogCompilation tool does not work with C1 output again
vlivanov
parents: 8860
diff changeset
97 _log->done("phase name='%s'", timer_name[_timer]);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }
a61af66fc99e Initial load
duke
parents:
diff changeset
99 };
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Implementation of Compilation
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 void Compilation::maybe_print_current_instruction() {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 if (_current_instruction != NULL && _last_instruction_printed != _current_instruction) {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 _last_instruction_printed = _current_instruction;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 _current_instruction->print_line();
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111 }
a61af66fc99e Initial load
duke
parents:
diff changeset
112 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 DebugInformationRecorder* Compilation::debug_info_recorder() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 return _env->debug_info();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 Dependencies* Compilation::dependency_recorder() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 return _env->dependencies();
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 void Compilation::initialize() {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // Use an oop recorder bound to the CI environment.
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // (The default oop recorder is ignorant of the CI.)
a61af66fc99e Initial load
duke
parents:
diff changeset
128 OopRecorder* ooprec = new OopRecorder(_env->arena());
a61af66fc99e Initial load
duke
parents:
diff changeset
129 _env->set_oop_recorder(ooprec);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 _env->set_debug_info(new DebugInformationRecorder(ooprec));
a61af66fc99e Initial load
duke
parents:
diff changeset
131 debug_info_recorder()->set_oopmaps(new OopMapSet());
a61af66fc99e Initial load
duke
parents:
diff changeset
132 _env->set_dependencies(new Dependencies(_env));
a61af66fc99e Initial load
duke
parents:
diff changeset
133 }
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 void Compilation::build_hir() {
a61af66fc99e Initial load
duke
parents:
diff changeset
137 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // setup ir
7201
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
140 CompileLog* log = this->log();
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
141 if (log != NULL) {
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
142 log->begin_head("parse method='%d' ",
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
143 log->identify(_method));
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
144 log->stamp();
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
145 log->end_head();
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
146 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
147 _hir = new IR(this, method(), osr_bci());
7201
c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support
neliasso
parents: 6853
diff changeset
148 if (log) log->done("parse");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
149 if (!_hir->is_valid()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 bailout("invalid parsing");
a61af66fc99e Initial load
duke
parents:
diff changeset
151 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
155 if (PrintCFGToFile) {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 CFGPrinter::print_cfg(_hir, "After Generation of HIR", true, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
157 }
a61af66fc99e Initial load
duke
parents:
diff changeset
158 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
161 if (PrintCFG || PrintCFG0) { tty->print_cr("CFG after parsing"); _hir->print(true); }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 if (PrintIR || PrintIR0 ) { tty->print_cr("IR after parsing"); _hir->print(false); }
a61af66fc99e Initial load
duke
parents:
diff changeset
163 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 _hir->verify();
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 if (UseC1Optimizations) {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 NEEDS_CLEANUP
a61af66fc99e Initial load
duke
parents:
diff changeset
169 // optimization
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
170 PhaseTraceTime timeit(_t_optimize_blocks);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
171
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
172 _hir->optimize_blocks();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 _hir->verify();
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 _hir->split_critical_edges();
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
180 if (PrintCFG || PrintCFG1) { tty->print_cr("CFG after optimizations"); _hir->print(true); }
a61af66fc99e Initial load
duke
parents:
diff changeset
181 if (PrintIR || PrintIR1 ) { tty->print_cr("IR after optimizations"); _hir->print(false); }
a61af66fc99e Initial load
duke
parents:
diff changeset
182 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 _hir->verify();
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 // compute block ordering for code generation
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // the control flow must not be changed from here on
a61af66fc99e Initial load
duke
parents:
diff changeset
188 _hir->compute_code();
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 if (UseGlobalValueNumbering) {
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
191 // No resource mark here! LoopInvariantCodeMotion can allocate ValueStack objects.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
192 int instructions = Instruction::number_of_instructions();
a61af66fc99e Initial load
duke
parents:
diff changeset
193 GlobalValueNumbering gvn(_hir);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 assert(instructions == Instruction::number_of_instructions(),
a61af66fc99e Initial load
duke
parents:
diff changeset
195 "shouldn't have created an instructions");
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
198 _hir->verify();
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
199
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
200 #ifndef PRODUCT
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
201 if (PrintCFGToFile) {
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
202 CFGPrinter::print_cfg(_hir, "Before RangeCheckElimination", true, false);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
203 }
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
204 #endif
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
205
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
206 if (RangeCheckElimination) {
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
207 if (_hir->osr_entry() == NULL) {
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
208 PhaseTraceTime timeit(_t_rangeCheckElimination);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
209 RangeCheckElimination::eliminate(_hir);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
210 }
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
211 }
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
212
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
213 #ifndef PRODUCT
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
214 if (PrintCFGToFile) {
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
215 CFGPrinter::print_cfg(_hir, "After RangeCheckElimination", true, false);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
216 }
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
217 #endif
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
218
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
219 if (UseC1Optimizations) {
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
220 // loop invariant code motion reorders instructions and range
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
221 // check elimination adds new instructions so do null check
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
222 // elimination after.
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
223 NEEDS_CLEANUP
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
224 // optimization
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
225 PhaseTraceTime timeit(_t_optimize_null_checks);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
226
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
227 _hir->eliminate_null_checks();
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
228 }
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
229
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
230 _hir->verify();
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
231
0
a61af66fc99e Initial load
duke
parents:
diff changeset
232 // compute use counts after global value numbering
a61af66fc99e Initial load
duke
parents:
diff changeset
233 _hir->compute_use_counts();
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
236 if (PrintCFG || PrintCFG2) { tty->print_cr("CFG before code generation"); _hir->code()->print(true); }
a61af66fc99e Initial load
duke
parents:
diff changeset
237 if (PrintIR || PrintIR2 ) { tty->print_cr("IR before code generation"); _hir->code()->print(false, true); }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 _hir->verify();
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 void Compilation::emit_lir() {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 LIRGenerator gen(this, method());
a61af66fc99e Initial load
duke
parents:
diff changeset
248 {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 PhaseTraceTime timeit(_t_lirGeneration);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 hir()->iterate_linear_scan_order(&gen);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 }
a61af66fc99e Initial load
duke
parents:
diff changeset
252
a61af66fc99e Initial load
duke
parents:
diff changeset
253 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 {
a61af66fc99e Initial load
duke
parents:
diff changeset
256 PhaseTraceTime timeit(_t_linearScan);
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 LinearScan* allocator = new LinearScan(hir(), &gen, frame_map());
a61af66fc99e Initial load
duke
parents:
diff changeset
259 set_allocator(allocator);
a61af66fc99e Initial load
duke
parents:
diff changeset
260 // Assign physical registers to LIR operands using a linear scan algorithm.
a61af66fc99e Initial load
duke
parents:
diff changeset
261 allocator->do_linear_scan();
a61af66fc99e Initial load
duke
parents:
diff changeset
262 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
263
a61af66fc99e Initial load
duke
parents:
diff changeset
264 _max_spills = allocator->max_spills();
a61af66fc99e Initial load
duke
parents:
diff changeset
265 }
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 if (BailoutAfterLIR) {
a61af66fc99e Initial load
duke
parents:
diff changeset
268 if (PrintLIR && !bailed_out()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
269 print_LIR(hir()->code());
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271 bailout("Bailing out because of -XX:+BailoutAfterLIR");
a61af66fc99e Initial load
duke
parents:
diff changeset
272 }
a61af66fc99e Initial load
duke
parents:
diff changeset
273 }
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 void Compilation::emit_code_epilog(LIR_Assembler* assembler) {
a61af66fc99e Initial load
duke
parents:
diff changeset
277 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
278
1204
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
279 CodeOffsets* code_offsets = assembler->offsets();
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
280
0
a61af66fc99e Initial load
duke
parents:
diff changeset
281 // generate code or slow cases
a61af66fc99e Initial load
duke
parents:
diff changeset
282 assembler->emit_slow_case_stubs();
a61af66fc99e Initial load
duke
parents:
diff changeset
283 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
284
a61af66fc99e Initial load
duke
parents:
diff changeset
285 // generate exception adapters
a61af66fc99e Initial load
duke
parents:
diff changeset
286 assembler->emit_exception_entries(exception_info_list());
a61af66fc99e Initial load
duke
parents:
diff changeset
287 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
288
1204
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
289 // Generate code for exception handler.
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
290 code_offsets->set_value(CodeOffsets::Exceptions, assembler->emit_exception_handler());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
291 CHECK_BAILOUT();
1204
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
292
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
293 // Generate code for deopt handler.
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
294 code_offsets->set_value(CodeOffsets::Deopt, assembler->emit_deopt_handler());
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
295 CHECK_BAILOUT();
18a389214829 6921352: JSR 292 needs its own deopt handler
twisti
parents: 1201
diff changeset
296
1691
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
297 // Emit the MethodHandle deopt handler code (if required).
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
298 if (has_method_handle_invokes()) {
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
299 // We can use the same code as for the normal deopt handler, we
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
300 // just need a different entry point address.
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
301 code_offsets->set_value(CodeOffsets::DeoptMH, assembler->emit_deopt_handler());
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
302 CHECK_BAILOUT();
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
303 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
304
1378
9f5b60a14736 6939930: exception unwind changes in 6919934 hurts compilation speed
never
parents: 1204
diff changeset
305 // Emit the handler to remove the activation from the stack and
9f5b60a14736 6939930: exception unwind changes in 6919934 hurts compilation speed
never
parents: 1204
diff changeset
306 // dispatch to the caller.
9f5b60a14736 6939930: exception unwind changes in 6919934 hurts compilation speed
never
parents: 1204
diff changeset
307 offsets()->set_value(CodeOffsets::UnwindHandler, assembler->emit_unwind_handler());
9f5b60a14736 6939930: exception unwind changes in 6919934 hurts compilation speed
never
parents: 1204
diff changeset
308
0
a61af66fc99e Initial load
duke
parents:
diff changeset
309 // done
a61af66fc99e Initial load
duke
parents:
diff changeset
310 masm()->flush();
a61af66fc99e Initial load
duke
parents:
diff changeset
311 }
a61af66fc99e Initial load
duke
parents:
diff changeset
312
a61af66fc99e Initial load
duke
parents:
diff changeset
313
2098
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
314 bool Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) {
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
315 // Preinitialize the consts section to some large size:
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
316 int locs_buffer_size = 20 * (relocInfo::length_limit + sizeof(relocInfo));
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
317 char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size);
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
318 code->insts()->initialize_shared_locs((relocInfo*)locs_buffer,
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
319 locs_buffer_size / sizeof(relocInfo));
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
320 code->initialize_consts_size(Compilation::desired_max_constant_size());
1617
9887b5e57f9e 6962980: C1: stub area should take into account method handle deopt stub
iveresov
parents: 1584
diff changeset
321 // Call stubs + two deopt handlers (regular and MH) + exception handler
2098
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
322 int stub_size = (call_stub_estimate * LIR_Assembler::call_stub_size) +
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
323 LIR_Assembler::exception_handler_size +
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
324 (2 * LIR_Assembler::deopt_handler_size);
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
325 if (stub_size >= code->insts_capacity()) return false;
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
326 code->initialize_stubs_size(stub_size);
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
327 return true;
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
328 }
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
329
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
330
0
a61af66fc99e Initial load
duke
parents:
diff changeset
331 int Compilation::emit_code_body() {
a61af66fc99e Initial load
duke
parents:
diff changeset
332 // emit code
2098
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
333 if (!setup_code_buffer(code(), allocator()->num_calls())) {
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
334 BAILOUT_("size requested greater than avail code buffer size", 0);
2f9d59b0fa5c 7009268: guarantee(middle - slop > start) failed: need enough space to divide up
bobv
parents: 2007
diff changeset
335 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
336 code()->initialize_oop_recorder(env()->oop_recorder());
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338 _masm = new C1_MacroAssembler(code());
a61af66fc99e Initial load
duke
parents:
diff changeset
339 _masm->set_oop_recorder(env()->oop_recorder());
a61af66fc99e Initial load
duke
parents:
diff changeset
340
a61af66fc99e Initial load
duke
parents:
diff changeset
341 LIR_Assembler lir_asm(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 lir_asm.emit_code(hir()->code());
a61af66fc99e Initial load
duke
parents:
diff changeset
344 CHECK_BAILOUT_(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
345
a61af66fc99e Initial load
duke
parents:
diff changeset
346 emit_code_epilog(&lir_asm);
a61af66fc99e Initial load
duke
parents:
diff changeset
347 CHECK_BAILOUT_(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
348
a61af66fc99e Initial load
duke
parents:
diff changeset
349 generate_exception_handler_table();
a61af66fc99e Initial load
duke
parents:
diff changeset
350
a61af66fc99e Initial load
duke
parents:
diff changeset
351 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
352 if (PrintExceptionHandlers && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
353 exception_handler_table()->print();
a61af66fc99e Initial load
duke
parents:
diff changeset
354 }
a61af66fc99e Initial load
duke
parents:
diff changeset
355 #endif /* PRODUCT */
a61af66fc99e Initial load
duke
parents:
diff changeset
356
a61af66fc99e Initial load
duke
parents:
diff changeset
357 return frame_map()->framesize();
a61af66fc99e Initial load
duke
parents:
diff changeset
358 }
a61af66fc99e Initial load
duke
parents:
diff changeset
359
a61af66fc99e Initial load
duke
parents:
diff changeset
360
a61af66fc99e Initial load
duke
parents:
diff changeset
361 int Compilation::compile_java_method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
362 assert(!method()->is_native(), "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
363
a61af66fc99e Initial load
duke
parents:
diff changeset
364 if (BailoutOnExceptionHandlers) {
a61af66fc99e Initial load
duke
parents:
diff changeset
365 if (method()->has_exception_handlers()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
366 bailout("linear scan can't handle exception handlers");
a61af66fc99e Initial load
duke
parents:
diff changeset
367 }
a61af66fc99e Initial load
duke
parents:
diff changeset
368 }
a61af66fc99e Initial load
duke
parents:
diff changeset
369
a61af66fc99e Initial load
duke
parents:
diff changeset
370 CHECK_BAILOUT_(no_frame_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
371
2007
5ddfcf4b079e 7003554: (tiered) assert(is_null_object() || handle() != NULL) failed: cannot embed null pointer
iveresov
parents: 1972
diff changeset
372 if (is_profiling() && !method()->ensure_method_data()) {
5ddfcf4b079e 7003554: (tiered) assert(is_null_object() || handle() != NULL) failed: cannot embed null pointer
iveresov
parents: 1972
diff changeset
373 BAILOUT_("mdo allocation failed", no_frame_size);
1783
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1748
diff changeset
374 }
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1748
diff changeset
375
0
a61af66fc99e Initial load
duke
parents:
diff changeset
376 {
a61af66fc99e Initial load
duke
parents:
diff changeset
377 PhaseTraceTime timeit(_t_buildIR);
1783
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1748
diff changeset
378 build_hir();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
379 }
a61af66fc99e Initial load
duke
parents:
diff changeset
380 if (BailoutAfterHIR) {
a61af66fc99e Initial load
duke
parents:
diff changeset
381 BAILOUT_("Bailing out because of -XX:+BailoutAfterHIR", no_frame_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
382 }
a61af66fc99e Initial load
duke
parents:
diff changeset
383
a61af66fc99e Initial load
duke
parents:
diff changeset
384
a61af66fc99e Initial load
duke
parents:
diff changeset
385 {
a61af66fc99e Initial load
duke
parents:
diff changeset
386 PhaseTraceTime timeit(_t_emit_lir);
a61af66fc99e Initial load
duke
parents:
diff changeset
387
a61af66fc99e Initial load
duke
parents:
diff changeset
388 _frame_map = new FrameMap(method(), hir()->number_of_locks(), MAX2(4, hir()->max_stack()));
a61af66fc99e Initial load
duke
parents:
diff changeset
389 emit_lir();
a61af66fc99e Initial load
duke
parents:
diff changeset
390 }
a61af66fc99e Initial load
duke
parents:
diff changeset
391 CHECK_BAILOUT_(no_frame_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
392
a61af66fc99e Initial load
duke
parents:
diff changeset
393 {
a61af66fc99e Initial load
duke
parents:
diff changeset
394 PhaseTraceTime timeit(_t_codeemit);
a61af66fc99e Initial load
duke
parents:
diff changeset
395 return emit_code_body();
a61af66fc99e Initial load
duke
parents:
diff changeset
396 }
a61af66fc99e Initial load
duke
parents:
diff changeset
397 }
a61af66fc99e Initial load
duke
parents:
diff changeset
398
a61af66fc99e Initial load
duke
parents:
diff changeset
399 void Compilation::install_code(int frame_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
400 // frame_size is in 32-bit words so adjust it intptr_t words
a61af66fc99e Initial load
duke
parents:
diff changeset
401 assert(frame_size == frame_map()->framesize(), "must match");
a61af66fc99e Initial load
duke
parents:
diff changeset
402 assert(in_bytes(frame_map()->framesize_in_bytes()) % sizeof(intptr_t) == 0, "must be at least pointer aligned");
a61af66fc99e Initial load
duke
parents:
diff changeset
403 _env->register_method(
a61af66fc99e Initial load
duke
parents:
diff changeset
404 method(),
a61af66fc99e Initial load
duke
parents:
diff changeset
405 osr_bci(),
a61af66fc99e Initial load
duke
parents:
diff changeset
406 &_offsets,
a61af66fc99e Initial load
duke
parents:
diff changeset
407 in_bytes(_frame_map->sp_offset_for_orig_pc()),
a61af66fc99e Initial load
duke
parents:
diff changeset
408 code(),
a61af66fc99e Initial load
duke
parents:
diff changeset
409 in_bytes(frame_map()->framesize_in_bytes()) / sizeof(intptr_t),
a61af66fc99e Initial load
duke
parents:
diff changeset
410 debug_info_recorder()->_oopmaps,
a61af66fc99e Initial load
duke
parents:
diff changeset
411 exception_handler_table(),
a61af66fc99e Initial load
duke
parents:
diff changeset
412 implicit_exception_table(),
a61af66fc99e Initial load
duke
parents:
diff changeset
413 compiler(),
a61af66fc99e Initial load
duke
parents:
diff changeset
414 _env->comp_level(),
6792
137868b7aa6f 7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents: 6266
diff changeset
415 has_unsafe_access(),
137868b7aa6f 7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents: 6266
diff changeset
416 SharedRuntime::is_wide_vector(max_vector_size())
0
a61af66fc99e Initial load
duke
parents:
diff changeset
417 );
a61af66fc99e Initial load
duke
parents:
diff changeset
418 }
a61af66fc99e Initial load
duke
parents:
diff changeset
419
a61af66fc99e Initial load
duke
parents:
diff changeset
420
a61af66fc99e Initial load
duke
parents:
diff changeset
421 void Compilation::compile_method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
422 // setup compilation
a61af66fc99e Initial load
duke
parents:
diff changeset
423 initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
424
a61af66fc99e Initial load
duke
parents:
diff changeset
425 if (!method()->can_be_compiled()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
426 // Prevent race condition 6328518.
a61af66fc99e Initial load
duke
parents:
diff changeset
427 // This can happen if the method is obsolete or breakpointed.
a61af66fc99e Initial load
duke
parents:
diff changeset
428 bailout("Bailing out because method is not compilable");
a61af66fc99e Initial load
duke
parents:
diff changeset
429 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
430 }
a61af66fc99e Initial load
duke
parents:
diff changeset
431
780
c96bf21b756f 6788527: Server vm intermittently fails with assertion "live value must not be garbage" with fastdebug bits
kvn
parents: 0
diff changeset
432 if (_env->jvmti_can_hotswap_or_post_breakpoint()) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
433 // We can assert evol_method because method->can_be_compiled is true.
a61af66fc99e Initial load
duke
parents:
diff changeset
434 dependency_recorder()->assert_evol_method(method());
a61af66fc99e Initial load
duke
parents:
diff changeset
435 }
a61af66fc99e Initial load
duke
parents:
diff changeset
436
a61af66fc99e Initial load
duke
parents:
diff changeset
437 if (method()->break_at_execute()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
438 BREAKPOINT;
a61af66fc99e Initial load
duke
parents:
diff changeset
439 }
a61af66fc99e Initial load
duke
parents:
diff changeset
440
a61af66fc99e Initial load
duke
parents:
diff changeset
441 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
442 if (PrintCFGToFile) {
a61af66fc99e Initial load
duke
parents:
diff changeset
443 CFGPrinter::print_compilation(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
444 }
a61af66fc99e Initial load
duke
parents:
diff changeset
445 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
446
a61af66fc99e Initial load
duke
parents:
diff changeset
447 // compile method
a61af66fc99e Initial load
duke
parents:
diff changeset
448 int frame_size = compile_java_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
449
a61af66fc99e Initial load
duke
parents:
diff changeset
450 // bailout if method couldn't be compiled
a61af66fc99e Initial load
duke
parents:
diff changeset
451 // Note: make sure we mark the method as not compilable!
a61af66fc99e Initial load
duke
parents:
diff changeset
452 CHECK_BAILOUT();
a61af66fc99e Initial load
duke
parents:
diff changeset
453
a61af66fc99e Initial load
duke
parents:
diff changeset
454 if (InstallMethods) {
a61af66fc99e Initial load
duke
parents:
diff changeset
455 // install code
a61af66fc99e Initial load
duke
parents:
diff changeset
456 PhaseTraceTime timeit(_t_codeinstall);
a61af66fc99e Initial load
duke
parents:
diff changeset
457 install_code(frame_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
458 }
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
459
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
460 if (log() != NULL) // Print code cache state into compiler log
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
461 log()->code_cache_state();
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
462
0
a61af66fc99e Initial load
duke
parents:
diff changeset
463 totalInstructionNodes += Instruction::number_of_instructions();
a61af66fc99e Initial load
duke
parents:
diff changeset
464 }
a61af66fc99e Initial load
duke
parents:
diff changeset
465
a61af66fc99e Initial load
duke
parents:
diff changeset
466
a61af66fc99e Initial load
duke
parents:
diff changeset
467 void Compilation::generate_exception_handler_table() {
a61af66fc99e Initial load
duke
parents:
diff changeset
468 // Generate an ExceptionHandlerTable from the exception handler
a61af66fc99e Initial load
duke
parents:
diff changeset
469 // information accumulated during the compilation.
a61af66fc99e Initial load
duke
parents:
diff changeset
470 ExceptionInfoList* info_list = exception_info_list();
a61af66fc99e Initial load
duke
parents:
diff changeset
471
a61af66fc99e Initial load
duke
parents:
diff changeset
472 if (info_list->length() == 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
473 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
474 }
a61af66fc99e Initial load
duke
parents:
diff changeset
475
a61af66fc99e Initial load
duke
parents:
diff changeset
476 // allocate some arrays for use by the collection code.
a61af66fc99e Initial load
duke
parents:
diff changeset
477 const int num_handlers = 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
478 GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t>(num_handlers);
a61af66fc99e Initial load
duke
parents:
diff changeset
479 GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t>(num_handlers);
a61af66fc99e Initial load
duke
parents:
diff changeset
480 GrowableArray<intptr_t>* pcos = new GrowableArray<intptr_t>(num_handlers);
a61af66fc99e Initial load
duke
parents:
diff changeset
481
a61af66fc99e Initial load
duke
parents:
diff changeset
482 for (int i = 0; i < info_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
483 ExceptionInfo* info = info_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
484 XHandlers* handlers = info->exception_handlers();
a61af66fc99e Initial load
duke
parents:
diff changeset
485
a61af66fc99e Initial load
duke
parents:
diff changeset
486 // empty the arrays
a61af66fc99e Initial load
duke
parents:
diff changeset
487 bcis->trunc_to(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
488 scope_depths->trunc_to(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
489 pcos->trunc_to(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
490
a61af66fc99e Initial load
duke
parents:
diff changeset
491 for (int i = 0; i < handlers->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
492 XHandler* handler = handlers->handler_at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
493 assert(handler->entry_pco() != -1, "must have been generated");
a61af66fc99e Initial load
duke
parents:
diff changeset
494
a61af66fc99e Initial load
duke
parents:
diff changeset
495 int e = bcis->find(handler->handler_bci());
a61af66fc99e Initial load
duke
parents:
diff changeset
496 if (e >= 0 && scope_depths->at(e) == handler->scope_count()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
497 // two different handlers are declared to dispatch to the same
a61af66fc99e Initial load
duke
parents:
diff changeset
498 // catch bci. During parsing we created edges for each
a61af66fc99e Initial load
duke
parents:
diff changeset
499 // handler but we really only need one. The exception handler
a61af66fc99e Initial load
duke
parents:
diff changeset
500 // table will also get unhappy if we try to declare both since
a61af66fc99e Initial load
duke
parents:
diff changeset
501 // it's nonsensical. Just skip this handler.
a61af66fc99e Initial load
duke
parents:
diff changeset
502 continue;
a61af66fc99e Initial load
duke
parents:
diff changeset
503 }
a61af66fc99e Initial load
duke
parents:
diff changeset
504
a61af66fc99e Initial load
duke
parents:
diff changeset
505 bcis->append(handler->handler_bci());
a61af66fc99e Initial load
duke
parents:
diff changeset
506 if (handler->handler_bci() == -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
507 // insert a wildcard handler at scope depth 0 so that the
a61af66fc99e Initial load
duke
parents:
diff changeset
508 // exception lookup logic with find it.
a61af66fc99e Initial load
duke
parents:
diff changeset
509 scope_depths->append(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
510 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
511 scope_depths->append(handler->scope_count());
a61af66fc99e Initial load
duke
parents:
diff changeset
512 }
a61af66fc99e Initial load
duke
parents:
diff changeset
513 pcos->append(handler->entry_pco());
a61af66fc99e Initial load
duke
parents:
diff changeset
514
a61af66fc99e Initial load
duke
parents:
diff changeset
515 // stop processing once we hit a catch any
a61af66fc99e Initial load
duke
parents:
diff changeset
516 if (handler->is_catch_all()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
517 assert(i == handlers->length() - 1, "catch all must be last handler");
a61af66fc99e Initial load
duke
parents:
diff changeset
518 }
a61af66fc99e Initial load
duke
parents:
diff changeset
519 }
a61af66fc99e Initial load
duke
parents:
diff changeset
520 exception_handler_table()->add_subtable(info->pco(), bcis, scope_depths, pcos);
a61af66fc99e Initial load
duke
parents:
diff changeset
521 }
a61af66fc99e Initial load
duke
parents:
diff changeset
522 }
a61af66fc99e Initial load
duke
parents:
diff changeset
523
a61af66fc99e Initial load
duke
parents:
diff changeset
524
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
525 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
526 int osr_bci, BufferBlob* buffer_blob)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
527 : _compiler(compiler)
a61af66fc99e Initial load
duke
parents:
diff changeset
528 , _env(env)
6843
c3e799c37717 7177003: C1: LogCompilation support
vlivanov
parents: 6792
diff changeset
529 , _log(env->log())
0
a61af66fc99e Initial load
duke
parents:
diff changeset
530 , _method(method)
a61af66fc99e Initial load
duke
parents:
diff changeset
531 , _osr_bci(osr_bci)
a61af66fc99e Initial load
duke
parents:
diff changeset
532 , _hir(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
533 , _max_spills(-1)
a61af66fc99e Initial load
duke
parents:
diff changeset
534 , _frame_map(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
535 , _masm(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
536 , _has_exception_handlers(false)
a61af66fc99e Initial load
duke
parents:
diff changeset
537 , _has_fpu_code(true) // pessimistic assumption
1783
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1748
diff changeset
538 , _would_profile(false)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
539 , _has_unsafe_access(false)
1691
4a665be40fd3 6975855: don't emit deopt MH handler in C1 if not required
twisti
parents: 1617
diff changeset
540 , _has_method_handle_invokes(false)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
541 , _bailout_msg(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
542 , _exception_info_list(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
543 , _allocator(NULL)
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
544 , _next_id(0)
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
545 , _next_block_id(0)
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1691
diff changeset
546 , _code(buffer_blob)
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
547 , _has_access_indexed(false)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
548 , _current_instruction(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
549 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
550 , _last_instruction_printed(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
551 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
552 {
a61af66fc99e Initial load
duke
parents:
diff changeset
553 PhaseTraceTime timeit(_t_compile);
a61af66fc99e Initial load
duke
parents:
diff changeset
554 _arena = Thread::current()->resource_area();
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
555 _env->set_compiler_data(this);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
556 _exception_info_list = new ExceptionInfoList();
a61af66fc99e Initial load
duke
parents:
diff changeset
557 _implicit_exception_table.set_size(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
558 compile_method();
1964
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
559 if (bailed_out()) {
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
560 _env->record_method_not_compilable(bailout_msg(), !TieredCompilation);
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
561 if (is_profiling()) {
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
562 // Compilation failed, create MDO, which would signal the interpreter
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
563 // to start profiling on its own.
2007
5ddfcf4b079e 7003554: (tiered) assert(is_null_object() || handle() != NULL) failed: cannot embed null pointer
iveresov
parents: 1972
diff changeset
564 _method->ensure_method_data();
1964
22ef3370343b 7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents: 1783
diff changeset
565 }
2252
72d6c57d0658 7017434: Tiered needs to support reprofiling
iveresov
parents: 2098
diff changeset
566 } else if (is_profiling()) {
2007
5ddfcf4b079e 7003554: (tiered) assert(is_null_object() || handle() != NULL) failed: cannot embed null pointer
iveresov
parents: 1972
diff changeset
567 ciMethodData *md = method->method_data_or_null();
2252
72d6c57d0658 7017434: Tiered needs to support reprofiling
iveresov
parents: 2098
diff changeset
568 if (md != NULL) {
72d6c57d0658 7017434: Tiered needs to support reprofiling
iveresov
parents: 2098
diff changeset
569 md->set_would_profile(_would_profile);
72d6c57d0658 7017434: Tiered needs to support reprofiling
iveresov
parents: 2098
diff changeset
570 }
1783
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1748
diff changeset
571 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
572 }
a61af66fc99e Initial load
duke
parents:
diff changeset
573
a61af66fc99e Initial load
duke
parents:
diff changeset
574 Compilation::~Compilation() {
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
575 _env->set_compiler_data(NULL);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
576 }
a61af66fc99e Initial load
duke
parents:
diff changeset
577
a61af66fc99e Initial load
duke
parents:
diff changeset
578
a61af66fc99e Initial load
duke
parents:
diff changeset
579 void Compilation::add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers) {
a61af66fc99e Initial load
duke
parents:
diff changeset
580 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
581 if (PrintExceptionHandlers && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
582 tty->print_cr(" added exception scope for pco %d", pco);
a61af66fc99e Initial load
duke
parents:
diff changeset
583 }
a61af66fc99e Initial load
duke
parents:
diff changeset
584 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
585 // Note: we do not have program counters for these exception handlers yet
a61af66fc99e Initial load
duke
parents:
diff changeset
586 exception_info_list()->push(new ExceptionInfo(pco, exception_handlers));
a61af66fc99e Initial load
duke
parents:
diff changeset
587 }
a61af66fc99e Initial load
duke
parents:
diff changeset
588
a61af66fc99e Initial load
duke
parents:
diff changeset
589
a61af66fc99e Initial load
duke
parents:
diff changeset
590 void Compilation::notice_inlined_method(ciMethod* method) {
a61af66fc99e Initial load
duke
parents:
diff changeset
591 _env->notice_inlined_method(method);
a61af66fc99e Initial load
duke
parents:
diff changeset
592 }
a61af66fc99e Initial load
duke
parents:
diff changeset
593
a61af66fc99e Initial load
duke
parents:
diff changeset
594
a61af66fc99e Initial load
duke
parents:
diff changeset
595 void Compilation::bailout(const char* msg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
596 assert(msg != NULL, "bailout message must exist");
a61af66fc99e Initial load
duke
parents:
diff changeset
597 if (!bailed_out()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
598 // keep first bailout message
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3899
diff changeset
599 if (PrintCompilation || PrintBailouts) tty->print_cr("compilation bailout: %s", msg);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
600 _bailout_msg = msg;
a61af66fc99e Initial load
duke
parents:
diff changeset
601 }
a61af66fc99e Initial load
duke
parents:
diff changeset
602 }
a61af66fc99e Initial load
duke
parents:
diff changeset
603
12875
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
604 ciKlass* Compilation::cha_exact_type(ciType* type) {
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
605 if (type != NULL && type->is_loaded() && type->is_instance_klass()) {
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
606 ciInstanceKlass* ik = type->as_instance_klass();
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
607 assert(ik->exact_klass() == NULL, "no cha for final klass");
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
608 if (DeoptC1 && UseCHA && !(ik->has_subklass() || ik->is_interface())) {
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
609 dependency_recorder()->assert_leaf_type(ik);
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
610 return ik;
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
611 }
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
612 }
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
613 return NULL;
d13d7aba8c12 8023657: New type profiling points: arguments to call
roland
parents: 12162
diff changeset
614 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
615
a61af66fc99e Initial load
duke
parents:
diff changeset
616 void Compilation::print_timers() {
a61af66fc99e Initial load
duke
parents:
diff changeset
617 // tty->print_cr(" Native methods : %6.3f s, Average : %2.3f", CompileBroker::_t_native_compilation.seconds(), CompileBroker::_t_native_compilation.seconds() / CompileBroker::_total_native_compile_count);
a61af66fc99e Initial load
duke
parents:
diff changeset
618 float total = timers[_t_setup].seconds() + timers[_t_buildIR].seconds() + timers[_t_emit_lir].seconds() + timers[_t_lir_schedule].seconds() + timers[_t_codeemit].seconds() + timers[_t_codeinstall].seconds();
a61af66fc99e Initial load
duke
parents:
diff changeset
619
a61af66fc99e Initial load
duke
parents:
diff changeset
620
a61af66fc99e Initial load
duke
parents:
diff changeset
621 tty->print_cr(" Detailed C1 Timings");
a61af66fc99e Initial load
duke
parents:
diff changeset
622 tty->print_cr(" Setup time: %6.3f s (%4.1f%%)", timers[_t_setup].seconds(), (timers[_t_setup].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
623 tty->print_cr(" Build IR: %6.3f s (%4.1f%%)", timers[_t_buildIR].seconds(), (timers[_t_buildIR].seconds() / total) * 100.0);
8860
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
624 float t_optimizeIR = timers[_t_optimize_blocks].seconds() + timers[_t_optimize_null_checks].seconds();
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
625 tty->print_cr(" Optimize: %6.3f s (%4.1f%%)", t_optimizeIR, (t_optimizeIR / total) * 100.0);
46f6f063b272 7153771: array bound check elimination for c1
roland
parents: 7201
diff changeset
626 tty->print_cr(" RCE: %6.3f s (%4.1f%%)", timers[_t_rangeCheckElimination].seconds(), (timers[_t_rangeCheckElimination].seconds() / total) * 100.0);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
627 tty->print_cr(" Emit LIR: %6.3f s (%4.1f%%)", timers[_t_emit_lir].seconds(), (timers[_t_emit_lir].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
628 tty->print_cr(" LIR Gen: %6.3f s (%4.1f%%)", timers[_t_lirGeneration].seconds(), (timers[_t_lirGeneration].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
629 tty->print_cr(" Linear Scan: %6.3f s (%4.1f%%)", timers[_t_linearScan].seconds(), (timers[_t_linearScan].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
630 NOT_PRODUCT(LinearScan::print_timers(timers[_t_linearScan].seconds()));
a61af66fc99e Initial load
duke
parents:
diff changeset
631 tty->print_cr(" LIR Schedule: %6.3f s (%4.1f%%)", timers[_t_lir_schedule].seconds(), (timers[_t_lir_schedule].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
632 tty->print_cr(" Code Emission: %6.3f s (%4.1f%%)", timers[_t_codeemit].seconds(), (timers[_t_codeemit].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
633 tty->print_cr(" Code Installation: %6.3f s (%4.1f%%)", timers[_t_codeinstall].seconds(), (timers[_t_codeinstall].seconds() / total) * 100.0);
a61af66fc99e Initial load
duke
parents:
diff changeset
634 tty->print_cr(" Instruction Nodes: %6d nodes", totalInstructionNodes);
a61af66fc99e Initial load
duke
parents:
diff changeset
635
a61af66fc99e Initial load
duke
parents:
diff changeset
636 NOT_PRODUCT(LinearScan::print_statistics());
a61af66fc99e Initial load
duke
parents:
diff changeset
637 }
a61af66fc99e Initial load
duke
parents:
diff changeset
638
a61af66fc99e Initial load
duke
parents:
diff changeset
639
a61af66fc99e Initial load
duke
parents:
diff changeset
640 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
641 void Compilation::compile_only_this_method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
642 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
643 fileStream stream(fopen("c1_compile_only", "wt"));
a61af66fc99e Initial load
duke
parents:
diff changeset
644 stream.print_cr("# c1 compile only directives");
a61af66fc99e Initial load
duke
parents:
diff changeset
645 compile_only_this_scope(&stream, hir()->top_scope());
a61af66fc99e Initial load
duke
parents:
diff changeset
646 }
a61af66fc99e Initial load
duke
parents:
diff changeset
647
a61af66fc99e Initial load
duke
parents:
diff changeset
648
a61af66fc99e Initial load
duke
parents:
diff changeset
649 void Compilation::compile_only_this_scope(outputStream* st, IRScope* scope) {
a61af66fc99e Initial load
duke
parents:
diff changeset
650 st->print("CompileOnly=");
a61af66fc99e Initial load
duke
parents:
diff changeset
651 scope->method()->holder()->name()->print_symbol_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
652 st->print(".");
a61af66fc99e Initial load
duke
parents:
diff changeset
653 scope->method()->name()->print_symbol_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
654 st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
655 }
a61af66fc99e Initial load
duke
parents:
diff changeset
656
a61af66fc99e Initial load
duke
parents:
diff changeset
657
a61af66fc99e Initial load
duke
parents:
diff changeset
658 void Compilation::exclude_this_method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
659 fileStream stream(fopen(".hotspot_compiler", "at"));
a61af66fc99e Initial load
duke
parents:
diff changeset
660 stream.print("exclude ");
a61af66fc99e Initial load
duke
parents:
diff changeset
661 method()->holder()->name()->print_symbol_on(&stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
662 stream.print(" ");
a61af66fc99e Initial load
duke
parents:
diff changeset
663 method()->name()->print_symbol_on(&stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
664 stream.cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
665 stream.cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
666 }
a61af66fc99e Initial load
duke
parents:
diff changeset
667 #endif