Ignore:
Timestamp:
Oct 10, 2014, 12:03:20 PM (11 years ago)
Author:
[email protected]
Message:

Various arguments optimisations in codegen fail to account for arguments being in lexical record
https://bugs.webkit.org/show_bug.cgi?id=137617

Reviewed by Michael Saboff.

Rework the way we track |arguments| references so that we don't try
to use the |arguments| reference on the stack if it's not safe.

To do this without nuking performance it was necessary to update
the parser to track modification of the |arguments| reference
itself.

  • bytecode/CodeBlock.cpp:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::willResolveToArguments):
(JSC::BytecodeGenerator::uncheckedLocalArgumentsRegister):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitConstruct):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::uncheckedRegisterForArguments): Deleted.

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::hasSafeLocalArgumentsRegister):

  • bytecompiler/NodesCodegen.cpp:

(JSC::BracketAccessorNode::emitBytecode):
(JSC::DotAccessorNode::emitBytecode):
(JSC::getArgumentByVal):
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
(JSC::ArrayPatternNode::emitDirectBinding):

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::existingArguments):

  • parser/Nodes.h:

(JSC::ScopeNode::modifiesArguments):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner):

  • parser/Parser.h:

(JSC::Scope::getCapturedVariables):

  • parser/ParserModes.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r172717 r174606  
    14411441        bool usesArguments() const { return (m_features & ArgumentsFeature) && !(m_features & ShadowsArgumentsFeature); }
    14421442        bool modifiesParameter() const { return m_features & ModifiedParameterFeature; }
     1443        bool modifiesArguments() const { return m_features & (EvalFeature | ModifiedArgumentsFeature); }
    14431444        bool isStrictMode() const { return m_features & StrictModeFeature; }
    14441445        void setUsesArguments() { m_features |= ArgumentsFeature; }
Note: See TracChangeset for help on using the changeset viewer.