Changeset 143314 in webkit


Ignore:
Timestamp:
Feb 19, 2013, 2:41:39 AM (12 years ago)
Author:
fpizlo@apple.com
Message:

REGRESSION(r143241): It made 27 layout tests crash on 32 bit platforms
https://bugs.webkit.org/show_bug.cgi?id=110184

Reviewed by Zoltan Herczeg.

32-bit backend was making all sorts of crazy assumptions, which happened to mostly
not break things prior to http://trac.webkit.org/changeset/143241. This brings the
32-bit backend's type speculation fully into compliance with what the 64-bit
backend does.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r143292 r143314  
     12013-02-19  Filip Pizlo  <fpizlo@apple.com>
     2
     3        REGRESSION(r143241): It made 27 layout tests crash on 32 bit platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=110184
     5
     6        Reviewed by Zoltan Herczeg.
     7       
     8        32-bit backend was making all sorts of crazy assumptions, which happened to mostly
     9        not break things prior to http://trac.webkit.org/changeset/143241. This brings the
     10        32-bit backend's type speculation fully into compliance with what the 64-bit
     11        backend does.
     12
     13        * dfg/DFGSpeculativeJIT.cpp:
     14        (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32):
     15        (JSC::DFG::SpeculativeJIT::compileValueToInt32):
     16        * dfg/DFGSpeculativeJIT32_64.cpp:
     17        (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
     18        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
     19        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
     20        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
     21
    1222013-02-18  Ilya Tikhonovsky  <loislo@chromium.org>
    223
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r143242 r143314  
    20752075
    20762076    switch (info.registerFormat()) {
    2077     case DataFormatBoolean: // This type never occurs.
    20782077    case DataFormatStorage:
    20792078        RELEASE_ASSERT_NOT_REACHED();
    20802079
     2080    case DataFormatBoolean:
    20812081    case DataFormatCell:
    20822082        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     
    22502250    }
    22512251    case GeneratedOperandTypeUnknown:
    2252         RELEASE_ASSERT_NOT_REACHED();
     2252        ASSERT(!m_compileOkay);
    22532253        break;
    22542254    }
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r143276 r143314  
    856856    switch (info.registerFormat()) {
    857857    case DataFormatNone: {
    858 
     858        if ((node->hasConstant() && !isInt32Constant(node)) || info.spillFormat() == DataFormatDouble) {
     859            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     860            returnFormat = DataFormatInteger;
     861            return allocate();
     862        }
     863       
    859864        if (node->hasConstant()) {
    860865            ASSERT(isInt32Constant(node));
     
    914919    case DataFormatJSCell:
    915920    case DataFormatJSBoolean:
     921        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     922        returnFormat = DataFormatInteger;
     923        return allocate();
     924
    916925    case DataFormatStorage:
    917         RELEASE_ASSERT_NOT_REACHED();
    918 
    919926    default:
    920927        RELEASE_ASSERT_NOT_REACHED();
     
    960967                info.fillDouble(*m_stream, fpr);
    961968                return fpr;
    962             } else
    963                 RELEASE_ASSERT_NOT_REACHED();
     969            } else {
     970                terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     971                return fprAllocate();
     972            }
    964973        } else {
    965974            DataFormat spillFormat = info.spillFormat();
     
    10531062    case DataFormatNone:
    10541063    case DataFormatStorage:
     1064        RELEASE_ASSERT_NOT_REACHED();
     1065
    10551066    case DataFormatCell:
    10561067    case DataFormatJSCell:
    10571068    case DataFormatBoolean:
    10581069    case DataFormatJSBoolean:
    1059         RELEASE_ASSERT_NOT_REACHED();
     1070        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     1071        return fprAllocate();
    10601072
    10611073    default:
     
    10791091        if (node->hasConstant()) {
    10801092            JSValue jsValue = valueOfJSConstant(node);
    1081             ASSERT(jsValue.isCell());
    10821093            GPRReg gpr = allocate();
    1083             m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    1084             m_jit.move(MacroAssembler::TrustedImmPtr(jsValue.asCell()), gpr);
    1085             info.fillCell(*m_stream, gpr);
     1094            if (jsValue.isCell()) {
     1095                m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
     1096                m_jit.move(MacroAssembler::TrustedImmPtr(jsValue.asCell()), gpr);
     1097                info.fillCell(*m_stream, gpr);
     1098                return gpr;
     1099            }
     1100            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
    10861101            return gpr;
    10871102        }
     
    11251140    case DataFormatJSBoolean:
    11261141    case DataFormatBoolean:
     1142        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     1143        return allocate();
     1144
    11271145    case DataFormatStorage:
    11281146        RELEASE_ASSERT_NOT_REACHED();
     
    11421160    VirtualRegister virtualRegister = node->virtualRegister();
    11431161    GenerationInfo& info = m_generationInfo[virtualRegister];
    1144     if ((node->hasConstant() && !valueOfJSConstant(node).isBoolean())
    1145         || !(info.isJSBoolean() || info.isUnknownJS())) {
    1146         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
    1147         return allocate();
    1148     }
    11491162
    11501163    switch (info.registerFormat()) {
    11511164    case DataFormatNone: {
    1152 
     1165        if (info.spillFormat() == DataFormatInteger || info.spillFormat() == DataFormatDouble) {
     1166            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     1167            return allocate();
     1168        }
     1169       
    11531170        if (node->hasConstant()) {
    11541171            JSValue jsValue = valueOfJSConstant(node);
    1155             ASSERT(jsValue.isBoolean());
    11561172            GPRReg gpr = allocate();
    1157             m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    1158             m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr);
    1159             info.fillBoolean(*m_stream, gpr);
     1173            if (jsValue.isBoolean()) {
     1174                m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
     1175                m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr);
     1176                info.fillBoolean(*m_stream, gpr);
     1177                return gpr;
     1178            }
     1179            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
    11601180            return gpr;
    11611181        }
     
    12021222    case DataFormatJSCell:
    12031223    case DataFormatCell:
     1224        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0, direction);
     1225        return allocate();
     1226
    12041227    case DataFormatStorage:
    12051228        RELEASE_ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.