summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/CodeOrigin.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/JavaScriptCore/bytecode/CodeOrigin.h
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeOrigin.h')
-rw-r--r--Source/JavaScriptCore/bytecode/CodeOrigin.h24
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;