62 // Check that runtime and architecture description agree on callee-saved-floats
63 bool callee_saved_floats = false;
64 for( OptoReg::Name i=OptoReg::Name(0); i<OptoReg::Name(_last_Mach_Reg); i = OptoReg::add(i,1) ) {
65 // Is there a callee-saved float or double?
66 if( register_save_policy[i] == 'E' /* callee-saved */ &&
67 (register_save_type[i] == Op_RegF || register_save_type[i] == Op_RegD) ) {
68 callee_saved_floats = true;
69 }
70 }
71
72 DEBUG_ONLY( Node::init_NodeProperty(); )
73
74 Compile::pd_compiler2_init();
75
76 CompilerThread* thread = CompilerThread::current();
77
78 HandleMark handle_mark(thread);
79 return OptoRuntime::generate(thread->env());
80 }
81
82
83 void C2Compiler::initialize() {
84 // The first compiler thread that gets here will initialize the
85 // small amount of global state (and runtime stubs) that C2 needs.
86
87 // There is a race possible once at startup and then we're fine
88
89 // Note that this is being called from a compiler thread not the
90 // main startup thread.
91 if (should_perform_init()) {
92 bool successful = C2Compiler::init_c2_runtime();
93 int new_state = (successful) ? initialized : failed;
94 set_state(new_state);
95 }
96 }
97
98 void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
99 assert(is_initialized(), "Compiler thread must be initialized");
100
101 bool subsume_loads = SubsumeLoads;
102 bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables();
137 }
138 if (StressRecompilation) {
139 if (subsume_loads) {
140 subsume_loads = false;
141 continue; // retry
142 }
143 if (do_escape_analysis) {
144 do_escape_analysis = false;
145 continue; // retry
146 }
147 }
148
149 // print inlining for last compilation only
150 C.dump_print_inlining();
151
152 // No retry; just break the loop.
153 break;
154 }
155 }
156
157
158 void C2Compiler::print_timers() {
159 Compile::print_timers();
160 }
161
162 int C2Compiler::initial_code_buffer_size() {
163 assert(SegmentedCodeCache, "Should be only used with a segmented code cache");
164 return Compile::MAX_inst_size + Compile::MAX_locs_size + initial_const_capacity;
165 }
|
62 // Check that runtime and architecture description agree on callee-saved-floats
63 bool callee_saved_floats = false;
64 for( OptoReg::Name i=OptoReg::Name(0); i<OptoReg::Name(_last_Mach_Reg); i = OptoReg::add(i,1) ) {
65 // Is there a callee-saved float or double?
66 if( register_save_policy[i] == 'E' /* callee-saved */ &&
67 (register_save_type[i] == Op_RegF || register_save_type[i] == Op_RegD) ) {
68 callee_saved_floats = true;
69 }
70 }
71
72 DEBUG_ONLY( Node::init_NodeProperty(); )
73
74 Compile::pd_compiler2_init();
75
76 CompilerThread* thread = CompilerThread::current();
77
78 HandleMark handle_mark(thread);
79 return OptoRuntime::generate(thread->env());
80 }
81
82 void C2Compiler::initialize() {
83 // The first compiler thread that gets here will initialize the
84 // small amount of global state (and runtime stubs) that C2 needs.
85
86 // There is a race possible once at startup and then we're fine
87
88 // Note that this is being called from a compiler thread not the
89 // main startup thread.
90 if (should_perform_init()) {
91 bool successful = C2Compiler::init_c2_runtime();
92 int new_state = (successful) ? initialized : failed;
93 set_state(new_state);
94 }
95 }
96
97 void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
98 assert(is_initialized(), "Compiler thread must be initialized");
99
100 bool subsume_loads = SubsumeLoads;
101 bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables();
136 }
137 if (StressRecompilation) {
138 if (subsume_loads) {
139 subsume_loads = false;
140 continue; // retry
141 }
142 if (do_escape_analysis) {
143 do_escape_analysis = false;
144 continue; // retry
145 }
146 }
147
148 // print inlining for last compilation only
149 C.dump_print_inlining();
150
151 // No retry; just break the loop.
152 break;
153 }
154 }
155
156 void C2Compiler::print_timers() {
157 Compile::print_timers();
158 }
159
160 bool C2Compiler::is_intrinsic_available_for(methodHandle method, methodHandle compilation_context) {
161 // Assume a non-virtual dispatch. A virtual dispatch is
162 // possible for only a limited set of available intrinsics whereas
163 // a non-virtual dispatch is possible for all available intrinsics.
164 return Compile::is_intrinsic_available_for(method(), compilation_context(), false);
165 }
166
167 bool C2Compiler::is_intrinsic_available_for(methodHandle method) {
168 return Compile::is_intrinsic_available_for(method(), NULL, false);
169 }
170
171 int C2Compiler::initial_code_buffer_size() {
172 assert(SegmentedCodeCache, "Should be only used with a segmented code cache");
173 return Compile::MAX_inst_size + Compile::MAX_locs_size + initial_const_capacity;
174 }
|