Changeset 187629 in webkit


Ignore:
Timestamp:
Jul 30, 2015 5:43:25 PM (9 years ago)
Author:
basile_clement@apple.com
Message:

jsc-tailcall: Add enums for type-safety
https://bugs.webkit.org/show_bug.cgi?id=147475

Reviewed by Michael Saboff.

This adds:

  • A CallMode enum to distinguish tail calls from regular calls from construct
  • A FrameAction enum to indicate whether to keep or reuse the call frame. It also changes JITOperations.h to correctly use this to tell slowPathFor to *not* trash the frame on a regular call (before r187505, this was statically known in slowPathFor).

(JSC::AbstractMacroAssembler::repatchNearCall):

  • assembler/CodeLocation.h:

(JSC::CodeLocationNearCall::CodeLocationNearCall):
(JSC::CodeLocationNearCall::callMode):
(JSC::CodeLocationCommon::nearCallAtOffset):

  • assembler/LinkBuffer.h:

(JSC::LinkBuffer::locationOfNearCall):

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::callModeFor):
(JSC::CallLinkInfo::callMode):
(JSC::CallLinkInfo::isTailCall):
(JSC::CallLinkInfo::isVarargs):

  • bytecode/CallMode.cpp: Added.

(WTF::printInternal):

  • bytecode/CallMode.h: Added.
  • jit/JITOperations.cpp:
  • jit/Repatch.cpp:

(JSC::linkPolymorphicCall):

  • jit/ThunkGenerators.cpp:

(JSC::slowPathFor):
(JSC::virtualThunkFor):

Location:
branches/jsc-tailcall/Source/JavaScriptCore
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/jsc-tailcall/Source/JavaScriptCore/CMakeLists.txt

    r186820 r187629  
    7777    bytecode/CallLinkInfo.cpp
    7878    bytecode/CallLinkStatus.cpp
     79    bytecode/CallMode.cpp
    7980    bytecode/CallVariant.cpp
    8081    bytecode/CodeBlock.cpp
  • branches/jsc-tailcall/Source/JavaScriptCore/ChangeLog

    r187618 r187629  
     12015-07-30  Basile Clement  <basile_clement@apple.com>
     2
     3        jsc-tailcall: Add enums for type-safety
     4        https://bugs.webkit.org/show_bug.cgi?id=147475
     5
     6        Reviewed by Michael Saboff.
     7
     8        This adds:
     9
     10         - A CallMode enum to distinguish tail calls from regular calls from construct
     11
     12         - A FrameAction enum to indicate whether to keep or reuse the call
     13           frame. It also changes JITOperations.h to correctly use this to tell
     14           slowPathFor to *not* trash the frame on a regular call (before
     15           r187505, this was statically known in slowPathFor).
     16
     17        * CMakeLists.txt:
     18        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     19        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     20        * JavaScriptCore.xcodeproj/project.pbxproj:
     21        * assembler/AbstractMacroAssembler.h:
     22        (JSC::AbstractMacroAssembler::repatchNearCall):
     23        * assembler/CodeLocation.h:
     24        (JSC::CodeLocationNearCall::CodeLocationNearCall):
     25        (JSC::CodeLocationNearCall::callMode):
     26        (JSC::CodeLocationCommon::nearCallAtOffset):
     27        * assembler/LinkBuffer.h:
     28        (JSC::LinkBuffer::locationOfNearCall):
     29        * bytecode/CallLinkInfo.h:
     30        (JSC::CallLinkInfo::callModeFor):
     31        (JSC::CallLinkInfo::callMode):
     32        (JSC::CallLinkInfo::isTailCall):
     33        (JSC::CallLinkInfo::isVarargs):
     34        * bytecode/CallMode.cpp: Added.
     35        (WTF::printInternal):
     36        * bytecode/CallMode.h: Added.
     37        * jit/JITOperations.cpp:
     38        * jit/Repatch.cpp:
     39        (JSC::linkPolymorphicCall):
     40        * jit/ThunkGenerators.cpp:
     41        (JSC::slowPathFor):
     42        (JSC::virtualThunkFor):
     43
    1442015-07-30  Basile Clement  <basile_clement@apple.com>
    245
  • branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r186820 r187629  
    318318    <ClCompile Include="..\bytecode\CallLinkInfo.cpp" />
    319319    <ClCompile Include="..\bytecode\CallLinkStatus.cpp" />
     320    <ClCompile Include="..\bytecode\CallMode.cpp" />
    320321    <ClCompile Include="..\bytecode\CallVariant.cpp" />
    321322    <ClCompile Include="..\bytecode\CodeBlock.cpp" />
     
    968969    <ClInclude Include="..\bytecode\CallLinkInfo.h" />
    969970    <ClInclude Include="..\bytecode\CallLinkStatus.h" />
     971    <ClInclude Include="..\bytecode\CallMode.h" />
    970972    <ClInclude Include="..\bytecode\CallReturnOffsetToBytecodeOffset.h" />
    971973    <ClInclude Include="..\bytecode\CallVariant.h" />
  • branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r186820 r187629  
    157157      <Filter>bytecode</Filter>
    158158    </ClCompile>
     159    <ClCompile Include="..\bytecode\CallMode.cpp">
     160      <Filter>bytecode</Filter>
     161    </ClCompile>
    159162    <ClCompile Include="..\bytecode\CodeBlock.cpp">
    160163      <Filter>bytecode</Filter>
     
    19341937    </ClInclude>
    19351938    <ClInclude Include="..\bytecode\CallLinkStatus.h">
     1939      <Filter>bytecode</Filter>
     1940    </ClInclude>
     1941    <ClInclude Include="..\bytecode\CallMode.h">
    19361942      <Filter>bytecode</Filter>
    19371943    </ClInclude>
  • branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r186820 r187629  
    963963                5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; };
    964964                5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; };
     965                627673231B680C1E00FD9F2E /* CallMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 627673211B680C1E00FD9F2E /* CallMode.cpp */; };
     966                627673241B680C1E00FD9F2E /* CallMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 627673221B680C1E00FD9F2E /* CallMode.h */; };
    965967                62D2D38F1ADF103F000206C1 /* FunctionRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */; };
    966968                62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D2D38E1ADF103F000206C1 /* FunctionRareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    26772679                5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
    26782680                5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = "<group>"; };
     2681                627673211B680C1E00FD9F2E /* CallMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallMode.cpp; sourceTree = "<group>"; };
     2682                627673221B680C1E00FD9F2E /* CallMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallMode.h; sourceTree = "<group>"; };
    26792683                62A9A29E1B0BED4800BD54CA /* DFGLazyNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGLazyNode.cpp; path = dfg/DFGLazyNode.cpp; sourceTree = "<group>"; };
    26802684                62A9A29F1B0BED4800BD54CA /* DFGLazyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLazyNode.h; path = dfg/DFGLazyNode.h; sourceTree = "<group>"; };
     
    52585262                                0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */,
    52595263                                0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */,
     5264                                627673211B680C1E00FD9F2E /* CallMode.cpp */,
     5265                                627673221B680C1E00FD9F2E /* CallMode.h */,
    52605266                                0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */,
    52615267                                0F3B7E2419A11B8000D9BC56 /* CallVariant.cpp */,
     
    52795285                                0FC712DC17CD8778008CC93C /* DeferredCompilationCallback.cpp */,
    52805286                                0FC712DD17CD8778008CC93C /* DeferredCompilationCallback.h */,
     5287                                FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */,
     5288                                FE5068641AE246390009DAB7 /* DeferredSourceDump.h */,
    52815289                                0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */,
    52825290                                0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */,
     
    53265334                                1429D8830ED21C3D00B89619 /* SamplingTool.cpp */,
    53275335                                1429D8840ED21C3D00B89619 /* SamplingTool.h */,
    5328                                 FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */,
    5329                                 FE5068641AE246390009DAB7 /* DeferredSourceDump.h */,
    53305336                                0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */,
    53315337                                0F5541B01613C1FB00CE3E25 /* SpecialPointer.h */,
     
    58665872                                A7D89CFE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */,
    58675873                                0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
     5874                                627673241B680C1E00FD9F2E /* CallMode.h in Headers */,
    58685875                                0FD8A32617D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h in Headers */,
    58695876                                62F2AA381B0BEDE300610C7A /* DFGLazyNode.h in Headers */,
     
    75687575                                9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */,
    75697576                                BCDE3B430E6C832D001453A7 /* Structure.cpp in Sources */,
     7577                                627673231B680C1E00FD9F2E /* CallMode.cpp in Sources */,
    75707578                                7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */,
    75717579                                C2F0F2D116BAEEE900187C19 /* StructureRareData.cpp in Sources */,
  • branches/jsc-tailcall/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r187354 r187629  
    11551155    {
    11561156        switch (nearCall.callMode()) {
    1157         case CallMode::Tail:
     1157        case NearCallMode::Tail:
    11581158            AssemblerType::relinkJump(nearCall.dataLocation(), destination.executableAddress());
    11591159            return;
    1160         case CallMode::Regular:
     1160        case NearCallMode::Regular:
    11611161            AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress());
    11621162            return;
  • branches/jsc-tailcall/Source/JavaScriptCore/assembler/CodeLocation.h

    r187354 r187629  
    3333namespace JSC {
    3434
    35 enum CallMode { Regular, Tail };
     35enum NearCallMode { Regular, Tail };
    3636
    3737class CodeLocationInstruction;
     
    6262    CodeLocationJump jumpAtOffset(int offset);
    6363    CodeLocationCall callAtOffset(int offset);
    64     CodeLocationNearCall nearCallAtOffset(int offset, CallMode);
     64    CodeLocationNearCall nearCallAtOffset(int offset, NearCallMode);
    6565    CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset);
    6666    CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
     
    118118public:
    119119    CodeLocationNearCall() {}
    120     explicit CodeLocationNearCall(MacroAssemblerCodePtr location, CallMode callMode)
     120    explicit CodeLocationNearCall(MacroAssemblerCodePtr location, NearCallMode callMode)
    121121        : CodeLocationCommon(location), m_callMode(callMode) {}
    122     explicit CodeLocationNearCall(void* location, CallMode callMode)
     122    explicit CodeLocationNearCall(void* location, NearCallMode callMode)
    123123        : CodeLocationCommon(MacroAssemblerCodePtr(location)), m_callMode(callMode) {}
    124     CallMode callMode() { return m_callMode; }
     124    NearCallMode callMode() { return m_callMode; }
    125125private:
    126     CallMode m_callMode = CallMode::Regular;
     126    NearCallMode m_callMode = NearCallMode::Regular;
    127127};
    128128
     
    187187}
    188188
    189 inline CodeLocationNearCall CodeLocationCommon::nearCallAtOffset(int offset, CallMode callMode)
     189inline CodeLocationNearCall CodeLocationCommon::nearCallAtOffset(int offset, NearCallMode callMode)
    190190{
    191191    ASSERT_VALID_CODE_OFFSET(offset);
  • branches/jsc-tailcall/Source/JavaScriptCore/assembler/LinkBuffer.h

    r187354 r187629  
    182182        ASSERT(call.isFlagSet(Call::Near));
    183183        return CodeLocationNearCall(MacroAssembler::getLinkerAddress(code(), applyOffset(call.m_label)),
    184             call.isFlagSet(Call::Tail) ? CallMode::Tail : CallMode::Regular);
     184            call.isFlagSet(Call::Tail) ? NearCallMode::Tail : NearCallMode::Regular);
    185185    }
    186186
  • branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallLinkInfo.h

    r187590 r187629  
    2727#define CallLinkInfo_h
    2828
     29#include "CallMode.h"
    2930#include "CodeLocation.h"
    3031#include "CodeSpecializationKind.h"
     
    7475    }
    7576
    76     static bool isTailCallType(CallType callType)
    77     {
    78         switch (callType) {
    79         case TailCall:
    80         case TailCallVarargs:
    81             return true;
    82 
    83         default:
    84             return false;
    85         }
    86     }
    87    
    8877    CallLinkInfo()
    8978        : m_registerPreservationMode(static_cast<unsigned>(RegisterPreservationNotRequired))
     
    112101    {
    113102        return specializationKindFor(static_cast<CallType>(m_callType));
     103    }
     104
     105    static CallMode callModeFor(CallType callType)
     106    {
     107        switch (callType) {
     108        case Call:
     109        case CallVarargs:
     110            return CallMode::Regular;
     111        case TailCall:
     112        case TailCallVarargs:
     113            return CallMode::Tail;
     114        case Construct:
     115        case ConstructVarargs:
     116            return CallMode::Construct;
     117        case None:
     118            RELEASE_ASSERT_NOT_REACHED();
     119        }
     120    }
     121    CallMode callMode() const
     122    {
     123        return callModeFor(static_cast<CallType>(m_callType));
     124    }
     125
     126    bool isTailCall() const
     127    {
     128        return callMode() == CallMode::Tail;
     129    }
     130
     131    bool isVarargs() const
     132    {
     133        return isVarargsCallType(static_cast<CallType>(m_callType));
    114134    }
    115135
  • branches/jsc-tailcall/Source/JavaScriptCore/jit/JITOperations.cpp

    r187590 r187629  
    706706}
    707707
    708 static SlowPathReturnType handleHostCall(ExecState* execCallee, JSValue callee, CodeSpecializationKind kind)
     708static SlowPathReturnType handleHostCall(ExecState* execCallee, JSValue callee, CallLinkInfo* callLinkInfo)
    709709{
    710710    ExecState* exec = execCallee->callerFrame();
     
    713713    execCallee->setCodeBlock(0);
    714714
    715     if (kind == CodeForCall) {
     715    if (callLinkInfo->specializationKind() == CodeForCall) {
    716716        CallData callData;
    717717        CallType callType = getCallData(callee, callData);
     
    723723            execCallee->setCallee(asObject(callee));
    724724            vm->hostCallReturnValue = JSValue::decode(callData.native.function(execCallee));
    725             if (vm->exception())
    726                 return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
    727 
    728             return encodeResult(bitwise_cast<void*>(getHostCallReturnValue), reinterpret_cast<void*>(1));
     725            if (vm->exception()) {
     726                return encodeResult(
     727                    vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     728                    reinterpret_cast<void*>(KeepTheFrame));
     729            }
     730
     731            return encodeResult(
     732                bitwise_cast<void*>(getHostCallReturnValue),
     733                reinterpret_cast<void*>(callLinkInfo->callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
    729734        }
    730735   
    731736        ASSERT(callType == CallTypeNone);
    732737        exec->vm().throwException(exec, createNotAFunctionError(exec, callee));
    733         return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
    734     }
    735 
    736     ASSERT(kind == CodeForConstruct);
     738        return encodeResult(
     739            vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     740            reinterpret_cast<void*>(KeepTheFrame));
     741    }
     742
     743    ASSERT(callLinkInfo->specializationKind() == CodeForConstruct);
    737744   
    738745    ConstructData constructData;
     
    745752        execCallee->setCallee(asObject(callee));
    746753        vm->hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
    747         if (vm->exception())
    748             return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
    749 
    750         return encodeResult(bitwise_cast<void*>(getHostCallReturnValue), reinterpret_cast<void*>(1));
     754        if (vm->exception()) {
     755            return encodeResult(
     756                vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     757                reinterpret_cast<void*>(KeepTheFrame));
     758        }
     759
     760        return encodeResult(bitwise_cast<void*>(getHostCallReturnValue), reinterpret_cast<void*>(KeepTheFrame));
    751761    }
    752762   
    753763    ASSERT(constructType == ConstructTypeNone);
    754764    exec->vm().throwException(exec, createNotAConstructorError(exec, callee));
    755     return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
     765    return encodeResult(
     766        vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     767        reinterpret_cast<void*>(KeepTheFrame));
    756768}
    757769
     
    769781        // expensive.
    770782        // https://bugs.webkit.org/show_bug.cgi?id=144458
    771         return handleHostCall(execCallee, calleeAsValue, kind);
     783        return handleHostCall(execCallee, calleeAsValue, callLinkInfo);
    772784    }
    773785
     
    785797        if (!isCall(kind) && functionExecutable->isBuiltinFunction()) {
    786798            exec->vm().throwException(exec, createNotAConstructorError(exec, callee));
    787             return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
     799            return encodeResult(
     800                vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     801                reinterpret_cast<void*>(KeepTheFrame));
    788802        }
    789803
     
    791805        if (error) {
    792806            exec->vm().throwException(exec, error);
    793             return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
     807            return encodeResult(
     808                vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     809                reinterpret_cast<void*>(KeepTheFrame));
    794810        }
    795811        codeBlock = functionExecutable->codeBlockFor(kind);
    796812        ArityCheckMode arity;
    797         if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || CallLinkInfo::isVarargsCallType(callLinkInfo->callType()))
     813        if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || callLinkInfo->isVarargs())
    798814            arity = MustCheckArity;
    799815        else
     
    806822        linkFor(execCallee, *callLinkInfo, codeBlock, callee, codePtr);
    807823   
    808     return encodeResult(codePtr.executableAddress(), reinterpret_cast<void*>(1));
     824    return encodeResult(codePtr.executableAddress(), reinterpret_cast<void*>(callLinkInfo->callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
    809825}
    810826
     
    820836    calleeAsFunctionCell = getJSFunction(calleeAsValue);
    821837    if (UNLIKELY(!calleeAsFunctionCell))
    822         return handleHostCall(execCallee, calleeAsValue, kind);
     838        return handleHostCall(execCallee, calleeAsValue, callLinkInfo);
    823839   
    824840    JSFunction* function = jsCast<JSFunction*>(calleeAsFunctionCell);
     
    830846        if (!isCall(kind) && functionExecutable->isBuiltinFunction()) {
    831847            exec->vm().throwException(exec, createNotAConstructorError(exec, function));
    832             return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
     848            return encodeResult(
     849                vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     850                reinterpret_cast<void*>(KeepTheFrame));
    833851        }
    834852
     
    836854        if (error) {
    837855            exec->vm().throwException(exec, error);
    838             return encodeResult(vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast<void*>(0));
     856            return encodeResult(
     857                vm->getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
     858                reinterpret_cast<void*>(KeepTheFrame));
    839859        }
    840860    }
    841861    return encodeResult(executable->entrypointFor(
    842862        *vm, kind, MustCheckArity, callLinkInfo->registerPreservationMode()).executableAddress(),
    843         reinterpret_cast<void*>(1));
     863        reinterpret_cast<void*>(callLinkInfo->callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
    844864}
    845865
  • branches/jsc-tailcall/Source/JavaScriptCore/jit/Repatch.cpp

    r187618 r187629  
    17581758            // If we cannot handle a callee, assume that it's better for this whole thing to be a
    17591759            // virtual call.
    1760             if (exec->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || CallLinkInfo::isVarargsCallType(callLinkInfo.callType())) {
     1760            if (exec->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || callLinkInfo.isVarargs()) {
    17611761                linkVirtualFor(exec, callLinkInfo);
    17621762                return;
     
    18811881                CCallHelpers::Address(fastCountsBaseGPR, caseIndex * sizeof(uint32_t)));
    18821882        }
    1883         if (CallLinkInfo::isTailCallType(callLinkInfo.callType())) {
     1883        if (callLinkInfo.isTailCall()) {
    18841884            stubJit.prepareForTailCallSlow();
    18851885            calls[caseIndex].call = stubJit.nearTailCall();
  • branches/jsc-tailcall/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r187618 r187629  
    100100    jit.emitFunctionEpilogue();
    101101
     102    RELEASE_ASSERT(reinterpret_cast<void*>(KeepTheFrame) == reinterpret_cast<void*>(0));
    102103    CCallHelpers::Jump doNotTrash = jit.branchTestPtr(CCallHelpers::Zero, GPRInfo::returnValueGPR2);
    103104
     
    192193    // Make a tail call. This will return back to JIT code.
    193194    emitPointerValidation(jit, GPRInfo::regT4);
    194     if (CallLinkInfo::isTailCallType(callLinkInfo.callType())) {
     195    if (callLinkInfo.isTailCall()) {
    195196        jit.preserveReturnAddressAfterCall(GPRInfo::regT0);
    196197        jit.prepareForTailCallSlow(GPRInfo::regT4);
     
    206207    return FINALIZE_CODE(
    207208        patchBuffer,
    208         ("Virtual %s%s slow path thunk at CodePtr(%p)",
    209         callLinkInfo.specializationKind() == CodeForCall ? "call" : "construct",
    210         callLinkInfo.registerPreservationMode() == MustPreserveRegisters ? " that preserves registers" : "",
     209        ("Virtual %s slow path thunk at CodePtr(%p)",
     210        callLinkInfo.callMode() == CallMode::Regular ? "call" : callLinkInfo.callMode() == CallMode::Tail ? "tail call" : "construct",
    211211        callLinkInfo.callReturnLocation().dataLocation()));
    212212}
Note: See TracChangeset for help on using the changeset viewer.