< prev index next >

src/hotspot/share/ci/ciMethod.cpp

Print this page
rev 53257 : 8216556: Unnecessary liveness computation with JVMTI
Reviewed-by:


 385 //
 386 // Which local variables are live at a specific bci?
 387 MethodLivenessResult ciMethod::raw_liveness_at_bci(int bci) {
 388   check_is_loaded();
 389   if (_liveness == NULL) {
 390     // Create the liveness analyzer.
 391     Arena* arena = CURRENT_ENV->arena();
 392     _liveness = new (arena) MethodLiveness(arena, this);
 393     _liveness->compute_liveness();
 394   }
 395   return _liveness->get_liveness_at(bci);
 396 }
 397 
 398 // ------------------------------------------------------------------
 399 // ciMethod::liveness_at_bci
 400 //
 401 // Which local variables are live at a specific bci?  When debugging
 402 // will return true for all locals in some cases to improve debug
 403 // information.
 404 MethodLivenessResult ciMethod::liveness_at_bci(int bci) {
 405   MethodLivenessResult result = raw_liveness_at_bci(bci);
 406   if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot) {
 407     // Keep all locals live for the user's edification and amusement.
 408     result.at_put_range(0, result.size(), true);
 409   }

 410   return result;


 411 }
 412 
 413 // ciMethod::live_local_oops_at_bci
 414 //
 415 // find all the live oops in the locals array for a particular bci
 416 // Compute what the interpreter believes by using the interpreter
 417 // oopmap generator. This is used as a double check during osr to
 418 // guard against conservative result from MethodLiveness making us
 419 // think a dead oop is live.  MethodLiveness is conservative in the
 420 // sense that it may consider locals to be live which cannot be live,
 421 // like in the case where a local could contain an oop or  a primitive
 422 // along different paths.  In that case the local must be dead when
 423 // those paths merge. Since the interpreter's viewpoint is used when
 424 // gc'ing an interpreter frame we need to use its viewpoint  during
 425 // OSR when loading the locals.
 426 
 427 ResourceBitMap ciMethod::live_local_oops_at_bci(int bci) {
 428   VM_ENTRY_MARK;
 429   InterpreterOopMap mask;
 430   OopMapCache::compute_one_oop_map(get_Method(), bci, &mask);




 385 //
 386 // Which local variables are live at a specific bci?
 387 MethodLivenessResult ciMethod::raw_liveness_at_bci(int bci) {
 388   check_is_loaded();
 389   if (_liveness == NULL) {
 390     // Create the liveness analyzer.
 391     Arena* arena = CURRENT_ENV->arena();
 392     _liveness = new (arena) MethodLiveness(arena, this);
 393     _liveness->compute_liveness();
 394   }
 395   return _liveness->get_liveness_at(bci);
 396 }
 397 
 398 // ------------------------------------------------------------------
 399 // ciMethod::liveness_at_bci
 400 //
 401 // Which local variables are live at a specific bci?  When debugging
 402 // will return true for all locals in some cases to improve debug
 403 // information.
 404 MethodLivenessResult ciMethod::liveness_at_bci(int bci) {

 405   if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot) {
 406     // Keep all locals live for the user's edification and amusement.
 407     MethodLivenessResult result(_max_locals);
 408     result.set_range(0, _max_locals);
 409     result.set_is_valid();
 410     return result;
 411   }
 412   return raw_liveness_at_bci(bci);
 413 }
 414 
 415 // ciMethod::live_local_oops_at_bci
 416 //
 417 // find all the live oops in the locals array for a particular bci
 418 // Compute what the interpreter believes by using the interpreter
 419 // oopmap generator. This is used as a double check during osr to
 420 // guard against conservative result from MethodLiveness making us
 421 // think a dead oop is live.  MethodLiveness is conservative in the
 422 // sense that it may consider locals to be live which cannot be live,
 423 // like in the case where a local could contain an oop or  a primitive
 424 // along different paths.  In that case the local must be dead when
 425 // those paths merge. Since the interpreter's viewpoint is used when
 426 // gc'ing an interpreter frame we need to use its viewpoint  during
 427 // OSR when loading the locals.
 428 
 429 ResourceBitMap ciMethod::live_local_oops_at_bci(int bci) {
 430   VM_ENTRY_MARK;
 431   InterpreterOopMap mask;
 432   OopMapCache::compute_one_oop_map(get_Method(), bci, &mask);


< prev index next >