Changeset 129948 in webkit for trunk/Source/JavaScriptCore/dfg


Ignore:
Timestamp:
Sep 28, 2012, 1:57:47 PM (13 years ago)
Author:
[email protected]
Message:
ASSERTION in m_graph[tailNodeIndex].op() == Flush
m_graph[tailNodeIndex].op() == SetLocal on plus.google.com

https://bugs.webkit.org/show_bug.cgi?id=97656

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:

There were two bugs here:

1) In case of multiple GetLocals to the same captured variable, the bytecode parser would linke the first,

rather than the last, of the GetLocals into the vars-at-tail table.


2) The constant folding phase was asserting that any GetLocal it eliminates must be linked into the

vars-at-tail table, when for captured variables only the last of those should be.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::getLocal):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::foldConstants):

LayoutTests:

  • fast/js/dfg-redundant-load-of-captured-variable-proven-constant-expected.txt: Added.
  • fast/js/dfg-redundant-load-of-captured-variable-proven-constant.html: Added.
  • fast/js/jsc-test-list:
  • fast/js/script-tests/dfg-redundant-load-of-captured-variable-proven-constant.js: Added.

(o.f):

Location:
trunk/Source/JavaScriptCore/dfg
Files:
2 edited

Legend:

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

    r129713 r129948  
    228228                    nodeIndex = nodePtr->child1().index();
    229229               
    230                 return injectLazyOperandSpeculation(addToGraph(GetLocal, OpInfo(nodePtr->variableAccessData()), nodeIndex));
     230                NodeIndex newGetLocal = injectLazyOperandSpeculation(
     231                    addToGraph(GetLocal, OpInfo(nodePtr->variableAccessData()), nodeIndex));
     232                m_currentBlock->variablesAtTail.local(operand) = newGetLocal;
     233                return newGetLocal;
    231234            }
    232235           
  • trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp

    r126715 r129948  
    180180                else {
    181181                    ASSERT(m_graph[tailNodeIndex].op() == Flush
    182                            || m_graph[tailNodeIndex].op() == SetLocal);
     182                        || m_graph[tailNodeIndex].op() == SetLocal
     183                        || node.variableAccessData()->isCaptured());
    183184                }
    184185            }
Note: See TracChangeset for help on using the changeset viewer.