Changeset 230865 in webkit


Ignore:
Timestamp:
Apr 20, 2018 4:30:05 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Some JSEntryPtrTags should actually be JSInternalPtrTags.
https://bugs.webkit.org/show_bug.cgi?id=184712
<rdar://problem/39507381>

Reviewed by Michael Saboff.

  1. Convert some uses of JSEntryPtrTag into JSInternalPtrTags.
  2. Tag all LLInt bytecodes consistently with BytecodePtrTag now and retag them only when needed.
  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/ByValInfo.h:

(JSC::ByValInfo::ByValInfo):

  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::callReturnLocation):
(JSC::CallLinkInfo::patchableJump):
(JSC::CallLinkInfo::hotPathBegin):
(JSC::CallLinkInfo::slowPathStart):

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::setCallLocations):
(JSC::CallLinkInfo::hotPathOther):

  • bytecode/PolymorphicAccess.cpp:

(JSC::PolymorphicAccess::regenerate):

  • bytecode/StructureStubInfo.h:

(JSC::StructureStubInfo::doneLocation):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • ftl/FTLLazySlowPath.cpp:

(JSC::FTL::LazySlowPath::initialize):

  • ftl/FTLLazySlowPath.h:

(JSC::FTL::LazySlowPath::done const):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):

  • jit/JIT.cpp:

(JSC::JIT::link):

  • jit/JITExceptions.cpp:

(JSC::genericUnwind):

  • jit/JITMathIC.h:

(JSC::isProfileEmpty):

  • llint/LLIntData.cpp:

(JSC::LLInt::initialize):

  • llint/LLIntData.h:

(JSC::LLInt::getCodePtr):
(JSC::LLInt::getExecutableAddress): Deleted.

  • llint/LLIntExceptions.cpp:

(JSC::LLInt::callToThrow):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJS):

Location:
trunk/Source/JavaScriptCore
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r230858 r230865  
     12018-04-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Some JSEntryPtrTags should actually be JSInternalPtrTags.
     4        https://bugs.webkit.org/show_bug.cgi?id=184712
     5        <rdar://problem/39507381>
     6
     7        Reviewed by Michael Saboff.
     8
     9        1. Convert some uses of JSEntryPtrTag into JSInternalPtrTags.
     10        2. Tag all LLInt bytecodes consistently with BytecodePtrTag now and retag them
     11           only when needed.
     12
     13        * bytecode/AccessCase.cpp:
     14        (JSC::AccessCase::generateImpl):
     15        * bytecode/ByValInfo.h:
     16        (JSC::ByValInfo::ByValInfo):
     17        * bytecode/CallLinkInfo.cpp:
     18        (JSC::CallLinkInfo::callReturnLocation):
     19        (JSC::CallLinkInfo::patchableJump):
     20        (JSC::CallLinkInfo::hotPathBegin):
     21        (JSC::CallLinkInfo::slowPathStart):
     22        * bytecode/CallLinkInfo.h:
     23        (JSC::CallLinkInfo::setCallLocations):
     24        (JSC::CallLinkInfo::hotPathOther):
     25        * bytecode/PolymorphicAccess.cpp:
     26        (JSC::PolymorphicAccess::regenerate):
     27        * bytecode/StructureStubInfo.h:
     28        (JSC::StructureStubInfo::doneLocation):
     29        * dfg/DFGJITCompiler.cpp:
     30        (JSC::DFG::JITCompiler::link):
     31        * dfg/DFGOSRExit.cpp:
     32        (JSC::DFG::reifyInlinedCallFrames):
     33        * ftl/FTLLazySlowPath.cpp:
     34        (JSC::FTL::LazySlowPath::initialize):
     35        * ftl/FTLLazySlowPath.h:
     36        (JSC::FTL::LazySlowPath::done const):
     37        * ftl/FTLLowerDFGToB3.cpp:
     38        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
     39        (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
     40        (JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
     41        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
     42        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
     43        (JSC::FTL::DFG::LowerDFGToB3::compileIn):
     44        (JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
     45        * jit/JIT.cpp:
     46        (JSC::JIT::link):
     47        * jit/JITExceptions.cpp:
     48        (JSC::genericUnwind):
     49        * jit/JITMathIC.h:
     50        (JSC::isProfileEmpty):
     51        * llint/LLIntData.cpp:
     52        (JSC::LLInt::initialize):
     53        * llint/LLIntData.h:
     54        (JSC::LLInt::getCodePtr):
     55        (JSC::LLInt::getExecutableAddress): Deleted.
     56        * llint/LLIntExceptions.cpp:
     57        (JSC::LLInt::callToThrow):
     58        * llint/LLIntSlowPaths.cpp:
     59        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     60        * wasm/js/WasmToJS.cpp:
     61        (JSC::Wasm::wasmToJS):
     62
    1632018-04-18  Jer Noble  <jer.noble@apple.com>
    264
  • trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp

    r230748 r230865  
    819819            jit.addLinkTask([=, &vm] (LinkBuffer& linkBuffer) {
    820820                this->as<GetterSetterAccessCase>().callLinkInfo()->setCallLocations(
    821                     CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowPathCall)),
    822                     CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(addressOfLinkFunctionCheck)),
    823                     linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastPathCall));
     821                    CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowPathCall)),
     822                    CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(addressOfLinkFunctionCheck)),
     823                    linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastPathCall));
    824824
    825825                linkBuffer.link(
  • trunk/Source/JavaScriptCore/bytecode/ByValInfo.h

    r230748 r230865  
    227227    ByValInfo() { }
    228228
    229     ByValInfo(unsigned bytecodeIndex, CodeLocationJump<JSEntryPtrTag> notIndexJump, CodeLocationJump<JSEntryPtrTag> badTypeJump, CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler, JITArrayMode arrayMode, ArrayProfile* arrayProfile, int16_t badTypeJumpToDone, int16_t badTypeJumpToNextHotPath, int16_t returnAddressToSlowPath)
     229    ByValInfo(unsigned bytecodeIndex, CodeLocationJump<JSInternalPtrTag> notIndexJump, CodeLocationJump<JSInternalPtrTag> badTypeJump, CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler, JITArrayMode arrayMode, ArrayProfile* arrayProfile, int16_t badTypeJumpToDone, int16_t badTypeJumpToNextHotPath, int16_t returnAddressToSlowPath)
    230230        : bytecodeIndex(bytecodeIndex)
    231231        , notIndexJump(notIndexJump)
     
    245245
    246246    unsigned bytecodeIndex;
    247     CodeLocationJump<JSEntryPtrTag> notIndexJump;
    248     CodeLocationJump<JSEntryPtrTag> badTypeJump;
     247    CodeLocationJump<JSInternalPtrTag> notIndexJump;
     248    CodeLocationJump<JSInternalPtrTag> badTypeJump;
    249249    CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler;
    250250    JITArrayMode arrayMode; // The array mode that was baked into the inline JIT code.
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp

    r230748 r230865  
    9898}
    9999
    100 CodeLocationNearCall<JSEntryPtrTag> CallLinkInfo::callReturnLocation()
    101 {
    102     RELEASE_ASSERT(!isDirect());
    103     return CodeLocationNearCall<JSEntryPtrTag>(m_callReturnLocationOrPatchableJump, Regular);
    104 }
    105 
    106 CodeLocationJump<JSEntryPtrTag> CallLinkInfo::patchableJump()
     100CodeLocationNearCall<JSInternalPtrTag> CallLinkInfo::callReturnLocation()
     101{
     102    RELEASE_ASSERT(!isDirect());
     103    return CodeLocationNearCall<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump, Regular);
     104}
     105
     106CodeLocationJump<JSInternalPtrTag> CallLinkInfo::patchableJump()
    107107{
    108108    RELEASE_ASSERT(callType() == DirectTailCall);
    109     return CodeLocationJump<JSEntryPtrTag>(m_callReturnLocationOrPatchableJump);
    110 }
    111 
    112 CodeLocationDataLabelPtr<JSEntryPtrTag> CallLinkInfo::hotPathBegin()
    113 {
    114     RELEASE_ASSERT(!isDirect());
    115     return CodeLocationDataLabelPtr<JSEntryPtrTag>(m_hotPathBeginOrSlowPathStart);
    116 }
    117 
    118 CodeLocationLabel<JSEntryPtrTag> CallLinkInfo::slowPathStart()
     109    return CodeLocationJump<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump);
     110}
     111
     112CodeLocationDataLabelPtr<JSInternalPtrTag> CallLinkInfo::hotPathBegin()
     113{
     114    RELEASE_ASSERT(!isDirect());
     115    return CodeLocationDataLabelPtr<JSInternalPtrTag>(m_hotPathBeginOrSlowPathStart);
     116}
     117
     118CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::slowPathStart()
    119119{
    120120    RELEASE_ASSERT(isDirect());
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h

    r230748 r230865  
    166166
    167167    void setCallLocations(
    168         CodeLocationLabel<JSEntryPtrTag> callReturnLocationOrPatchableJump,
    169         CodeLocationLabel<JSEntryPtrTag> hotPathBeginOrSlowPathStart,
    170         CodeLocationNearCall<JSEntryPtrTag> hotPathOther)
     168        CodeLocationLabel<JSInternalPtrTag> callReturnLocationOrPatchableJump,
     169        CodeLocationLabel<JSInternalPtrTag> hotPathBeginOrSlowPathStart,
     170        CodeLocationNearCall<JSInternalPtrTag> hotPathOther)
    171171    {
    172172        m_callReturnLocationOrPatchableJump = callReturnLocationOrPatchableJump;
     
    182182    }
    183183
    184     CodeLocationNearCall<JSEntryPtrTag> callReturnLocation();
    185     CodeLocationJump<JSEntryPtrTag> patchableJump();
    186     CodeLocationDataLabelPtr<JSEntryPtrTag> hotPathBegin();
    187     CodeLocationLabel<JSEntryPtrTag> slowPathStart();
    188 
    189     CodeLocationNearCall<JSEntryPtrTag> hotPathOther()
     184    CodeLocationNearCall<JSInternalPtrTag> callReturnLocation();
     185    CodeLocationJump<JSInternalPtrTag> patchableJump();
     186    CodeLocationDataLabelPtr<JSInternalPtrTag> hotPathBegin();
     187    CodeLocationLabel<JSInternalPtrTag> slowPathStart();
     188
     189    CodeLocationNearCall<JSInternalPtrTag> hotPathOther()
    190190    {
    191191        return m_hotPathOther;
     
    328328
    329329private:
    330     // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
    331     // https://bugs.webkit.org/show_bug.cgi?id=184712
    332     CodeLocationLabel<JSEntryPtrTag> m_callReturnLocationOrPatchableJump;
    333     CodeLocationLabel<JSEntryPtrTag> m_hotPathBeginOrSlowPathStart;
    334     CodeLocationNearCall<JSEntryPtrTag> m_hotPathOther;
     330    CodeLocationLabel<JSInternalPtrTag> m_callReturnLocationOrPatchableJump;
     331    CodeLocationLabel<JSInternalPtrTag> m_hotPathBeginOrSlowPathStart;
     332    CodeLocationNearCall<JSInternalPtrTag> m_hotPathOther;
    335333    WriteBarrier<JSCell> m_calleeOrCodeBlock;
    336334    WriteBarrier<JSCell> m_lastSeenCalleeOrExecutable;
  • trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp

    r230748 r230865  
    559559    }
    560560
    561     CodeLocationLabel<JSEntryPtrTag> successLabel = stubInfo.doneLocation();
     561    CodeLocationLabel<JSInternalPtrTag> successLabel = stubInfo.doneLocation();
    562562
    563563    linkBuffer.link(state.success, successLabel);
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h

    r230748 r230865  
    187187
    188188    CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return patch.start.callAtOffset<JSInternalPtrTag>(patch.deltaFromStartToSlowPathCallLocation); }
    189     CodeLocationLabel<JSEntryPtrTag> doneLocation() { return patch.start.labelAtOffset<JSEntryPtrTag>(patch.inlineSize); }
     189    CodeLocationLabel<JSInternalPtrTag> doneLocation() { return patch.start.labelAtOffset<JSInternalPtrTag>(patch.inlineSize); }
    190190    CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation() { return patch.start.labelAtOffset(patch.deltaFromStartToSlowPathStart); }
    191191    CodeLocationJump<JSInternalPtrTag> patchableJumpForIn()
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r230748 r230865  
    293293        linkBuffer.link(record.slowCall, linkCallThunk);
    294294        info.setCallLocations(
    295             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.slowCall)),
    296             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(record.targetToCheck)),
    297             linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.fastCall));
     295            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.slowCall)),
     296            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(record.targetToCheck)),
     297            linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.fastCall));
    298298    }
    299299   
     
    302302        linkBuffer.link(record.call, linkBuffer.locationOf<NoPtrTag>(record.slowPath));
    303303        info.setCallLocations(
    304             CodeLocationLabel<JSEntryPtrTag>(),
    305             linkBuffer.locationOf<JSEntryPtrTag>(record.slowPath),
    306             linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.call));
     304            CodeLocationLabel<JSInternalPtrTag>(),
     305            linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath),
     306            linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call));
    307307    }
    308308   
     
    310310        CallLinkInfo& info = *record.info;
    311311        info.setCallLocations(
    312             linkBuffer.locationOf<JSEntryPtrTag>(record.patchableJump),
    313             linkBuffer.locationOf<JSEntryPtrTag>(record.slowPath),
    314             linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.call));
     312            linkBuffer.locationOf<JSInternalPtrTag>(record.patchableJump),
     313            linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath),
     314            linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call));
    315315    }
    316316   
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp

    r230748 r230865  
    755755            CodeBlock* baselineCodeBlockForCaller = baselineCodeBlockForOriginAndBaselineCodeBlock(*trueCaller, outermostBaselineCodeBlock);
    756756            unsigned callBytecodeIndex = trueCaller->bytecodeIndex;
    757             void* jumpTarget = nullptr;
     757            MacroAssemblerCodePtr<JSInternalPtrTag> jumpTarget;
    758758
    759759            switch (trueCallerCallKind) {
     
    768768                RELEASE_ASSERT(callLinkInfo);
    769769
    770                 jumpTarget = callLinkInfo->callReturnLocation().executableAddress();
     770                jumpTarget = callLinkInfo->callReturnLocation();
    771771                break;
    772772            }
     
    778778                RELEASE_ASSERT(stubInfo);
    779779
    780                 jumpTarget = stubInfo->doneLocation().executableAddress();
     780                jumpTarget = stubInfo->doneLocation();
    781781                break;
    782782            }
     
    789789                callerFrame = cpu.fp<uint8_t*>() + trueCaller->inlineCallFrame->stackOffset * sizeof(EncodedJSValue);
    790790
     791            void* targetAddress = jumpTarget.executableAddress();
    791792#if USE(POINTER_PROFILING)
    792793            void* newEntrySP = cpu.fp<uint8_t*>() + inlineCallFrame->returnPCOffset() + sizeof(void*);
    793             jumpTarget = retagCodePtr(jumpTarget, JSEntryPtrTag, bitwise_cast<PtrTag>(newEntrySP));
    794 #endif
    795             frame.set<void*>(inlineCallFrame->returnPCOffset(), jumpTarget);
     794            targetAddress = retagCodePtr(targetAddress, JSInternalPtrTag, bitwise_cast<PtrTag>(newEntrySP));
     795#endif
     796            frame.set<void*>(inlineCallFrame->returnPCOffset(), targetAddress);
    796797        }
    797798
  • trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.cpp

    r230748 r230865  
    3939
    4040void LazySlowPath::initialize(
    41     CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSEntryPtrTag> done,
     41    CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done,
    4242    CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget,
    4343    const RegisterSet& usedRegisters, CallSiteIndex callSiteIndex, RefPtr<Generator> generator
  • trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h

    r230748 r230865  
    7070
    7171    void initialize(
    72         CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSEntryPtrTag> done,
     72        CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done,
    7373        CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget, const RegisterSet& usedRegisters,
    7474        CallSiteIndex, RefPtr<Generator>
     
    7676
    7777    CodeLocationJump<JSInternalPtrTag> patchableJump() const { return m_patchableJump; }
    78     CodeLocationLabel<JSEntryPtrTag> done() const { return m_done; }
     78    CodeLocationLabel<JSInternalPtrTag> done() const { return m_done; }
    7979    const RegisterSet& usedRegisters() const { return m_usedRegisters; }
    8080    CallSiteIndex callSiteIndex() const { return m_callSiteIndex; }
     
    8686private:
    8787    CodeLocationJump<JSInternalPtrTag> m_patchableJump;
    88     // FIXME: This should be tagged with JSInternalPtrTag instead of JSEntryTag.
    89     // https://bugs.webkit.org/show_bug.cgi?id=184712
    90     CodeLocationLabel<JSEntryPtrTag> m_done;
     88    CodeLocationLabel<JSInternalPtrTag> m_done;
    9189    CodeLocationLabel<ExceptionHandlerPtrTag> m_exceptionTarget;
    9290    RegisterSet m_usedRegisters;
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r230748 r230865  
    71737173
    71747174                        callLinkInfo->setCallLocations(
    7175                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
    7176                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
    7177                             linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
     7175                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
     7176                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
     7177                            linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
    71787178                    });
    71797179            });
     
    73157315                    jit.addLinkTask(
    73167316                        [=] (LinkBuffer& linkBuffer) {
    7317                             CodeLocationLabel<JSEntryPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSEntryPtrTag>(patchableJump);
    7318                             CodeLocationNearCall<JSEntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);
    7319                             CodeLocationLabel<JSEntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);
    7320                            
     7317                            CodeLocationLabel<JSInternalPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSInternalPtrTag>(patchableJump);
     7318                            CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
     7319                            CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath);
     7320
    73217321                            callLinkInfo->setCallLocations(
    73227322                                patchableJumpLocation,
     
    73647364                        jit.addLinkTask(
    73657365                            [=] (LinkBuffer& linkBuffer) {
    7366                                 CodeLocationNearCall<JSEntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);
    7367                                 CodeLocationLabel<JSEntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);
    7368                                
     7366                                CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
     7367                                CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath);
     7368
    73697369                                linkBuffer.link(call, slowPathLocation);
    7370                                
     7370
    73717371                                callLinkInfo->setCallLocations(
    7372                                     CodeLocationLabel<JSEntryPtrTag>(),
     7372                                    CodeLocationLabel<JSInternalPtrTag>(),
    73737373                                    slowPathLocation,
    73747374                                    callLocation);
     
    74937493
    74947494                        callLinkInfo->setCallLocations(
    7495                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
    7496                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
    7497                             linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
     7495                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
     7496                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
     7497                            linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
    74987498                    });
    74997499            });
     
    77917791                       
    77927792                        callLinkInfo->setCallLocations(
    7793                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
    7794                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
    7795                             linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
     7793                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
     7794                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
     7795                            linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
    77967796                    });
    77977797            });
     
    80738073                       
    80748074                        callLinkInfo->setCallLocations(
    8075                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
    8076                             CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
    8077                             linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
     8075                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
     8076                            CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
     8077                            linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
    80788078                    });
    80798079            });
     
    96889688                                        stubInfo->patch.start = start;
    96899689                                        ptrdiff_t inlineSize = MacroAssembler::differenceBetweenCodePtr(
    9690                                             start, linkBuffer.locationOf<JSEntryPtrTag>(done));
     9690                                            start, linkBuffer.locationOf<NoPtrTag>(done));
    96919691                                        RELEASE_ASSERT(inlineSize >= 0);
    96929692                                        stubInfo->patch.inlineSize = inlineSize;
    96939693
    96949694                                        stubInfo->patch.deltaFromStartToSlowPathCallLocation = MacroAssembler::differenceBetweenCodePtr(
    9695                                             start, linkBuffer.locationOf<JSEntryPtrTag>(slowPathCall));
     9695                                            start, linkBuffer.locationOf<NoPtrTag>(slowPathCall));
    96969696
    96979697                                        stubInfo->patch.deltaFromStartToSlowPathStart = MacroAssembler::differenceBetweenCodePtr(
    9698                                             start, linkBuffer.locationOf<JSEntryPtrTag>(slowPathBegin));
     9698                                            start, linkBuffer.locationOf<NoPtrTag>(slowPathBegin));
    96999699
    97009700                                    });
     
    1398513985                                auto linkedPatchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(patchableJump));
    1398613986
    13987                                 CodeLocationLabel<JSEntryPtrTag> linkedDone = linkBuffer.locationOf<JSEntryPtrTag>(done);
     13987                                CodeLocationLabel<JSInternalPtrTag> linkedDone = linkBuffer.locationOf<JSInternalPtrTag>(done);
    1398813988
    1398913989                                CallSiteIndex callSiteIndex =
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r230748 r230865  
    836836        for (const auto& byValCompilationInfo : m_byValCompilationInfo) {
    837837            PatchableJump patchableNotIndexJump = byValCompilationInfo.notIndexJump;
    838             auto notIndexJump = CodeLocationJump<JSEntryPtrTag>();
     838            auto notIndexJump = CodeLocationJump<JSInternalPtrTag>();
    839839            if (Jump(patchableNotIndexJump).isSet())
    840                 notIndexJump = CodeLocationJump<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(patchableNotIndexJump));
    841             auto badTypeJump = CodeLocationJump<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(byValCompilationInfo.badTypeJump));
     840                notIndexJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(patchableNotIndexJump));
     841            auto badTypeJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(byValCompilationInfo.badTypeJump));
    842842            CodeLocationLabel<NoPtrTag> doneTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.doneTarget);
    843843            CodeLocationLabel<NoPtrTag> nextHotPathTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.nextHotPathTarget);
     
    861861        CallLinkInfo& info = *compilationInfo.callLinkInfo;
    862862        info.setCallLocations(
    863             CodeLocationLabel<JSEntryPtrTag>(patchBuffer.locationOfNearCall<JSEntryPtrTag>(compilationInfo.callReturnLocation)),
    864             CodeLocationLabel<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(compilationInfo.hotPathBegin)),
    865             patchBuffer.locationOfNearCall<JSEntryPtrTag>(compilationInfo.hotPathOther));
     863            CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.callReturnLocation)),
     864            CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(compilationInfo.hotPathBegin)),
     865            patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.hotPathOther));
    866866    }
    867867
  • trunk/Source/JavaScriptCore/jit/JITExceptions.cpp

    r230748 r230865  
    8383#endif
    8484    } else
    85         catchRoutine = LLInt::getExecutableAddress(handleUncaughtException);
     85        catchRoutine = LLInt::getCodePtr<ExceptionHandlerPtrTag>(handleUncaughtException).executableAddress();
    8686   
    8787    ASSERT(bitwise_cast<uintptr_t>(callFrame) < bitwise_cast<uintptr_t>(vm->topEntryFrame));
  • trunk/Source/JavaScriptCore/jit/JITMathIC.h

    r230748 r230865  
    6363    }
    6464
    65     // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
    66     // https://bugs.webkit.org/show_bug.cgi?id=184712
    67     CodeLocationLabel<JSEntryPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); }
    68     CodeLocationLabel<JSEntryPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); }
    69     CodeLocationCall<JSEntryPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); }
     65    CodeLocationLabel<JSInternalPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); }
     66    CodeLocationLabel<JSInternalPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); }
     67    CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); }
    7068   
    7169    bool generateInline(CCallHelpers& jit, MathICGenerationState& state, bool shouldEmitProfiling = true)
     
    224222    void finalizeInlineCode(const MathICGenerationState& state, LinkBuffer& linkBuffer)
    225223    {
    226         CodeLocationLabel<JSEntryPtrTag> start = linkBuffer.locationOf<JSEntryPtrTag>(state.fastPathStart);
     224        CodeLocationLabel<JSInternalPtrTag> start = linkBuffer.locationOf<JSInternalPtrTag>(state.fastPathStart);
    227225        m_inlineStart = start;
    228226
     
    254252    Instruction* m_instruction;
    255253    MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code;
    256     // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
    257     // https://bugs.webkit.org/show_bug.cgi?id=184712
    258     CodeLocationLabel<JSEntryPtrTag> m_inlineStart;
     254    CodeLocationLabel<JSInternalPtrTag> m_inlineStart;
    259255    int32_t m_inlineSize;
    260256    int32_t m_deltaFromStartToSlowPathCallLocation;
  • trunk/Source/JavaScriptCore/llint/LLIntData.cpp

    r230748 r230865  
    5959    llint_entry(&Data::s_opcodeMap);
    6060
    61     for (int i = 0; i < NUMBER_OF_BYTECODE_IDS; ++i)
     61    for (int i = 0; i < numOpcodeIDs; ++i)
    6262        Data::s_opcodeMap[i] = tagCodePtr(Data::s_opcodeMap[i], BytecodePtrTag);
    6363
    64     static const PtrTag tagsForOpcode[] = {
    65         // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
    66         // https://bugs.webkit.org/show_bug.cgi?id=184712
    67         JSEntryPtrTag, // llint_program_prologue
    68         JSEntryPtrTag, // llint_eval_prologue
    69         JSEntryPtrTag, // llint_module_program_prologue
    70         JSEntryPtrTag, // llint_function_for_call_prologue
    71         JSEntryPtrTag, // llint_function_for_construct_prologue
    72         JSEntryPtrTag, // llint_function_for_call_arity_check
    73         JSEntryPtrTag, // llint_function_for_construct_arity_check
    74         JSEntryPtrTag, // llint_generic_return_point
    75         BytecodePtrTag, // llint_throw_from_slow_path_trampoline
    76         ExceptionHandlerPtrTag, // llint_throw_during_call_trampoline
    77         JSEntryPtrTag, // llint_native_call_trampoline
    78         JSEntryPtrTag, // llint_native_construct_trampoline
    79         JSEntryPtrTag, // llint_internal_function_call_trampoline
    80         JSEntryPtrTag, // llint_internal_function_construct_trampoline
    81         ExceptionHandlerPtrTag, // handleUncaughtException
    82     };
    83 
    84     static_assert(sizeof(tagsForOpcode) / sizeof(tagsForOpcode[0]) == NUMBER_OF_BYTECODE_HELPER_IDS, "");
    85     static_assert(static_cast<uintptr_t>(llint_program_prologue) == NUMBER_OF_BYTECODE_IDS, "");
    86 
    87     for (int i = 0; i < NUMBER_OF_BYTECODE_HELPER_IDS; ++i) {
    88         int opcodeID = i + NUMBER_OF_BYTECODE_IDS;
    89         Data::s_opcodeMap[opcodeID] = tagCodePtr(Data::s_opcodeMap[opcodeID], tagsForOpcode[i]);
    90     }
    91 
    92     void* handler = LLInt::getExecutableAddress(llint_throw_from_slow_path_trampoline);
     64    void* handler = Data::s_opcodeMap[llint_throw_from_slow_path_trampoline];
    9365    for (int i = 0; i < maxOpcodeLength + 1; ++i)
    9466        Data::s_exceptionInstructions[i].u.pointer = handler;
    95 
    9667#endif // ENABLE(JIT)
    9768}
  • trunk/Source/JavaScriptCore/llint/LLIntData.h

    r230748 r230865  
    8181}
    8282
    83 ALWAYS_INLINE void* getExecutableAddress(OpcodeID opcodeID)
    84 {
    85     ASSERT(opcodeID >= NUMBER_OF_BYTECODE_IDS);
    86     return reinterpret_cast<void*>(getOpcode(opcodeID));
    87 }
    88 
    8983template<PtrTag tag>
    9084ALWAYS_INLINE MacroAssemblerCodePtr<tag> getCodePtr(OpcodeID opcodeID)
    9185{
    92     return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(getOpcode(opcodeID));
     86    void* address = getOpcode(opcodeID);
     87    address = retagCodePtr<BytecodePtrTag, tag>(address);
     88    return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(address);
    9389}
    9490
  • trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp

    r230748 r230865  
    5959    dataLog("Throwing exception ", JSValue(scope.exception()), " (callToThrow).\n");
    6060#endif
    61     return LLInt::getExecutableAddress(llint_throw_during_call_trampoline);
     61    return LLInt::getCodePtr<ExceptionHandlerPtrTag>(llint_throw_during_call_trampoline).executableAddress();
    6262}
    6363
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r230748 r230865  
    16371637    execCallee->setCallerFrame(exec);
    16381638    execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue;
    1639     execCallee->setReturnPC(LLInt::getExecutableAddress(llint_generic_return_point));
     1639    execCallee->setReturnPC(LLInt::getCodePtr<JSEntryPtrTag>(llint_generic_return_point).executableAddress());
    16401640    execCallee->setCodeBlock(0);
    16411641    exec->setCurrentVPC(pc);
  • trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp

    r230748 r230865  
    655655
    656656    patchBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(vm->getCTIStub(linkCallThunkGenerator).code()));
    657     CodeLocationLabel<JSEntryPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall));
    658     CodeLocationLabel<JSEntryPtrTag> hotPathBegin(patchBuffer.locationOf<JSEntryPtrTag>(targetToCheck));
    659     CodeLocationNearCall<JSEntryPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall);
     657    CodeLocationLabel<JSInternalPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall));
     658    CodeLocationLabel<JSInternalPtrTag> hotPathBegin(patchBuffer.locationOf<JSInternalPtrTag>(targetToCheck));
     659    CodeLocationNearCall<JSInternalPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall);
    660660    callLinkInfo->setCallLocations(callReturnLocation, hotPathBegin, hotPathOther);
    661661
Note: See TracChangeset for help on using the changeset viewer.