Ignore:
Timestamp:
Mar 27, 2014, 6:10:25 PM (11 years ago)
Author:
[email protected]
Message:

Support spread operand in |new| expressions
https://bugs.webkit.org/show_bug.cgi?id=130877

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Add support for the spread operator being applied in
|new| expressions. This required adding support for
a new opcode, op_construct_varargs. This is a relatively
simple refactoring of the call_varargs implementation.

  • bytecode/BytecodeList.json:
  • bytecode/BytecodeUseDef.h:

(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):

  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::unlink):

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::callTypeFor):
(JSC::CallLinkInfo::specializationKind):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitCallVarargs):
(JSC::BytecodeGenerator::emitConstructVarargs):
(JSC::BytecodeGenerator::emitConstruct):

  • bytecompiler/BytecodeGenerator.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::emitSlow_op_construct_varargs):

  • jit/JITCall32_64.cpp:

(JSC::JIT::emitSlow_op_construct_varargs):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITOperations.cpp:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LLIntSlowPaths.h:
  • llint/LowLevelInterpreter.asm:
  • parser/Parser.cpp:

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

LayoutTests:

Correctness and performance tests for spread operands

  • js/parser-syntax-check-expected.txt:
  • js/regress/call-spread-expected.txt: Added.
  • js/regress/call-spread.html: Added.
  • js/regress/new-spread-expected.txt: Added.
  • js/regress/new-spread.html: Added.
  • js/regress/script-tests/call-spread.js: Added.

(testFunction):
(test2):
(test3):

  • js/regress/script-tests/new-spread.js: Added.

(testFunction):
(test2):
(test3):

  • js/script-tests/parser-syntax-check.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp

    r166218 r166392  
    4747        callReturnLocation,
    4848        repatchBuffer.codeBlock()->vm()->getCTIStub(linkThunkGeneratorFor(
    49             callType == Construct ? CodeForConstruct : CodeForCall,
     49            (callType == Construct || callType == ConstructVarargs)? CodeForConstruct : CodeForCall,
    5050            isFTL ? MustPreserveRegisters : RegisterPreservationNotRequired)).code());
    5151    hasSeenShouldRepatch = false;
Note: See TracChangeset for help on using the changeset viewer.