diff options
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeOrigin.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeOrigin.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.h b/Source/JavaScriptCore/bytecode/CodeOrigin.h index 7b6ce7d48..25a116c55 100644 --- a/Source/JavaScriptCore/bytecode/CodeOrigin.h +++ b/Source/JavaScriptCore/bytecode/CodeOrigin.h @@ -38,29 +38,37 @@ class ExecutableBase; class JSFunction; struct CodeOrigin { - uint32_t bytecodeIndex; + // Bytecode offset that you'd use to re-execute this instruction. + unsigned bytecodeIndex : 29; + // Bytecode offset corresponding to the opcode that gives the result (needed to handle + // op_call/op_call_put_result and op_method_check/op_get_by_id). + unsigned valueProfileOffset : 3; + InlineCallFrame* inlineCallFrame; CodeOrigin() : bytecodeIndex(std::numeric_limits<uint32_t>::max()) + , valueProfileOffset(0) , inlineCallFrame(0) { } - explicit CodeOrigin(uint32_t bytecodeIndex) - : bytecodeIndex(bytecodeIndex) - , inlineCallFrame(0) - { - } - - explicit CodeOrigin(uint32_t bytecodeIndex, InlineCallFrame* inlineCallFrame) + explicit CodeOrigin(unsigned bytecodeIndex, InlineCallFrame* inlineCallFrame = 0, unsigned valueProfileOffset = 0) : bytecodeIndex(bytecodeIndex) + , valueProfileOffset(valueProfileOffset) , inlineCallFrame(inlineCallFrame) { + ASSERT(bytecodeIndex < (1u << 29)); + ASSERT(valueProfileOffset < (1u << 3)); } bool isSet() const { return bytecodeIndex != std::numeric_limits<uint32_t>::max(); } + unsigned bytecodeIndexForValueProfile() const + { + return bytecodeIndex + valueProfileOffset; + } + // The inline depth is the depth of the inline stack, so 1 = not inlined, // 2 = inlined one deep, etc. unsigned inlineDepth() const; |