< prev index next >

src/hotspot/share/code/codeBlob.cpp

Print this page
*** 245,12 ***
  
    return blob;
  }
  
  
! BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size)
!   : RuntimeBlob(name, kind, cb, size, sizeof(BufferBlob), CodeOffsets::frame_never_safe, 0, nullptr)
  {}
  
  // Used by gtest
  BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
    ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
--- 245,12 ---
  
    return blob;
  }
  
  
! BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, int header_size)
!   : RuntimeBlob(name, kind, cb, size, header_size, CodeOffsets::frame_never_safe, 0, nullptr)
  {}
  
  // Used by gtest
  BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
    ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock

*** 258,11 ***
    BufferBlob* blob = nullptr;
    unsigned int size = CodeBlob::allocation_size(cb, sizeof(BufferBlob));
    assert(name != nullptr, "must provide a name");
    {
      MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
!     blob = new (size) BufferBlob(name, CodeBlobKind::Buffer, cb, size);
    }
    // Track memory usage statistic after releasing CodeCache_lock
    MemoryService::track_code_cache_memory_usage();
  
    return blob;
--- 258,11 ---
    BufferBlob* blob = nullptr;
    unsigned int size = CodeBlob::allocation_size(cb, sizeof(BufferBlob));
    assert(name != nullptr, "must provide a name");
    {
      MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
!     blob = new (size) BufferBlob(name, CodeBlobKind::Buffer, cb, size, sizeof(BufferBlob));
    }
    // Track memory usage statistic after releasing CodeCache_lock
    MemoryService::track_code_cache_memory_usage();
  
    return blob;

*** 274,29 ***
  
  void BufferBlob::free(BufferBlob *blob) {
    RuntimeBlob::free(blob);
  }
  
  
  //----------------------------------------------------------------------------------------------------
  // Implementation of AdapterBlob
  
! AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
!   BufferBlob("I2C/C2I adapters", CodeBlobKind::Adapter, cb, size) {
    CodeCache::commit(this);
  }
  
! AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
    ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
  
    CodeCache::gc_on_allocation();
  
    AdapterBlob* blob = nullptr;
    unsigned int size = CodeBlob::allocation_size(cb, sizeof(AdapterBlob));
    {
      MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
!     blob = new (size) AdapterBlob(size, cb);
    }
    // Track memory usage statistic after releasing CodeCache_lock
    MemoryService::track_code_cache_memory_usage();
  
    return blob;
--- 274,33 ---
  
  void BufferBlob::free(BufferBlob *blob) {
    RuntimeBlob::free(blob);
  }
  
+ BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments)
+   : RuntimeBlob(name, kind, cb, size, sizeof(BufferBlob), frame_complete, frame_size, oop_maps, caller_must_gc_arguments)
+ {}
+ 
  
  //----------------------------------------------------------------------------------------------------
  // Implementation of AdapterBlob
  
! AdapterBlob::AdapterBlob(int size, CodeBuffer* cb, int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) :
!   BufferBlob("I2C/C2I adapters", CodeBlobKind::Adapter, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments) {
    CodeCache::commit(this);
  }
  
! AdapterBlob* AdapterBlob::create(CodeBuffer* cb, int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) {
    ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
  
    CodeCache::gc_on_allocation();
  
    AdapterBlob* blob = nullptr;
    unsigned int size = CodeBlob::allocation_size(cb, sizeof(AdapterBlob));
    {
      MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
!     blob = new (size) AdapterBlob(size, cb, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
    }
    // Track memory usage statistic after releasing CodeCache_lock
    MemoryService::track_code_cache_memory_usage();
  
    return blob;

*** 373,10 ***
--- 377,35 ---
    MemoryService::track_code_cache_memory_usage();
  
    return blob;
  }
  
+ //----------------------------------------------------------------------------------------------------
+ // Implementation of BufferedInlineTypeBlob
+ BufferedInlineTypeBlob::BufferedInlineTypeBlob(int size, CodeBuffer* cb, int pack_fields_off, int pack_fields_jobject_off, int unpack_fields_off) :
+   BufferBlob("buffered inline type", CodeBlobKind::BufferedInlineType, cb, size, sizeof(BufferedInlineTypeBlob)),
+   _pack_fields_off(pack_fields_off),
+   _pack_fields_jobject_off(pack_fields_jobject_off),
+   _unpack_fields_off(unpack_fields_off) {
+   CodeCache::commit(this);
+ }
+ 
+ BufferedInlineTypeBlob* BufferedInlineTypeBlob::create(CodeBuffer* cb, int pack_fields_off, int pack_fields_jobject_off, int unpack_fields_off) {
+   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
+ 
+   BufferedInlineTypeBlob* blob = nullptr;
+   unsigned int size = CodeBlob::allocation_size(cb, sizeof(BufferedInlineTypeBlob));
+   {
+     MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
+     blob = new (size) BufferedInlineTypeBlob(size, cb, pack_fields_off, pack_fields_jobject_off, unpack_fields_off);
+   }
+   // Track memory usage statistic after releasing CodeCache_lock
+   MemoryService::track_code_cache_memory_usage();
+ 
+   return blob;
+ }
+ 
  //----------------------------------------------------------------------------------------------------
  // Implementation of RuntimeStub
  
  RuntimeStub::RuntimeStub(
    const char* name,
< prev index next >