src/share/vm/ci/ciMethod.cpp

Print this page
rev 5933 : 8035493: JVMTI PopFrame capability must instruct compilers not to prune locals
Reviewed-by: kvn, sla, coleenp


 395 // Which local variables are live at a specific bci?
 396 MethodLivenessResult ciMethod::raw_liveness_at_bci(int bci) {
 397   check_is_loaded();
 398   if (_liveness == NULL) {
 399     // Create the liveness analyzer.
 400     Arena* arena = CURRENT_ENV->arena();
 401     _liveness = new (arena) MethodLiveness(arena, this);
 402     _liveness->compute_liveness();
 403   }
 404   return _liveness->get_liveness_at(bci);
 405 }
 406 
 407 // ------------------------------------------------------------------
 408 // ciMethod::liveness_at_bci
 409 //
 410 // Which local variables are live at a specific bci?  When debugging
 411 // will return true for all locals in some cases to improve debug
 412 // information.
 413 MethodLivenessResult ciMethod::liveness_at_bci(int bci) {
 414   MethodLivenessResult result = raw_liveness_at_bci(bci);
 415   if (CURRENT_ENV->jvmti_can_access_local_variables() || DeoptimizeALot || CompileTheWorld) {
 416     // Keep all locals live for the user's edification and amusement.
 417     result.at_put_range(0, result.size(), true);
 418   }
 419   return result;
 420 }
 421 
 422 // ciMethod::live_local_oops_at_bci
 423 //
 424 // find all the live oops in the locals array for a particular bci
 425 // Compute what the interpreter believes by using the interpreter
 426 // oopmap generator. This is used as a double check during osr to
 427 // guard against conservative result from MethodLiveness making us
 428 // think a dead oop is live.  MethodLiveness is conservative in the
 429 // sense that it may consider locals to be live which cannot be live,
 430 // like in the case where a local could contain an oop or  a primitive
 431 // along different paths.  In that case the local must be dead when
 432 // those paths merge. Since the interpreter's viewpoint is used when
 433 // gc'ing an interpreter frame we need to use its viewpoint  during
 434 // OSR when loading the locals.
 435 




 395 // Which local variables are live at a specific bci?
 396 MethodLivenessResult ciMethod::raw_liveness_at_bci(int bci) {
 397   check_is_loaded();
 398   if (_liveness == NULL) {
 399     // Create the liveness analyzer.
 400     Arena* arena = CURRENT_ENV->arena();
 401     _liveness = new (arena) MethodLiveness(arena, this);
 402     _liveness->compute_liveness();
 403   }
 404   return _liveness->get_liveness_at(bci);
 405 }
 406 
 407 // ------------------------------------------------------------------
 408 // ciMethod::liveness_at_bci
 409 //
 410 // Which local variables are live at a specific bci?  When debugging
 411 // will return true for all locals in some cases to improve debug
 412 // information.
 413 MethodLivenessResult ciMethod::liveness_at_bci(int bci) {
 414   MethodLivenessResult result = raw_liveness_at_bci(bci);
 415   if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot || CompileTheWorld) {
 416     // Keep all locals live for the user's edification and amusement.
 417     result.at_put_range(0, result.size(), true);
 418   }
 419   return result;
 420 }
 421 
 422 // ciMethod::live_local_oops_at_bci
 423 //
 424 // find all the live oops in the locals array for a particular bci
 425 // Compute what the interpreter believes by using the interpreter
 426 // oopmap generator. This is used as a double check during osr to
 427 // guard against conservative result from MethodLiveness making us
 428 // think a dead oop is live.  MethodLiveness is conservative in the
 429 // sense that it may consider locals to be live which cannot be live,
 430 // like in the case where a local could contain an oop or  a primitive
 431 // along different paths.  In that case the local must be dead when
 432 // those paths merge. Since the interpreter's viewpoint is used when
 433 // gc'ing an interpreter frame we need to use its viewpoint  during
 434 // OSR when loading the locals.
 435