Ignore:
Timestamp:
Jan 3, 2012, 4:06:42 PM (13 years ago)
Author:
[email protected]
Message:

REGRESSION (r98196-98236): Incorrect layout of iGoogle with RSS feeds
https://bugs.webkit.org/show_bug.cgi?id=75303
<rdar://problem/10633533>

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

The this argument was not being kept alive in some cases during inlining and intrinsic
optimizations.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::emitFunctionCheck):
(JSC::DFG::ByteCodeParser::handleInlining):

LayoutTests:

Reviewed by Gavin Barraclough.

  • fast/js/dfg-inline-unused-this-expected.txt: Added.
  • fast/js/dfg-inline-unused-this-method-check-expected.txt: Added.
  • fast/js/dfg-inline-unused-this-method-check.html: Added.
  • fast/js/dfg-inline-unused-this.html: Added.
  • fast/js/dfg-intrinsic-unused-this-expected.txt: Added.
  • fast/js/dfg-intrinsic-unused-this-method-check-expected.txt: Added.
  • fast/js/dfg-intrinsic-unused-this-method-check.html: Added.
  • fast/js/dfg-intrinsic-unused-this.html: Added.
  • fast/js/script-tests/dfg-inline-unused-this-method-check.js: Added.

(foo):
(bar):
(baz):

  • fast/js/script-tests/dfg-inline-unused-this.js: Added.

(foo):
(bar):
(baz):

  • fast/js/script-tests/dfg-intrinsic-unused-this-method-check.js: Added.

(bar):
(baz):

  • fast/js/script-tests/dfg-intrinsic-unused-this.js: Added.

(bar):
(baz):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r103255 r103981  
    8181    // Handle calls. This resolves issues surrounding inlining and intrinsics.
    8282    void handleCall(Interpreter*, Instruction* currentInstruction, NodeType op, CodeSpecializationKind);
     83    void emitFunctionCheck(JSFunction* expectedFunction, NodeIndex callTarget, int registerOffset, CodeSpecializationKind);
    8384    // Handle inlining. Return true if it succeeded, false if we need to plant a call.
    8485    bool handleInlining(bool usesResult, int callTarget, NodeIndex callTargetNodeIndex, int resultOperand, bool certainAboutExpectedFunction, JSFunction*, int registerOffset, int argumentCountIncludingThis, unsigned nextOffset, CodeSpecializationKind);
     
    941942        if (intrinsic != NoIntrinsic) {
    942943            if (!certainAboutExpectedFunction)
    943                 addToGraph(CheckFunction, OpInfo(expectedFunction), callTarget);
     944                emitFunctionCheck(expectedFunction, callTarget, registerOffset, kind);
    944945           
    945946            if (handleIntrinsic(usesResult, resultOperand, intrinsic, registerOffset, argumentCountIncludingThis, prediction)) {
     
    960961}
    961962
     963void ByteCodeParser::emitFunctionCheck(JSFunction* expectedFunction, NodeIndex callTarget, int registerOffset, CodeSpecializationKind kind)
     964{
     965    NodeIndex thisArgument;
     966    if (kind == CodeForCall)
     967        thisArgument = get(registerOffset + argumentToOperand(0));
     968    else
     969        thisArgument = NoNode;
     970    addToGraph(CheckFunction, OpInfo(expectedFunction), callTarget, thisArgument);
     971}
     972
    962973bool ByteCodeParser::handleInlining(bool usesResult, int callTarget, NodeIndex callTargetNodeIndex, int resultOperand, bool certainAboutExpectedFunction, JSFunction* expectedFunction, int registerOffset, int argumentCountIncludingThis, unsigned nextOffset, CodeSpecializationKind kind)
    963974{
     
    10091020    // are flushed.
    10101021    if (!certainAboutExpectedFunction)
    1011         addToGraph(CheckFunction, OpInfo(expectedFunction), callTargetNodeIndex);
     1022        emitFunctionCheck(expectedFunction, callTargetNodeIndex, registerOffset, kind);
    10121023   
    10131024    // FIXME: Don't flush constants!
Note: See TracChangeset for help on using the changeset viewer.