6993125: runThese crashes with assert(Thread::current()->on_local_stack((address)this))

Add another ResourceObj debug field to distinguish garbage

Reviewed-by: dholmes, coleenp
This commit is contained in:
Vladimir Kozlov 2010-12-10 14:14:02 -08:00
parent a9bee9ec34
commit 19a01fed97
3 changed files with 49 additions and 16 deletions

View file

@ -131,6 +131,7 @@ CodeBuffer::~CodeBuffer() {
#ifdef ASSERT
// Save allocation type to execute assert in ~ResourceObj()
// which is called after this destructor.
assert(_default_oop_recorder.allocated_on_stack(), "should be embedded object");
ResourceObj::allocation_type at = _default_oop_recorder.get_allocation_type();
Copy::fill_to_bytes(this, sizeof(*this), badResourceValue);
ResourceObj::set_allocation_type((address)(&_default_oop_recorder), at);