67 StubCodeGenerator::StubCodeGenerator(CodeBuffer* code) { |
67 StubCodeGenerator::StubCodeGenerator(CodeBuffer* code) { |
68 _masm = new MacroAssembler(code); |
68 _masm = new MacroAssembler(code); |
69 _first_stub = _last_stub = NULL; |
69 _first_stub = _last_stub = NULL; |
70 } |
70 } |
71 |
71 |
72 #ifndef PRODUCT |
|
73 extern "C" { |
72 extern "C" { |
74 static int compare_cdesc(const void* void_a, const void* void_b) { |
73 static int compare_cdesc(const void* void_a, const void* void_b) { |
75 int ai = (*((StubCodeDesc**) void_a))->index(); |
74 int ai = (*((StubCodeDesc**) void_a))->index(); |
76 int bi = (*((StubCodeDesc**) void_b))->index(); |
75 int bi = (*((StubCodeDesc**) void_b))->index(); |
77 return ai - bi; |
76 return ai - bi; |
78 } |
77 } |
79 } |
78 } |
80 #endif |
|
81 |
79 |
82 StubCodeGenerator::~StubCodeGenerator() { |
80 StubCodeGenerator::~StubCodeGenerator() { |
83 #ifndef PRODUCT |
|
84 if (PrintStubCode) { |
81 if (PrintStubCode) { |
85 CodeBuffer* cbuf = _masm->code(); |
82 CodeBuffer* cbuf = _masm->code(); |
86 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start()); |
83 CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start()); |
87 if (blob != NULL) { |
84 if (blob != NULL) { |
88 blob->set_comments(cbuf->comments()); |
85 blob->set_comments(cbuf->comments()); |