Mercurial > hg > truffle
comparison src/share/vm/code/codeBlob.cpp @ 12880:469216acdb28
8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
Summary: Ensure ensure correct initialization of compiler runtime
Reviewed-by: kvn, twisti
author | anoll |
---|---|
date | Thu, 10 Oct 2013 15:44:12 +0200 |
parents | 9758d9f36299 |
children | 096c224171c4 78bbf4d43a14 |
comparison
equal
deleted
inserted
replaced
12876:8b80b262e501 | 12880:469216acdb28 |
---|---|
243 | 243 |
244 return blob; | 244 return blob; |
245 } | 245 } |
246 | 246 |
247 | 247 |
248 void* BufferBlob::operator new(size_t s, unsigned size) throw() { | 248 void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw() { |
249 void* p = CodeCache::allocate(size); | 249 void* p = CodeCache::allocate(size, is_critical); |
250 return p; | 250 return p; |
251 } | 251 } |
252 | 252 |
253 | 253 |
254 void BufferBlob::free( BufferBlob *blob ) { | 254 void BufferBlob::free( BufferBlob *blob ) { |
275 | 275 |
276 AdapterBlob* blob = NULL; | 276 AdapterBlob* blob = NULL; |
277 unsigned int size = allocation_size(cb, sizeof(AdapterBlob)); | 277 unsigned int size = allocation_size(cb, sizeof(AdapterBlob)); |
278 { | 278 { |
279 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 279 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
280 blob = new (size) AdapterBlob(size, cb); | 280 // The parameter 'true' indicates a critical memory allocation. |
281 // This means that CodeCacheMinimumFreeSpace is used, if necessary | |
282 const bool is_critical = true; | |
283 blob = new (size, is_critical) AdapterBlob(size, cb); | |
281 } | 284 } |
282 // Track memory usage statistic after releasing CodeCache_lock | 285 // Track memory usage statistic after releasing CodeCache_lock |
283 MemoryService::track_code_cache_memory_usage(); | 286 MemoryService::track_code_cache_memory_usage(); |
284 | 287 |
285 return blob; | 288 return blob; |
297 // align the size to CodeEntryAlignment | 300 // align the size to CodeEntryAlignment |
298 size = align_code_offset(size); | 301 size = align_code_offset(size); |
299 size += round_to(buffer_size, oopSize); | 302 size += round_to(buffer_size, oopSize); |
300 { | 303 { |
301 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 304 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
302 blob = new (size) MethodHandlesAdapterBlob(size); | 305 // The parameter 'true' indicates a critical memory allocation. |
306 // This means that CodeCacheMinimumFreeSpace is used, if necessary | |
307 const bool is_critical = true; | |
308 blob = new (size, is_critical) MethodHandlesAdapterBlob(size); | |
303 } | 309 } |
304 // Track memory usage statistic after releasing CodeCache_lock | 310 // Track memory usage statistic after releasing CodeCache_lock |
305 MemoryService::track_code_cache_memory_usage(); | 311 MemoryService::track_code_cache_memory_usage(); |
306 | 312 |
307 return blob; | 313 return blob; |