Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/c1/c1_Runtime1.cpp
          +++ new/src/share/vm/c1/c1_Runtime1.cpp
↓ open down ↓ 673 lines elided ↑ open up ↑
 674  674    oop obj = lock->obj();
 675  675    assert(obj->is_oop(), "must be NULL or an object");
 676  676    if (UseFastLocking) {
 677  677      // When using fast locking, the compiled code has already tried the fast case
 678  678      ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD);
 679  679    } else {
 680  680      ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD);
 681  681    }
 682  682  JRT_END
 683  683  
      684 +// Cf. OptoRuntime::deoptimize_caller_frame
      685 +JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
      686 +  // Called from within the owner thread, so no need for safepoint
      687 +  RegisterMap reg_map(thread, false);
      688 +  frame stub_frame = thread->last_frame();
      689 +  assert(stub_frame.is_runtime_frame(), "sanity check");
      690 +  frame caller_frame = stub_frame.sender(&reg_map);
      691 +
      692 +  // We are coming from a compiled method; check this is true.
      693 +  assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
      694 +
      695 +  // Deoptimize the caller frame.
      696 +  Deoptimization::deoptimize_frame(thread, caller_frame.id());
      697 +
      698 +  // Return to the now deoptimized frame.
      699 +JRT_END
      700 +
 684  701  
 685  702  static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
 686  703    Bytecode_field field_access(caller, bci);
 687  704    // This can be static or non-static field access
 688  705    Bytecodes::Code code       = field_access.code();
 689  706  
 690  707    // We must load class, initialize class and resolvethe field
 691  708    FieldAccessInfo result; // initialize class if needed
 692  709    constantPoolHandle constants(THREAD, caller->constants());
 693  710    LinkResolver::resolve_field(result, constants, field_access.index(), Bytecodes::java_code(code), false, CHECK_NULL);
↓ open down ↓ 606 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX