Ignore:
Timestamp:
Aug 6, 2013, 2:20:10 PM (12 years ago)
Author:
[email protected]
Message:

Delay Arguments creation in strict mode
https://bugs.webkit.org/show_bug.cgi?id=119505

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Make use of the write tracking performed by the parser to
allow us to know if we're modifying the parameters to a function.
Then use that information to make strict mode function opt out
of eager arguments creation.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
(JSC::BytecodeGenerator::emitReturn):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::shouldTearOffArgumentsEagerly):

  • parser/Nodes.h:

(JSC::ScopeNode::modifiesParameter):

  • parser/Parser.cpp:

(JSC::::parseInner):

  • parser/Parser.h:

(JSC::Scope::declareParameter):
(JSC::Scope::getCapturedVariables):
(JSC::Parser::declareWrite):

  • parser/ParserModes.h:

LayoutTests:

Add performance testcase for lazy creation of arguments in strict mode

  • fast/js/regress/delay-tear-off-arguments-strictmode-expected.txt: Added.
  • fast/js/regress/delay-tear-off-arguments-strictmode.html: Added.
  • fast/js/regress/script-tests/delay-tear-off-arguments-strictmode.js: Added.

(bar):

File:
1 edited

Legend:

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

    r143147 r153763  
    4848const CodeFeatures StrictModeFeature = 1 << 5;
    4949const CodeFeatures ShadowsArgumentsFeature = 1 << 6;
     50const CodeFeatures ModifiedParameterFeature = 1 << 7;
    5051
    51 const CodeFeatures AllFeatures = EvalFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature;
     52const CodeFeatures AllFeatures = EvalFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature | ModifiedParameterFeature;
    5253
    5354} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.