< prev index next >

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

Print this page
*** 29,10 ***
--- 29,11 ---
  #include "asm/macroAssembler.hpp"
  #include "asm/macroAssembler.inline.hpp"
  #include "code/compiledIC.hpp"
  #include "code/debugInfoRec.hpp"
  #include "code/nativeInst.hpp"
+ #include "code/SCCache.hpp"
  #include "code/vtableStubs.hpp"
  #include "compiler/oopMap.hpp"
  #include "gc/shared/collectedHeap.hpp"
  #include "gc/shared/gcLocker.hpp"
  #include "gc/shared/barrierSet.hpp"

*** 3640,13 ***
  
    // Allocate space for the code
    ResourceMark rm;
    // Setup code generation tools
    CodeBuffer buffer("exception_blob", 2048, 1024);
!   MacroAssembler* masm = new MacroAssembler(&buffer);
  
  
    address start = __ pc();
  
    // Exception pc is 'return address' for stack walker
    __ push(rdx);
    __ subptr(rsp, SimpleRuntimeFrame::return_off << LogBytesPerInt); // Prolog
--- 3641,21 ---
  
    // Allocate space for the code
    ResourceMark rm;
    // Setup code generation tools
    CodeBuffer buffer("exception_blob", 2048, 1024);
!   int pc_offset = 0;
+   if (SCCache::load_exception_blob(&buffer, &pc_offset)) {
+     OopMapSet* oop_maps = new OopMapSet();
+     oop_maps->add_gc_map(pc_offset, new OopMap(SimpleRuntimeFrame::framesize, 0));
  
+     // Set exception blob
+     _exception_blob =  ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
+     return;
+   }
  
+   MacroAssembler* masm = new MacroAssembler(&buffer);
    address start = __ pc();
  
    // Exception pc is 'return address' for stack walker
    __ push(rdx);
    __ subptr(rsp, SimpleRuntimeFrame::return_off << LogBytesPerInt); // Prolog

*** 3688,11 ***
    // handle_exception_stub), since they were restored when we got the
    // exception.
  
    OopMapSet* oop_maps = new OopMapSet();
  
!   oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
  
    __ reset_last_Java_frame(false);
  
    // Restore callee-saved registers
  
--- 3697,12 ---
    // handle_exception_stub), since they were restored when we got the
    // exception.
  
    OopMapSet* oop_maps = new OopMapSet();
  
!   pc_offset = the_pc - start;
+   oop_maps->add_gc_map(pc_offset, new OopMap(SimpleRuntimeFrame::framesize, 0));
  
    __ reset_last_Java_frame(false);
  
    // Restore callee-saved registers
  

*** 3729,9 ***
--- 3739,10 ---
    __ jmp(r8);
  
    // Make sure all code is generated
    masm->flush();
  
+   SCCache::store_exception_blob(&buffer, pc_offset);
    // Set exception blob
    _exception_blob =  ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
  }
  #endif // COMPILER2
< prev index next >