mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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:
parent
302540691b
commit
5ada196961
14 changed files with 73 additions and 42 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue