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; } |