7052219: JSR 292: Crash in ~BufferBlob::MethodHandles adapters

Reviewed-by: twisti, kvn, jrose
This commit is contained in:
Tom Rodriguez 2011-06-14 14:41:33 -07:00
parent bb3a527f9a
commit 0c0705ca8c
8 changed files with 105 additions and 57 deletions

View file

@ -80,9 +80,10 @@ void StubCodeDesc::print_on(outputStream* st) const {
// Implementation of StubCodeGenerator
StubCodeGenerator::StubCodeGenerator(CodeBuffer* code) {
StubCodeGenerator::StubCodeGenerator(CodeBuffer* code, bool print_code) {
_masm = new MacroAssembler(code);
_first_stub = _last_stub = NULL;
_print_code = print_code;
}
extern "C" {
@ -94,7 +95,7 @@ extern "C" {
}
StubCodeGenerator::~StubCodeGenerator() {
if (PrintStubCode) {
if (PrintStubCode || _print_code) {
CodeBuffer* cbuf = _masm->code();
CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
if (blob != NULL) {