< prev index next >

src/hotspot/cpu/x86/runtime_x86_64.cpp

Print this page
@@ -24,10 +24,11 @@
  
  #include "precompiled.hpp"
  #ifdef COMPILER2
  #include "asm/macroAssembler.hpp"
  #include "asm/macroAssembler.inline.hpp"
+ #include "code/SCCache.hpp"
  #include "code/vmreg.hpp"
  #include "interpreter/interpreter.hpp"
  #include "opto/runtime.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "runtime/stubRoutines.hpp"

@@ -264,13 +265,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

@@ -312,11 +321,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
  

@@ -353,9 +363,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 >