⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185705 in webkit


Ignore:
Timestamp:
Jun 18, 2015, 10:39:52 AM (11 years ago)
Author:
bshafiei@apple.com
Message:

Roll out patch for r182827.

Location:
branches/safari-600.7-branch/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-600.7-branch/Source/JavaScriptCore/ChangeLog

    r184580 r185705  
     12015-06-18  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Roll out patch for r182827.
     4
    152015-05-19  Babak Shafiei  <bshafiei@apple.com>
    26
  • branches/safari-600.7-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r184580 r185705  
    732732    SpeculatedType type = value.m_type;
    733733    ASSERT(edge.useKind() != KnownInt32Use || !(value.m_type & ~SpecInt32));
    734 
    735     if (m_interpreter.filter(value, SpecInt32) == Contradiction) {
     734    m_interpreter.filter(value, SpecInt32);
     735    VirtualRegister virtualRegister = edge->virtualRegister();
     736    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     737
     738    if (edge->hasConstant() && !isInt32Constant(edge.node())) {
    736739        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    737740        returnFormat = DataFormatInt32;
    738741        return allocate();
    739742    }
    740 
    741     VirtualRegister virtualRegister = edge->virtualRegister();
    742     GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    743 
     743   
    744744    switch (info.registerFormat()) {
    745745    case DataFormatNone: {
     
    755755
    756756        DataFormat spillFormat = info.spillFormat();
    757 
    758757        ASSERT_UNUSED(spillFormat, (spillFormat & DataFormatJS) || spillFormat == DataFormatInt32);
    759758
     
    801800    case DataFormatJSCell:
    802801    case DataFormatJSBoolean:
     802        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     803        returnFormat = DataFormatInt32;
     804        return allocate();
     805
    803806    case DataFormatDouble:
    804807    case DataFormatStorage:
     
    859862    SpeculatedType type = value.m_type;
    860863    ASSERT((edge.useKind() != KnownCellUse && edge.useKind() != KnownStringUse) || !(value.m_type & ~SpecCell));
    861 
    862     if (m_interpreter.filter(value, SpecCell) == Contradiction) {
    863         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    864         return allocate();
    865     }
    866 
     864    m_interpreter.filter(value, SpecCell);
    867865    VirtualRegister virtualRegister = edge->virtualRegister();
    868866    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     
    870868    switch (info.registerFormat()) {
    871869    case DataFormatNone: {
     870        if (info.spillFormat() == DataFormatInt32) {
     871            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     872            return allocate();
     873        }
     874
    872875        if (edge->hasConstant()) {
    873876            JSValue jsValue = valueOfJSConstant(edge.node());
     
    931934    case DataFormatJSBoolean:
    932935    case DataFormatBoolean:
     936        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     937        return allocate();
     938
    933939    case DataFormatDouble:
    934940    case DataFormatStorage:
     
    945951    AbstractValue& value = m_state.forNode(edge);
    946952    SpeculatedType type = value.m_type;
    947 
    948     if (m_interpreter.filter(value, SpecBoolean) == Contradiction) {
    949         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    950         return allocate();
    951     }
    952 
     953    m_interpreter.filter(value, SpecBoolean);
    953954    VirtualRegister virtualRegister = edge->virtualRegister();
    954955    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     
    956957    switch (info.registerFormat()) {
    957958    case DataFormatNone: {
     959        if (info.spillFormat() == DataFormatInt32) {
     960            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     961            return allocate();
     962        }
     963       
    958964        if (edge->hasConstant()) {
    959965            JSValue jsValue = valueOfJSConstant(edge.node());
    960966            GPRReg gpr = allocate();
    961             m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    962             m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr);
    963             info.fillBoolean(*m_stream, gpr);
     967            if (jsValue.isBoolean()) {
     968                m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
     969                m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr);
     970                info.fillBoolean(*m_stream, gpr);
     971                return gpr;
     972            }
     973            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    964974            return gpr;
    965975        }
     
    10051015    case DataFormatJSCell:
    10061016    case DataFormatCell:
     1017        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1018        return allocate();
     1019
    10071020    case DataFormatDouble:
    10081021    case DataFormatStorage:
  • branches/safari-600.7-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r184580 r185705  
    722722    SpeculatedType type = value.m_type;
    723723    ASSERT(edge.useKind() != KnownInt32Use || !(value.m_type & ~SpecInt32));
    724 
    725     if (m_interpreter.filter(value, SpecInt32) == Contradiction) {
     724    m_interpreter.filter(value, SpecInt32);
     725    VirtualRegister virtualRegister = edge->virtualRegister();
     726    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     727
     728    if (edge->hasConstant() && !isInt32Constant(edge.node())) {
     729        // Protect the silent spill/fill logic by failing early. If we "speculate" on
     730        // the constant then the silent filler may think that we have an int32 and a
     731        // constant, so it will try to fill this as an int32 constant. Bad things will
     732        // happen.
    726733        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    727734        returnFormat = DataFormatInt32;
    728735        return allocate();
    729736    }
    730 
    731     VirtualRegister virtualRegister = edge->virtualRegister();
    732     GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    733 
     737   
    734738    switch (info.registerFormat()) {
    735739    case DataFormatNone: {
     
    830834    case DataFormatBoolean:
    831835    case DataFormatJSCell:
    832     case DataFormatJSBoolean:
     836    case DataFormatJSBoolean: {
     837        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     838        returnFormat = DataFormatInt32;
     839        return allocate();
     840    }
     841
    833842    case DataFormatDouble:
    834843    case DataFormatStorage:
     
    863872    ASSERT(desiredFormat == DataFormatInt52 || desiredFormat == DataFormatStrictInt52);
    864873    AbstractValue& value = m_state.forNode(edge);
    865 
    866     if (m_interpreter.filter(value, SpecMachineInt) == Contradiction) {
    867         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    868         return allocate();
    869     }
    870 
     874    m_interpreter.filter(value, SpecMachineInt);
    871875    VirtualRegister virtualRegister = edge->virtualRegister();
    872876    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     
    874878    switch (info.registerFormat()) {
    875879    case DataFormatNone: {
     880        if ((edge->hasConstant() && !valueOfJSConstant(edge.node()).isMachineInt())) {
     881            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     882            return allocate();
     883        }
     884       
    876885        GPRReg gpr = allocate();
    877886
     
    9921001    SpeculatedType type = value.m_type;
    9931002    ASSERT((edge.useKind() != KnownCellUse && edge.useKind() != KnownStringUse) || !(value.m_type & ~SpecCell));
    994 
    995     if (m_interpreter.filter(value, SpecCell) == Contradiction) {
    996         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    997         return allocate();
    998     }
    999 
     1003    m_interpreter.filter(value, SpecCell);
    10001004    VirtualRegister virtualRegister = edge->virtualRegister();
    10011005    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     
    10161020            return gpr;
    10171021        }
    1018 
     1022       
     1023        if (!(info.spillFormat() & DataFormatJS)) {
     1024            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1025            return gpr;
     1026        }
     1027       
    10191028        m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    10201029        m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    10521061    case DataFormatJSDouble:
    10531062    case DataFormatJSBoolean:
    1054     case DataFormatBoolean:
     1063    case DataFormatBoolean: {
     1064        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1065        return allocate();
     1066    }
     1067
    10551068    case DataFormatDouble:
    10561069    case DataFormatStorage:
     
    10691082    AbstractValue& value = m_state.forNode(edge);
    10701083    SpeculatedType type = value.m_type;
    1071 
    1072     if (m_interpreter.filter(value, SpecBoolean) == Contradiction) {
    1073         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    1074         return allocate();
    1075     }
    1076 
     1084    m_interpreter.filter(value, SpecBoolean);
    10771085    VirtualRegister virtualRegister = edge->virtualRegister();
    10781086    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     
    10801088    switch (info.registerFormat()) {
    10811089    case DataFormatNone: {
     1090        if (info.spillFormat() == DataFormatInt32) {
     1091            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1092            return allocate();
     1093        }
     1094       
    10821095        GPRReg gpr = allocate();
    10831096
    10841097        if (edge->hasConstant()) {
    10851098            JSValue jsValue = valueOfJSConstant(edge.node());
    1086             m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    1087             m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
    1088             info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
     1099            if (jsValue.isBoolean()) {
     1100                m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
     1101                m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
     1102                info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
     1103                return gpr;
     1104            }
     1105            terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    10891106            return gpr;
    10901107        }
     
    11271144    case DataFormatJSCell:
    11281145    case DataFormatCell:
     1146        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
     1147        return allocate();
     1148       
    11291149    case DataFormatDouble:
    11301150    case DataFormatStorage:
Note: See TracChangeset for help on using the changeset viewer.