< prev index next >

src/hotspot/cpu/x86/runtime_x86_64.cpp

Print this page
*** 23,10 ***
--- 23,11 ---
   */
  
  #ifdef COMPILER2
  #include "asm/macroAssembler.hpp"
  #include "asm/macroAssembler.inline.hpp"
+ #include "code/aotCodeCache.hpp"
  #include "code/vmreg.hpp"
  #include "interpreter/interpreter.hpp"
  #include "opto/runtime.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "runtime/stubRoutines.hpp"

*** 263,14 ***
    assert(!OptoRuntime::is_callee_saved_register(RAX_num), "");
    assert(!OptoRuntime::is_callee_saved_register(RCX_num), "");
  
    assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned");
  
    // Allocate space for the code
    ResourceMark rm;
    // Setup code generation tools
-   const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
    CodeBuffer buffer(name, 2048, 1024);
    if (buffer.blob() == nullptr) {
      return nullptr;
    }
    MacroAssembler* masm = new MacroAssembler(&buffer);
--- 264,19 ---
    assert(!OptoRuntime::is_callee_saved_register(RAX_num), "");
    assert(!OptoRuntime::is_callee_saved_register(RCX_num), "");
  
    assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned");
  
+   const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
+   CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::Blob, (uint)OptoStubId::exception_id, name);
+   if (blob != nullptr) {
+     return blob->as_exception_blob();
+   }
+ 
    // Allocate space for the code
    ResourceMark rm;
    // Setup code generation tools
    CodeBuffer buffer(name, 2048, 1024);
    if (buffer.blob() == nullptr) {
      return nullptr;
    }
    MacroAssembler* masm = new MacroAssembler(&buffer);

*** 361,8 ***
  
    // Make sure all code is generated
    masm->flush();
  
    // Set exception blob
!   return ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
  }
  #endif // COMPILER2
--- 367,10 ---
  
    // Make sure all code is generated
    masm->flush();
  
    // Set exception blob
!   ExceptionBlob* ex_blob = ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
+   AOTCodeCache::store_code_blob(*ex_blob, AOTCodeEntry::Blob, (uint)OptoStubId::exception_id, name);
+   return ex_blob;
  }
  #endif // COMPILER2
< prev index next >