Ignore:
Timestamp:
Dec 1, 2015, 2:12:42 PM (10 years ago)
Author:
[email protected]
Message:

Remove repetitive cruft from FTL OSR exit code in LowerDFGToLLVM
https://bugs.webkit.org/show_bug.cgi?id=151718

Reviewed by Geoffrey Garen.

  • b3/B3StackmapValue.h:
  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitArgumentsForPatchpointIfWillCatchException):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitDescriptor):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToLLVM::blessSpeculation):
(JSC::FTL::DFG::LowerDFGToLLVM::emitOSRExitCall):
(JSC::FTL::DFG::LowerDFGToLLVM::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::callStackmap):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r192896 r192912  
    52845284        OSRExitDescriptor& exitDescriptor = m_ftlState.jitCode->osrExitDescriptors.last();
    52855285       
    5286         StackmapArgumentList arguments =
    5287             buildExitArguments(exitDescriptor, FormattedValue(), exitDescriptor.m_codeOrigin);
     5286        StackmapArgumentList arguments = buildExitArguments(exitDescriptor, FormattedValue());
    52885287        callStackmap(exitDescriptor, arguments);
    52895288       
     
    91819180
    91829181        StackmapArgumentList freshList =
    9183             buildExitArguments(exitDescriptor, noValue(), exitDescriptor.m_codeOrigin, offsetOfExitArguments);
     9182            buildExitArguments(exitDescriptor, noValue(), offsetOfExitArguments);
    91849183        arguments.appendVector(freshList);
    91859184    }
     
    92029201    }
    92039202
    9204     void appendOSRExitDescriptor(ExitKind kind, ExceptionType exceptionType, FormattedValue lowValue, Node* highValue, NodeOrigin origin)
    9205     {
    9206         m_ftlState.jitCode->osrExitDescriptors.append(OSRExitDescriptor(
     9203    OSRExitDescriptor& appendOSRExitDescriptor(ExitKind kind, ExceptionType exceptionType, FormattedValue lowValue, Node* highValue, NodeOrigin origin)
     9204    {
     9205        return m_ftlState.jitCode->osrExitDescriptors.alloc(
    92079206            kind, exceptionType, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
    92089207            origin.forExit, origin.semantic,
    92099208            availabilityMap().m_locals.numberOfArguments(),
    9210             availabilityMap().m_locals.numberOfLocals()));
     9209            availabilityMap().m_locals.numberOfLocals());
    92119210    }
    92129211   
     
    92499248            m_out.speculate(failCondition), kind, lowValue, highValue, origin, isExceptionHandler);
    92509249#else // FTL_USES_B3
    9251         appendOSRExitDescriptor(kind, isExceptionHandler ? ExceptionType::CCallException : ExceptionType::None, lowValue, highValue, origin);
    9252         OSRExitDescriptor& exitDescriptor = m_ftlState.jitCode->osrExitDescriptors.last();
     9250        OSRExitDescriptor& exitDescriptor = appendOSRExitDescriptor(kind, isExceptionHandler ? ExceptionType::CCallException : ExceptionType::None, lowValue, highValue, origin);
    92539251
    92549252        if (failCondition == m_out.booleanTrue) {
     
    92789276    void blessSpeculation(B3::StackmapValue* value, ExitKind kind, FormattedValue lowValue, Node* highValue, NodeOrigin origin, bool isExceptionHandler = false)
    92799277    {
    9280         appendOSRExitDescriptor(kind, isExceptionHandler ? ExceptionType::CCallException : ExceptionType::None, lowValue, highValue, origin);
    9281         OSRExitDescriptor& exitDescriptor = m_ftlState.jitCode->osrExitDescriptors.last();
    9282         CodeOrigin codeOrigin = exitDescriptor.m_codeOrigin;
    9283         StackmapArgumentList arguments = buildExitArguments(exitDescriptor, lowValue, codeOrigin);
    9284         for (LValue child : arguments)
    9285             value->append(child);
     9278        OSRExitDescriptor& exitDescriptor = appendOSRExitDescriptor(kind, isExceptionHandler ? ExceptionType::CCallException : ExceptionType::None, lowValue, highValue, origin);
     9279        value->appendAnys(buildExitArguments(exitDescriptor, lowValue));
    92869280        value->setGenerator(
    92879281            [&] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
     
    92949288    void emitOSRExitCall(OSRExitDescriptor& exitDescriptor, FormattedValue lowValue)
    92959289    {
    9296         StackmapArgumentList arguments;
    9297        
    9298         CodeOrigin codeOrigin = exitDescriptor.m_codeOrigin;
    9299        
    9300         buildExitArguments(exitDescriptor, arguments, lowValue, codeOrigin);
    9301        
    9302         callStackmap(exitDescriptor, arguments);
     9290        callStackmap(exitDescriptor, buildExitArguments(exitDescriptor, lowValue));
    93039291    }
    93049292#endif
    93059293
    93069294    StackmapArgumentList buildExitArguments(
    9307         OSRExitDescriptor& exitDescriptor, FormattedValue lowValue, CodeOrigin codeOrigin,
     9295        OSRExitDescriptor& exitDescriptor, FormattedValue lowValue,
    93089296        unsigned offsetOfExitArgumentsInStackmapLocations = 0)
    93099297    {
    93109298        StackmapArgumentList result;
    93119299        buildExitArguments(
    9312             exitDescriptor, result, lowValue, codeOrigin, offsetOfExitArgumentsInStackmapLocations);
     9300            exitDescriptor, result, lowValue, offsetOfExitArgumentsInStackmapLocations);
    93139301        return result;
    93149302    }
     
    93169304    void buildExitArguments(
    93179305        OSRExitDescriptor& exitDescriptor, StackmapArgumentList& arguments, FormattedValue lowValue,
    9318         CodeOrigin codeOrigin, unsigned offsetOfExitArgumentsInStackmapLocations = 0)
     9306        unsigned offsetOfExitArgumentsInStackmapLocations = 0)
    93199307    {
    93209308        if (!!lowValue)
     
    93229310       
    93239311        AvailabilityMap availabilityMap = this->availabilityMap();
    9324         availabilityMap.pruneByLiveness(m_graph, codeOrigin);
     9312        availabilityMap.pruneByLiveness(m_graph, exitDescriptor.m_codeOrigin);
    93259313       
    93269314        HashMap<Node*, ExitTimeObjectMaterialization*> map;
     
    93499337                DFG_ASSERT(
    93509338                    m_graph, m_node,
    9351                     (!(availability.isDead() && m_graph.isLiveInBytecode(VirtualRegister(operand), codeOrigin))) || m_graph.m_plan.mode == FTLForOSREntryMode);
     9339                    (!(availability.isDead() && m_graph.isLiveInBytecode(VirtualRegister(operand), exitDescriptor.m_codeOrigin))) || m_graph.m_plan.mode == FTLForOSREntryMode);
    93529340            }
    93539341            ExitValue exitValue = exitValueForAvailability(arguments, map, availability);
     
    93799367
    93809368#if !FTL_USES_B3
    9381     void callStackmap(OSRExitDescriptor& exitDescriptor, StackmapArgumentList& arguments)
     9369    void callStackmap(OSRExitDescriptor& exitDescriptor, StackmapArgumentList arguments)
    93829370    {
    93839371        exitDescriptor.m_stackmapID = m_stackmapIDs++;
Note: See TracChangeset for help on using the changeset viewer.