mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8008555: Debugging code in compiled method sometimes leaks memory
Support for strings that have same life-time as code that uses them. Reviewed-by: kvn, twisti
This commit is contained in:
parent
d824b431de
commit
8f1814d874
16 changed files with 174 additions and 121 deletions
|
@ -48,12 +48,12 @@ class InterpreterCodelet: public Stub {
|
|||
int _size; // the size in bytes
|
||||
const char* _description; // a description of the codelet, for debugging & printing
|
||||
Bytecodes::Code _bytecode; // associated bytecode if any
|
||||
DEBUG_ONLY(CodeComments _comments;) // Comments for annotating assembler output.
|
||||
DEBUG_ONLY(CodeStrings _strings;) // Comments for annotating assembler output.
|
||||
|
||||
public:
|
||||
// Initialization/finalization
|
||||
void initialize(int size,
|
||||
CodeComments& comments) { _size = size; DEBUG_ONLY(_comments.assign(comments);) }
|
||||
CodeStrings& strings) { _size = size; DEBUG_ONLY(_strings.assign(strings);) }
|
||||
void finalize() { ShouldNotCallThis(); }
|
||||
|
||||
// General info/converters
|
||||
|
@ -131,7 +131,7 @@ class CodeletMark: ResourceMark {
|
|||
|
||||
|
||||
// commit Codelet
|
||||
AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->comments());
|
||||
AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings());
|
||||
// make sure nobody can use _masm outside a CodeletMark lifespan
|
||||
*_masm = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue