src/share/vm/code/codeBlob.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/code

src/share/vm/code/codeBlob.cpp

Print this page




 213   : CodeBlob(name, cb, sizeof(BufferBlob), size, CodeOffsets::frame_never_safe, 0, NULL)
 214 {}
 215 
 216 BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
 217   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 218 
 219   BufferBlob* blob = NULL;
 220   unsigned int size = allocation_size(cb, sizeof(BufferBlob));
 221   assert(name != NULL, "must provide a name");
 222   {
 223     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 224     blob = new (size) BufferBlob(name, size, cb);
 225   }
 226   // Track memory usage statistic after releasing CodeCache_lock
 227   MemoryService::track_code_cache_memory_usage();
 228 
 229   return blob;
 230 }
 231 
 232 void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw() {
 233   return CodeCache::allocate(size, CodeBlobType::NonMethod, is_critical);
 234 }
 235 
 236 void BufferBlob::free(BufferBlob *blob) {
 237   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 238   blob->flush();
 239   {
 240     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 241     CodeCache::free((CodeBlob*)blob);
 242   }
 243   // Track memory usage statistic after releasing CodeCache_lock
 244   MemoryService::track_code_cache_memory_usage();
 245 }
 246 
 247 
 248 //----------------------------------------------------------------------------------------------------
 249 // Implementation of AdapterBlob
 250 
 251 AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
 252   BufferBlob("I2C/C2I adapters", size, cb) {
 253   CodeCache::commit(this);


 319                                            int frame_complete,
 320                                            int frame_size,
 321                                            OopMapSet* oop_maps,
 322                                            bool caller_must_gc_arguments)
 323 {
 324   RuntimeStub* stub = NULL;
 325   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 326   {
 327     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 328     unsigned int size = allocation_size(cb, sizeof(RuntimeStub));
 329     stub = new (size) RuntimeStub(stub_name, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
 330   }
 331 
 332   trace_new_stub(stub, "RuntimeStub - ", stub_name);
 333 
 334   return stub;
 335 }
 336 
 337 
 338 void* RuntimeStub::operator new(size_t s, unsigned size) throw() {
 339   void* p = CodeCache::allocate(size, CodeBlobType::NonMethod, true);
 340   if (!p) fatal("Initial size of CodeCache is too small");
 341   return p;
 342 }
 343 
 344 // operator new shared by all singletons:
 345 void* SingletonBlob::operator new(size_t s, unsigned size) throw() {
 346   void* p = CodeCache::allocate(size, CodeBlobType::NonMethod, true);
 347   if (!p) fatal("Initial size of CodeCache is too small");
 348   return p;
 349 }
 350 
 351 
 352 //----------------------------------------------------------------------------------------------------
 353 // Implementation of DeoptimizationBlob
 354 
 355 DeoptimizationBlob::DeoptimizationBlob(
 356   CodeBuffer* cb,
 357   int         size,
 358   OopMapSet*  oop_maps,
 359   int         unpack_offset,
 360   int         unpack_with_exception_offset,
 361   int         unpack_with_reexecution_offset,
 362   int         frame_size
 363 )
 364 : SingletonBlob("DeoptimizationBlob", cb, sizeof(DeoptimizationBlob), size, frame_size, oop_maps)
 365 {
 366   _unpack_offset           = unpack_offset;




 213   : CodeBlob(name, cb, sizeof(BufferBlob), size, CodeOffsets::frame_never_safe, 0, NULL)
 214 {}
 215 
 216 BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
 217   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 218 
 219   BufferBlob* blob = NULL;
 220   unsigned int size = allocation_size(cb, sizeof(BufferBlob));
 221   assert(name != NULL, "must provide a name");
 222   {
 223     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 224     blob = new (size) BufferBlob(name, size, cb);
 225   }
 226   // Track memory usage statistic after releasing CodeCache_lock
 227   MemoryService::track_code_cache_memory_usage();
 228 
 229   return blob;
 230 }
 231 
 232 void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw() {
 233   return CodeCache::allocate(size, CodeBlobType::NonNMethod, is_critical);
 234 }
 235 
 236 void BufferBlob::free(BufferBlob *blob) {
 237   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 238   blob->flush();
 239   {
 240     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 241     CodeCache::free((CodeBlob*)blob);
 242   }
 243   // Track memory usage statistic after releasing CodeCache_lock
 244   MemoryService::track_code_cache_memory_usage();
 245 }
 246 
 247 
 248 //----------------------------------------------------------------------------------------------------
 249 // Implementation of AdapterBlob
 250 
 251 AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
 252   BufferBlob("I2C/C2I adapters", size, cb) {
 253   CodeCache::commit(this);


 319                                            int frame_complete,
 320                                            int frame_size,
 321                                            OopMapSet* oop_maps,
 322                                            bool caller_must_gc_arguments)
 323 {
 324   RuntimeStub* stub = NULL;
 325   ThreadInVMfromUnknown __tiv;  // get to VM state in case we block on CodeCache_lock
 326   {
 327     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 328     unsigned int size = allocation_size(cb, sizeof(RuntimeStub));
 329     stub = new (size) RuntimeStub(stub_name, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
 330   }
 331 
 332   trace_new_stub(stub, "RuntimeStub - ", stub_name);
 333 
 334   return stub;
 335 }
 336 
 337 
 338 void* RuntimeStub::operator new(size_t s, unsigned size) throw() {
 339   void* p = CodeCache::allocate(size, CodeBlobType::NonNMethod, true);
 340   if (!p) fatal("Initial size of CodeCache is too small");
 341   return p;
 342 }
 343 
 344 // operator new shared by all singletons:
 345 void* SingletonBlob::operator new(size_t s, unsigned size) throw() {
 346   void* p = CodeCache::allocate(size, CodeBlobType::NonNMethod, true);
 347   if (!p) fatal("Initial size of CodeCache is too small");
 348   return p;
 349 }
 350 
 351 
 352 //----------------------------------------------------------------------------------------------------
 353 // Implementation of DeoptimizationBlob
 354 
 355 DeoptimizationBlob::DeoptimizationBlob(
 356   CodeBuffer* cb,
 357   int         size,
 358   OopMapSet*  oop_maps,
 359   int         unpack_offset,
 360   int         unpack_with_exception_offset,
 361   int         unpack_with_reexecution_offset,
 362   int         frame_size
 363 )
 364 : SingletonBlob("DeoptimizationBlob", cb, sizeof(DeoptimizationBlob), size, frame_size, oop_maps)
 365 {
 366   _unpack_offset           = unpack_offset;


src/share/vm/code/codeBlob.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File