Ignore:
Timestamp:
Jul 27, 2014, 4:35:32 PM (11 years ago)
Author:
[email protected]
Message:

[REGRESSION][ftlopt merge][32-bit] stress/prune-multi-put-by-offset-replace-or-transition-variant.js.dfg-eager hits an assertion in SpeculativeJIT::silentSavePlanForGPR
https://bugs.webkit.org/show_bug.cgi?id=135323

Reviewed by Oliver Hunt.

SpeculativeJIT::silentSavePlanForGPR likes to believe that if a node is a constant,
then it's a constant that can be represented using that node's current DataFormat.
This doesn't work if the constant had been filled as a JSValue, and then one of the
fillSpeculateBlah() methods had speculated that it's of some type that the constant
isn't. Unless fillSpeculateBlah() specifically defends against this case, we'll have
a constant that claims to have a contradictory data format.

This patch fixes such a bug in the 32-bit fillSpeculateCell(). The 64-bit
fillSpeculateCell() appears to not have this bug, but I added a similar defense
mechanism anyway just in case, since this is one of those mistakes that keeps
reappearing.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateCell):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateCell):

File:
1 edited

Legend:

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

    r171660 r171662  
    996996    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    997997
     998    if (edge->hasConstant() && !edge->isCellConstant()) {
     999        // Better to fail early on constants.
     1000        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1001        return allocate();
     1002    }
     1003
    9981004    switch (info.registerFormat()) {
    9991005    case DataFormatNone: {
     
    10021008        if (edge->hasConstant()) {
    10031009            JSValue jsValue = edge->asJSValue();
    1004             if (jsValue.isCell()) {
    1005                 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    1006                 m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
    1007                 info.fillJSValue(*m_stream, gpr, DataFormatJSCell);
    1008                 return gpr;
    1009             }
    1010             terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1010            m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
     1011            m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
     1012            info.fillJSValue(*m_stream, gpr, DataFormatJSCell);
    10111013            return gpr;
    10121014        }
Note: See TracChangeset for help on using the changeset viewer.