< 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"

@@ -3603,13 +3604,21 @@
  
    // Allocate space for the code
    ResourceMark rm;
    // Setup code generation tools
    CodeBuffer buffer("exception_blob", 2048, 1024);
-   MacroAssembler* masm = new MacroAssembler(&buffer);
+   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

@@ -3651,11 +3660,12 @@
    // 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));
+   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
  

@@ -3692,10 +3702,11 @@
    __ 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 >