diff options
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeOrigin.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeOrigin.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.h b/Source/JavaScriptCore/bytecode/CodeOrigin.h index 034e48f3f..c9c0f7005 100644 --- a/Source/JavaScriptCore/bytecode/CodeOrigin.h +++ b/Source/JavaScriptCore/bytecode/CodeOrigin.h @@ -39,6 +39,8 @@ class ExecutableBase; class JSFunction; struct CodeOrigin { + static const unsigned maximumBytecodeIndex = (1u << 29) - 1; + // 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 @@ -48,7 +50,7 @@ struct CodeOrigin { InlineCallFrame* inlineCallFrame; CodeOrigin() - : bytecodeIndex(std::numeric_limits<uint32_t>::max()) + : bytecodeIndex(maximumBytecodeIndex) , valueProfileOffset(0) , inlineCallFrame(0) { @@ -59,11 +61,11 @@ struct CodeOrigin { , valueProfileOffset(valueProfileOffset) , inlineCallFrame(inlineCallFrame) { - ASSERT(bytecodeIndex < (1u << 29)); + ASSERT(bytecodeIndex <= maximumBytecodeIndex); ASSERT(valueProfileOffset < (1u << 3)); } - bool isSet() const { return bytecodeIndex != std::numeric_limits<uint32_t>::max(); } + bool isSet() const { return bytecodeIndex != maximumBytecodeIndex; } unsigned bytecodeIndexForValueProfile() const { |