comparison src/share/vm/ci/ciMethod.cpp @ 1692:d2ede61b7a12

6976186: integrate Shark HotSpot changes Summary: Shark is a JIT compiler for Zero that uses the LLVM compiler infrastructure. Reviewed-by: kvn, twisti Contributed-by: Gary Benson <gbenson@redhat.com>
author twisti
date Wed, 11 Aug 2010 05:51:21 -0700
parents e0ba4e04c839
children 3e8fbc61cee8
comparison
equal deleted inserted replaced
1691:4a665be40fd3 1692:d2ede61b7a12
53 // Lazy fields, filled in on demand. Require allocation. 53 // Lazy fields, filled in on demand. Require allocation.
54 _code = NULL; 54 _code = NULL;
55 _exception_handlers = NULL; 55 _exception_handlers = NULL;
56 _liveness = NULL; 56 _liveness = NULL;
57 _method_blocks = NULL; 57 _method_blocks = NULL;
58 #ifdef COMPILER2 58 #if defined(COMPILER2) || defined(SHARK)
59 _flow = NULL; 59 _flow = NULL;
60 _bcea = NULL; 60 _bcea = NULL;
61 #endif // COMPILER2 61 #endif // COMPILER2 || SHARK
62 62
63 ciEnv *env = CURRENT_ENV; 63 ciEnv *env = CURRENT_ENV;
64 if (env->jvmti_can_hotswap_or_post_breakpoint() && _is_compilable) { 64 if (env->jvmti_can_hotswap_or_post_breakpoint() && _is_compilable) {
65 // 6328518 check hotswap conditions under the right lock. 65 // 6328518 check hotswap conditions under the right lock.
66 MutexLocker locker(Compile_lock); 66 MutexLocker locker(Compile_lock);
121 _intrinsic_id = vmIntrinsics::_none; 121 _intrinsic_id = vmIntrinsics::_none;
122 _liveness = NULL; 122 _liveness = NULL;
123 _can_be_statically_bound = false; 123 _can_be_statically_bound = false;
124 _method_blocks = NULL; 124 _method_blocks = NULL;
125 _method_data = NULL; 125 _method_data = NULL;
126 #ifdef COMPILER2 126 #if defined(COMPILER2) || defined(SHARK)
127 _flow = NULL; 127 _flow = NULL;
128 _bcea = NULL; 128 _bcea = NULL;
129 #endif // COMPILER2 129 #endif // COMPILER2 || SHARK
130 } 130 }
131 131
132 132
133 // ------------------------------------------------------------------ 133 // ------------------------------------------------------------------
134 // ciMethod::load_code 134 // ciMethod::load_code
227 VM_ENTRY_MARK; 227 VM_ENTRY_MARK;
228 return get_methodOop()->vtable_index(); 228 return get_methodOop()->vtable_index();
229 } 229 }
230 230
231 231
232 #ifdef SHARK
233 // ------------------------------------------------------------------
234 // ciMethod::itable_index
235 //
236 // Get the position of this method's entry in the itable, if any.
237 int ciMethod::itable_index() {
238 check_is_loaded();
239 assert(holder()->is_linked(), "must be linked");
240 VM_ENTRY_MARK;
241 return klassItable::compute_itable_index(get_methodOop());
242 }
243 #endif // SHARK
244
245
232 // ------------------------------------------------------------------ 246 // ------------------------------------------------------------------
233 // ciMethod::native_entry 247 // ciMethod::native_entry
234 // 248 //
235 // Get the address of this method's native code, if any. 249 // Get the address of this method's native code, if any.
236 address ciMethod::native_entry() { 250 address ciMethod::native_entry() {
292 306
293 307
294 // ------------------------------------------------------------------ 308 // ------------------------------------------------------------------
295 // ciMethod::get_flow_analysis 309 // ciMethod::get_flow_analysis
296 ciTypeFlow* ciMethod::get_flow_analysis() { 310 ciTypeFlow* ciMethod::get_flow_analysis() {
297 #ifdef COMPILER2 311 #if defined(COMPILER2) || defined(SHARK)
298 if (_flow == NULL) { 312 if (_flow == NULL) {
299 ciEnv* env = CURRENT_ENV; 313 ciEnv* env = CURRENT_ENV;
300 _flow = new (env->arena()) ciTypeFlow(env, this); 314 _flow = new (env->arena()) ciTypeFlow(env, this);
301 _flow->do_flow(); 315 _flow->do_flow();
302 } 316 }
303 return _flow; 317 return _flow;
304 #else // COMPILER2 318 #else // COMPILER2 || SHARK
305 ShouldNotReachHere(); 319 ShouldNotReachHere();
306 return NULL; 320 return NULL;
307 #endif // COMPILER2 321 #endif // COMPILER2 || SHARK
308 } 322 }
309 323
310 324
311 // ------------------------------------------------------------------ 325 // ------------------------------------------------------------------
312 // ciMethod::get_osr_flow_analysis 326 // ciMethod::get_osr_flow_analysis
313 ciTypeFlow* ciMethod::get_osr_flow_analysis(int osr_bci) { 327 ciTypeFlow* ciMethod::get_osr_flow_analysis(int osr_bci) {
314 #ifdef COMPILER2 328 #if defined(COMPILER2) || defined(SHARK)
315 // OSR entry points are always place after a call bytecode of some sort 329 // OSR entry points are always place after a call bytecode of some sort
316 assert(osr_bci >= 0, "must supply valid OSR entry point"); 330 assert(osr_bci >= 0, "must supply valid OSR entry point");
317 ciEnv* env = CURRENT_ENV; 331 ciEnv* env = CURRENT_ENV;
318 ciTypeFlow* flow = new (env->arena()) ciTypeFlow(env, this, osr_bci); 332 ciTypeFlow* flow = new (env->arena()) ciTypeFlow(env, this, osr_bci);
319 flow->do_flow(); 333 flow->do_flow();
320 return flow; 334 return flow;
321 #else // COMPILER2 335 #else // COMPILER2 || SHARK
322 ShouldNotReachHere(); 336 ShouldNotReachHere();
323 return NULL; 337 return NULL;
324 #endif // COMPILER2 338 #endif // COMPILER2 || SHARK
325 } 339 }
326 340
327 // ------------------------------------------------------------------ 341 // ------------------------------------------------------------------
328 // ciMethod::raw_liveness_at_bci 342 // ciMethod::raw_liveness_at_bci
329 // 343 //