Changeset 121480 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
- Timestamp:
- Jun 28, 2012, 4:03:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r121215 r121480 36 36 #include "CodeOrigin.h" 37 37 #include "CodeType.h" 38 #include "Comment.h" 38 39 #include "CompactJITCodeMap.h" 39 40 #include "DFGCodeBlocks.h" … … 67 68 #include <wtf/FastAllocBase.h> 68 69 #include <wtf/PassOwnPtr.h> 70 #include <wtf/Platform.h> 69 71 #include <wtf/RefPtr.h> 70 72 #include <wtf/SegmentedVector.h> 71 73 #include <wtf/Vector.h> 74 75 // Set ENABLE_BYTECODE_COMMENTS to 1 to enable recording bytecode generator 76 // comments for the bytecodes that it generates. This will allow 77 // CodeBlock::dump() to provide some contextual info about the bytecodes. 78 // 79 // The way this comment system works is as follows: 80 // 1. The BytecodeGenerator calls prependComment() with a constant comment 81 // string in .text. The string must not be a stack or heap allocated 82 // string. 83 // 2. When the BytecodeGenerator's emitOpcode() is called, the last 84 // prepended comment will be recorded with the PC of the opcode being 85 // emitted. This comment is being recorded in the CodeBlock's 86 // m_bytecodeComments. 87 // 3. When CodeBlock::dump() is called, it will pair up the comments with 88 // their corresponding bytecodes based on the bytecode and comment's 89 // PC. If a matching pair is found, the comment will be printed after 90 // the bytecode. If not, no comment is printed. 91 // 92 // NOTE: Enabling this will consume additional memory at runtime to store 93 // the comments. Since these comments are only useful for VM debugging 94 // (as opposed to app debugging), this feature is to be disabled by default, 95 // and can be enabled as needed for VM development use only. 96 97 #define ENABLE_BYTECODE_COMMENTS 0 72 98 73 99 namespace JSC { … … 155 181 return index >= m_numVars; 156 182 } 183 184 void dumpBytecodeCommentAndNewLine(int location); 185 #if ENABLE(BYTECODE_COMMENTS) 186 const char* commentForBytecodeOffset(unsigned bytecodeOffset); 187 void dumpBytecodeComments(); 188 #endif 157 189 158 190 HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset); … … 366 398 const RefCountedArray<Instruction>& instructions() const { return m_instructions; } 367 399 400 #if ENABLE(BYTECODE_COMMENTS) 401 Vector<Comment>& bytecodeComments() { return m_bytecodeComments; } 402 #endif 403 368 404 size_t predictedMachineCodeSize(); 369 405 … … 1303 1339 1304 1340 Vector<LineInfo> m_lineInfo; 1341 #if ENABLE(BYTECODE_COMMENTS) 1342 Vector<Comment> m_bytecodeComments; 1343 size_t m_bytecodeCommentIterator; 1344 #endif 1305 1345 1306 1346 struct RareData {
Note:
See TracChangeset
for help on using the changeset viewer.