Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreter.hpp @ 6796:b31471cdc53e
7200163: add CodeComments functionality to assember stubs
Summary: Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments.
Reviewed-by: jrose, kvn, twisti
Contributed-by: goetz.lindenmaier@sap.com
author | kvn |
---|---|
date | Mon, 24 Sep 2012 10:30:14 -0700 |
parents | 1d1603768966 |
children | b9a9ed0f8eeb |
comparison
equal
deleted
inserted
replaced
6795:7eca5de9e0b6 | 6796:b31471cdc53e |
---|---|
46 friend class VMStructs; | 46 friend class VMStructs; |
47 private: | 47 private: |
48 int _size; // the size in bytes | 48 int _size; // the size in bytes |
49 const char* _description; // a description of the codelet, for debugging & printing | 49 const char* _description; // a description of the codelet, for debugging & printing |
50 Bytecodes::Code _bytecode; // associated bytecode if any | 50 Bytecodes::Code _bytecode; // associated bytecode if any |
51 DEBUG_ONLY(CodeComments _comments;) // Comments for annotating assembler output. | |
51 | 52 |
52 public: | 53 public: |
53 // Initialization/finalization | 54 // Initialization/finalization |
54 void initialize(int size) { _size = size; } | 55 void initialize(int size, |
56 CodeComments& comments) { _size = size; DEBUG_ONLY(_comments.assign(comments);) } | |
55 void finalize() { ShouldNotCallThis(); } | 57 void finalize() { ShouldNotCallThis(); } |
56 | 58 |
57 // General info/converters | 59 // General info/converters |
58 int size() const { return _size; } | 60 int size() const { return _size; } |
59 static int code_size_to_size(int code_size) { return round_to(sizeof(InterpreterCodelet), CodeEntryAlignment) + code_size; } | 61 static int code_size_to_size(int code_size) { return round_to(sizeof(InterpreterCodelet), CodeEntryAlignment) + code_size; } |
127 // make sure all code is in code buffer | 129 // make sure all code is in code buffer |
128 (*_masm)->flush(); | 130 (*_masm)->flush(); |
129 | 131 |
130 | 132 |
131 // commit Codelet | 133 // commit Codelet |
132 AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size()); | 134 AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->comments()); |
133 // make sure nobody can use _masm outside a CodeletMark lifespan | 135 // make sure nobody can use _masm outside a CodeletMark lifespan |
134 *_masm = NULL; | 136 *_masm = NULL; |
135 } | 137 } |
136 }; | 138 }; |
137 | 139 |