src/hotspot/share/code/codeBlob.cpp
changeset 49655 d6893a76c554
parent 49449 ef5d5d343e2a
child 51333 f6641fcf7b7e
equal deleted inserted replaced
49654:16f53c9c7493 49655:d6893a76c554
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   292   MemoryService::track_code_cache_memory_usage();
   292   MemoryService::track_code_cache_memory_usage();
   293 
   293 
   294   return blob;
   294   return blob;
   295 }
   295 }
   296 
   296 
       
   297 VtableBlob::VtableBlob(const char* name, int size) :
       
   298   BufferBlob(name, size) {
       
   299 }
       
   300 
       
   301 VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
       
   302   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
       
   303 
       
   304   VtableBlob* blob = NULL;
       
   305   unsigned int size = sizeof(VtableBlob);
       
   306   // align the size to CodeEntryAlignment
       
   307   size = align_code_offset(size);
       
   308   size += align_up(buffer_size, oopSize);
       
   309   assert(name != NULL, "must provide a name");
       
   310   {
       
   311     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       
   312     blob = new (size) VtableBlob(name, size);
       
   313   }
       
   314   // Track memory usage statistic after releasing CodeCache_lock
       
   315   MemoryService::track_code_cache_memory_usage();
       
   316 
       
   317   return blob;
       
   318 }
   297 
   319 
   298 //----------------------------------------------------------------------------------------------------
   320 //----------------------------------------------------------------------------------------------------
   299 // Implementation of MethodHandlesAdapterBlob
   321 // Implementation of MethodHandlesAdapterBlob
   300 
   322 
   301 MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
   323 MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {