Ignore:
Timestamp:
May 22, 2012, 1:02:25 PM (13 years ago)
Author:
[email protected]
Message:

DFG should support reflective arguments access
https://bugs.webkit.org/show_bug.cgi?id=85721

Reviewed by Oliver Hunt.

Merged r116345 from dfgopt.

This adds support for op_create_arguments to the DFG. No other arguments-related
opcodes are added by this change, though it does add a lot of the scaffolding
necessary for the other ops.

This also adds GetByVal/PutByVal optimizations for Arguments.

Finally, this rationalizes slowPathCall with no return. Previously, that would
work via callOperation() overloads that took InvalidGPRReg as the return GPR.
But that creates awful ambiguity, since we had template functions that were
polymorphic over all parameters except the second, which was a GPRReg, and a
bunch of non-template overloads that also potentially had GPRReg as the second
argument. I finally started to hit this ambiguity and was getting absolutely
bizarre compiler errors, that made me feel like I was programming in SML. So,
I changed the no-argument overloads to take NoResultTag instead, which made
everything sensible again by eliminating the overload ambiguity.

This is a ~7% speed-up on V8/earley and neutral elsewhere.

  • bytecode/PredictedType.h:

(JSC::isArgumentsPrediction):
(JSC):
(JSC::isActionableMutableArrayPrediction):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCCallHelpers.h:

(JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
(CCallHelpers):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canCompileOpcode):
(JSC::DFG::canInlineOpcode):

  • dfg/DFGCommon.h:
  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGNode.h:

(JSC::DFG::Node::unmodifiedArgumentsRegister):
(Node):
(JSC::DFG::Node::shouldSpeculateArguments):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
(JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
(DFG):
(JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::silentSpillAllRegistersImpl):
(SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::pickCanTrample):
(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::compile):

  • runtime/Arguments.h:

(ArgumentsData):
(Arguments):
(JSC::Arguments::offsetOfData):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGCCallHelpers.h

    r116951 r118030  
    132132    }
    133133
     134    ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2)
     135    {
     136        resetCallArguments();
     137        addCallArgument(GPRInfo::callFrameRegister);
     138        addCallArgument(arg1);
     139        addCallArgument(arg2);
     140    }
     141
    134142    ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImm32 arg2)
    135143    {
     
    433441    }
    434442   
     443    ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2)
     444    {
     445        move(arg1, GPRInfo::argumentGPR1);
     446        move(arg2, GPRInfo::argumentGPR2);
     447        move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
     448    }
     449   
    435450    ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, ImmPtr arg2)
    436451    {
Note: See TracChangeset for help on using the changeset viewer.