7200163: add CodeComments functionality to assember stubs

Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments.

Reviewed-by: jrose, kvn, twisti
This commit is contained in:
Goetz Lindenmaier 2012-09-24 10:30:14 -07:00 committed by Vladimir Kozlov
parent 302540691b
commit 5ada196961
14 changed files with 73 additions and 42 deletions

View file

@ -48,10 +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.
public:
// Initialization/finalization
void initialize(int size) { _size = size; }
void initialize(int size,
CodeComments& comments) { _size = size; DEBUG_ONLY(_comments.assign(comments);) }
void finalize() { ShouldNotCallThis(); }
// General info/converters
@ -129,7 +131,7 @@ class CodeletMark: ResourceMark {
// commit Codelet
AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size());
AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->comments());
// make sure nobody can use _masm outside a CodeletMark lifespan
*_masm = NULL;
}