Ignore:
Timestamp:
Oct 16, 2020, 8:52:27 AM (5 years ago)
Author:
[email protected]
Message:

Don't emit OpSpread with a constant as the destination
https://bugs.webkit.org/show_bug.cgi?id=217800
<rdar://problem/69492311>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/spread-should-not-have-a-constant-as-dst.js: Added.

(foo):
(bar):

Source/JavaScriptCore:

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitConstruct):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r267489 r268593  
    33063306                if (elements && !elements->next() && elements->value()->isSpreadExpression()) {
    33073307                    ExpressionNode* expression = static_cast<SpreadExpressionNode*>(elements->value())->expression();
    3308                     RefPtr<RegisterID> argumentRegister = emitNode(callArguments.argumentRegister(0), expression);
     3308                    RefPtr<RegisterID> argumentRegister = tempDestination(emitNode(callArguments.argumentRegister(0), expression));
    33093309                    OpSpread::emit(this, argumentRegister.get(), argumentRegister.get());
    33103310
     
    35103510                if (elements && !elements->next() && elements->value()->isSpreadExpression()) {
    35113511                    ExpressionNode* expression = static_cast<SpreadExpressionNode*>(elements->value())->expression();
    3512                     RefPtr<RegisterID> argumentRegister = emitNode(callArguments.argumentRegister(0), expression);
     3512                    RefPtr<RegisterID> argumentRegister = tempDestination(emitNode(callArguments.argumentRegister(0), expression));
    35133513                    OpSpread::emit(this, argumentRegister.get(), argumentRegister.get());
    35143514
Note: See TracChangeset for help on using the changeset viewer.