8009026: [parfait] Null pointer deference in hotspot/src/share/vm/code/nmethod.cpp

Add guarantee() to nmethod constructor and checks to ensure CodeCache has space before allocation

Reviewed-by: kvn
This commit is contained in:
Morris Meyer 2013-03-23 06:22:07 -07:00
parent 69a1275cf2
commit 981e9c35c9
2 changed files with 35 additions and 24 deletions

View file

@ -156,6 +156,11 @@ class CodeCache : AllStatic {
static address low_bound() { return (address) _heap->low_boundary(); }
static address high_bound() { return (address) _heap->high_boundary(); }
static bool has_space(int size) {
// Always leave some room in the CodeCache for I2C/C2I adapters
return largest_free_block() > (CodeCacheMinimumFreeSpace + size);
}
// Profiling
static address first_address(); // first address used for CodeBlobs
static address last_address(); // last address used for CodeBlobs