fourthTier: 32-bit CallFrame::Location should use Instruction* for BytecodeLocation, not bytecodeOffset.
https://bugs.webkit.org/show_bug.cgi?id=117327.
Reviewed by Michael Saboff.
- Renamed CallFrame::Location's Type to TypeTag.
- Made the CallFrame::Location::TypeTag private, and provided type
specific encoder functions. This reduces verbosity in client code.
- Fixed the DFG's reifyInlinedCallFrames() on 32-bit ports to store a
bytecode Instruction* in the CallFrame location instead of a bytecode
offset.
- Fixed places in JIT and FTL code which populate the CallFrame location
(i.e. ArgumentCount tag) to use a Location encoder instead of storing
the bytecodeOffset directly. This doesn't make any semantic difference,
but it does assert that the stored value does not have bits where we
would expect Location TypeTags to be.
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::beginCall):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::setLocationAsBytecodeOffset):
* interpreter/CallFrame.h:
(Location):
* interpreter/CallFrameInlines.h:
(JSC::CallFrame::Location::encodeAsBytecodeOffset):
(JSC::CallFrame::Location::encodeAsBytecodeInstruction):
(JSC::CallFrame::Location::encodeAsCodeOriginIndex):
(JSC::CallFrame::Location::encodeAsInlinedCode):
(JSC::CallFrame::Location::isBytecodeLocation):
(JSC::CallFrame::setIsInlinedFrame):
(JSC::CallFrame::hasLocationAsBytecodeOffset):
(JSC::CallFrame::setLocationAsBytecodeOffset):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::updateTopCallFrame):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.h b/Source/JavaScriptCore/interpreter/CallFrame.h
index daa1646..8c45875 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.h
+++ b/Source/JavaScriptCore/interpreter/CallFrame.h
@@ -116,19 +116,30 @@
class Location {
public:
- enum Type {
- BytecodeOffset = 0,
- CodeOriginIndex = (1 << 0),
- IsInlinedCode = (1 << 1),
- };
-
- static inline uint32_t encode(Type, uint32_t bits);
static inline uint32_t decode(uint32_t bits);
- static inline bool isBytecodeOffset(uint32_t bits);
+
+ static inline bool isBytecodeLocation(uint32_t bits);
+#if USE(JSVALUE64)
+ static inline uint32_t encodeAsBytecodeOffset(uint32_t bits);
+#else
+ static inline uint32_t encodeAsBytecodeInstruction(Instruction*);
+#endif
+
static inline bool isCodeOriginIndex(uint32_t bits);
+ static inline uint32_t encodeAsCodeOriginIndex(uint32_t bits);
+
static inline bool isInlinedCode(uint32_t bits);
+ static inline uint32_t encodeAsInlinedCode(uint32_t bits);
private:
+ enum TypeTag {
+ BytecodeLocationTag = 0,
+ CodeOriginIndexTag = 1,
+ IsInlinedCodeTag = 2,
+ };
+
+ static inline uint32_t encode(TypeTag, uint32_t bits);
+
static const uint32_t s_mask = 0x3;
#if USE(JSVALUE64)
static const uint32_t s_shift = 30;