< prev index next >

src/hotspot/share/code/codeBlob.cpp

Print this page
@@ -61,10 +61,11 @@
  static_assert(!std::is_polymorphic<nmethod>::value,            "no virtual methods are allowed in nmethod");
  static_assert(!std::is_polymorphic<AdapterBlob>::value,        "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<VtableBlob>::value,         "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<MethodHandlesAdapterBlob>::value, "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<RuntimeStub>::value,        "no virtual methods are allowed in code blobs");
+ static_assert(!std::is_polymorphic<BufferedInlineTypeBlob>::value,   "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<DeoptimizationBlob>::value, "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<SafepointBlob>::value,      "no virtual methods are allowed in code blobs");
  static_assert(!std::is_polymorphic<UpcallStub>::value,         "no virtual methods are allowed in code blobs");
  #ifdef COMPILER2
  static_assert(!std::is_polymorphic<ExceptionBlob>::value,      "no virtual methods are allowed in code blobs");

@@ -89,10 +90,11 @@
        &nmethod::_vpntr,
        &BufferBlob::_vpntr,
        &AdapterBlob::_vpntr,
        &VtableBlob::_vpntr,
        &MethodHandlesAdapterBlob::_vpntr,
+       &BufferedInlineTypeBlob::_vpntr,
        &RuntimeStub::_vpntr,
        &DeoptimizationBlob::_vpntr,
        &SafepointBlob::_vpntr,
  #ifdef COMPILER2
        &ExceptionBlob::_vpntr,

@@ -424,11 +426,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);
+     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;

@@ -440,51 +442,61 @@
  
  void BufferBlob::free(BufferBlob *blob) {
    RuntimeBlob::free(blob);
  }
  
+ BufferBlob::BufferBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size, int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments)
+   : RuntimeBlob(name, kind, cb, size, header_size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments)
+ {}
+ 
  
  //----------------------------------------------------------------------------------------------------
  // Implementation of AdapterBlob
  
- AdapterBlob::AdapterBlob(int size, CodeBuffer* cb, int entry_offset[AdapterBlob::ENTRY_COUNT]) :
-   BufferBlob("I2C/C2I adapters", CodeBlobKind::Adapter, cb, size, sizeof(AdapterBlob)) {
+ AdapterBlob::AdapterBlob(int size, CodeBuffer* cb, int entry_offset[AdapterBlob::ENTRY_COUNT], int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) :
+   BufferBlob("I2C/C2I adapters", CodeBlobKind::Adapter, cb, size, sizeof(AdapterBlob), frame_complete, frame_size, oop_maps, caller_must_gc_arguments) {
    assert(entry_offset[0] == 0, "sanity check");
    for (int i = 1; i < AdapterBlob::ENTRY_COUNT; i++) {
      // The entry is within the adapter blob or unset.
      assert((entry_offset[i] > 0 && entry_offset[i] < cb->insts()->size()) ||
             (entry_offset[i] == -1),
             "invalid entry offset[%d] = 0x%x", i, entry_offset[i]);
    }
    _c2i_offset = entry_offset[1];
-   _c2i_unverified_offset = entry_offset[2];
-   _c2i_no_clinit_check_offset = entry_offset[3];
+   _c2i_inline_offset = entry_offset[2];
+   _c2i_inline_ro_offset = entry_offset[3];
+   _c2i_unverified_offset = entry_offset[4];
+   _c2i_unverified_inline_offset = entry_offset[5];
+   _c2i_no_clinit_check_offset = entry_offset[6];
    CodeCache::commit(this);
  }
  
- AdapterBlob* AdapterBlob::create(CodeBuffer* cb, int entry_offset[AdapterBlob::ENTRY_COUNT]) {
+ AdapterBlob* AdapterBlob::create(CodeBuffer* cb, int entry_offset[AdapterBlob::ENTRY_COUNT], 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, entry_offset);
+     blob = new (size) AdapterBlob(size, cb, entry_offset, 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;
  }
  
  void AdapterBlob::get_offsets(int entry_offset[ENTRY_COUNT]) {
    entry_offset[0] = 0;
    entry_offset[1] = _c2i_offset;
-   entry_offset[2] = _c2i_unverified_offset;
-   entry_offset[3] = _c2i_no_clinit_check_offset;
+   entry_offset[2] = _c2i_inline_offset;
+   entry_offset[3] = _c2i_inline_ro_offset;
+   entry_offset[4] = _c2i_unverified_offset;
+   entry_offset[5] = _c2i_unverified_inline_offset;
+   entry_offset[6] = _c2i_no_clinit_check_offset;
  }
  
  //----------------------------------------------------------------------------------------------------
  // Implementation of VtableBlob
  

@@ -557,10 +569,35 @@
  
    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,
    CodeBuffer* cb,
< prev index next >