comparison src/share/vm/runtime/stubCodeGenerator.cpp @ 3757:f8c9417e3571

7052219: JSR 292: Crash in ~BufferBlob::MethodHandles adapters Reviewed-by: twisti, kvn, jrose
author never
date Tue, 14 Jun 2011 14:41:33 -0700
parents 1d1603768966
children cd3d6a6b95d9
comparison
equal deleted inserted replaced
3755:5cf771a79037 3757:f8c9417e3571
78 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes()); 78 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes());
79 } 79 }
80 80
81 // Implementation of StubCodeGenerator 81 // Implementation of StubCodeGenerator
82 82
83 StubCodeGenerator::StubCodeGenerator(CodeBuffer* code) { 83 StubCodeGenerator::StubCodeGenerator(CodeBuffer* code, bool print_code) {
84 _masm = new MacroAssembler(code); 84 _masm = new MacroAssembler(code);
85 _first_stub = _last_stub = NULL; 85 _first_stub = _last_stub = NULL;
86 _print_code = print_code;
86 } 87 }
87 88
88 extern "C" { 89 extern "C" {
89 static int compare_cdesc(const void* void_a, const void* void_b) { 90 static int compare_cdesc(const void* void_a, const void* void_b) {
90 int ai = (*((StubCodeDesc**) void_a))->index(); 91 int ai = (*((StubCodeDesc**) void_a))->index();
92 return ai - bi; 93 return ai - bi;
93 } 94 }
94 } 95 }
95 96
96 StubCodeGenerator::~StubCodeGenerator() { 97 StubCodeGenerator::~StubCodeGenerator() {
97 if (PrintStubCode) { 98 if (PrintStubCode || _print_code) {
98 CodeBuffer* cbuf = _masm->code(); 99 CodeBuffer* cbuf = _masm->code();
99 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start()); 100 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
100 if (blob != NULL) { 101 if (blob != NULL) {
101 blob->set_comments(cbuf->comments()); 102 blob->set_comments(cbuf->comments());
102 } 103 }