Ignore:
Timestamp:
Jul 24, 2013, 9:02:09 PM (12 years ago)
Author:
[email protected]
Message:

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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r153211 r153212  
    117117        class Location {
    118118        public:
    119             enum Type {
    120                 BytecodeOffset = 0,
    121                 CodeOriginIndex = (1 << 0),
    122                 IsInlinedCode = (1 << 1),
     119            static inline uint32_t decode(uint32_t bits);
     120
     121            static inline bool isBytecodeLocation(uint32_t bits);
     122#if USE(JSVALUE64)
     123            static inline uint32_t encodeAsBytecodeOffset(uint32_t bits);
     124#else
     125            static inline uint32_t encodeAsBytecodeInstruction(Instruction*);
     126#endif
     127
     128            static inline bool isCodeOriginIndex(uint32_t bits);
     129            static inline uint32_t encodeAsCodeOriginIndex(uint32_t bits);
     130
     131            static inline bool isInlinedCode(uint32_t bits);
     132            static inline uint32_t encodeAsInlinedCode(uint32_t bits);
     133
     134        private:
     135            enum TypeTag {
     136                BytecodeLocationTag = 0,
     137                CodeOriginIndexTag = 1,
     138                IsInlinedCodeTag = 2,
    123139            };
    124140
    125             static inline uint32_t encode(Type, uint32_t bits);
    126             static inline uint32_t decode(uint32_t bits);
    127             static inline bool isBytecodeOffset(uint32_t bits);
    128             static inline bool isCodeOriginIndex(uint32_t bits);
    129             static inline bool isInlinedCode(uint32_t bits);
    130 
    131         private:
     141            static inline uint32_t encode(TypeTag, uint32_t bits);
     142
    132143            static const uint32_t s_mask = 0x3;
    133144#if USE(JSVALUE64)
Note: See TracChangeset for help on using the changeset viewer.