Changeset 103255 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Dec 19, 2011, 12:22:31 PM (13 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r103250.
http://trac.webkit.org/changeset/103250
https://bugs.webkit.org/show_bug.cgi?id=74877

it still breaks codegen (Requested by olliej on #webkit).

Patch by Sheriff Bot <[email protected]> on 2011-12-19

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGNode.h:
  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::propagateArithNodeFlags):
(JSC::DFG::Propagator::fixupNode):
(JSC::DFG::Propagator::byValIsPure):
(JSC::DFG::Propagator::clobbersWorld):
(JSC::DFG::Propagator::getByValLoadElimination):
(JSC::DFG::Propagator::checkStructureLoadElimination):
(JSC::DFG::Propagator::getByOffsetLoadElimination):
(JSC::DFG::Propagator::getPropertyStorageLoadElimination):
(JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination):
(JSC::DFG::Propagator::performNodeCSE):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

Location:
trunk/Source/JavaScriptCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r103250 r103255  
     12011-12-19  Sheriff Bot  <[email protected]>
     2
     3        Unreviewed, rolling out r103250.
     4        http://trac.webkit.org/changeset/103250
     5        https://bugs.webkit.org/show_bug.cgi?id=74877
     6
     7        it still breaks codegen (Requested by olliej on #webkit).
     8
     9        * dfg/DFGAbstractState.cpp:
     10        (JSC::DFG::AbstractState::execute):
     11        * dfg/DFGByteCodeParser.cpp:
     12        (JSC::DFG::ByteCodeParser::parseBlock):
     13        * dfg/DFGNode.h:
     14        * dfg/DFGPropagator.cpp:
     15        (JSC::DFG::Propagator::propagateArithNodeFlags):
     16        (JSC::DFG::Propagator::fixupNode):
     17        (JSC::DFG::Propagator::byValIsPure):
     18        (JSC::DFG::Propagator::clobbersWorld):
     19        (JSC::DFG::Propagator::getByValLoadElimination):
     20        (JSC::DFG::Propagator::checkStructureLoadElimination):
     21        (JSC::DFG::Propagator::getByOffsetLoadElimination):
     22        (JSC::DFG::Propagator::getPropertyStorageLoadElimination):
     23        (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination):
     24        (JSC::DFG::Propagator::performNodeCSE):
     25        * dfg/DFGSpeculativeJIT.cpp:
     26        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
     27        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
     28        (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
     29        * dfg/DFGSpeculativeJIT.h:
     30        * dfg/DFGSpeculativeJIT32_64.cpp:
     31        (JSC::DFG::SpeculativeJIT::compile):
     32        * dfg/DFGSpeculativeJIT64.cpp:
     33        (JSC::DFG::SpeculativeJIT::compile):
     34
    1352011-12-16  Oliver Hunt  <[email protected]>
    236
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractState.cpp

    r103250 r103255  
    494494    case PutByVal:
    495495    case PutByValAlias: {
    496         NodeIndex child1 = m_graph.m_varArgChildren[node.firstChild()];
    497         NodeIndex child2 = m_graph.m_varArgChildren[node.firstChild() + 1];
    498         NodeIndex child3 = m_graph.m_varArgChildren[node.firstChild() + 2];
    499         PredictedType indexPrediction = m_graph[child2].prediction();
     496        PredictedType indexPrediction = m_graph[node.child2()].prediction();
    500497        if (!(indexPrediction & PredictInt32) && indexPrediction) {
    501498            clobberStructures(nodeIndex);
     
    503500            break;
    504501        }
    505         if (m_graph[child1].shouldSpeculateByteArray()) {
    506             forNode(child1).filter(PredictByteArray);
    507             forNode(child2).filter(PredictInt32);
    508             forNode(child3).filter(PredictNumber);
    509             break;
    510         }
    511        
    512         if (m_graph[child1].shouldSpeculateInt8Array()) {
    513             forNode(child1).filter(PredictInt8Array);
    514             forNode(child2).filter(PredictInt32);
    515             forNode(child3).filter(PredictNumber);
    516             break;
    517         }
    518         if (m_graph[child1].shouldSpeculateInt16Array()) {
    519             forNode(child1).filter(PredictInt16Array);
    520             forNode(child2).filter(PredictInt32);
    521             forNode(child3).filter(PredictNumber);
    522             break;
    523         }
    524         if (m_graph[child1].shouldSpeculateInt32Array()) {
    525             forNode(child1).filter(PredictInt32Array);
    526             forNode(child2).filter(PredictInt32);
    527             forNode(child3).filter(PredictNumber);
    528             break;
    529         }
    530         if (m_graph[child1].shouldSpeculateUint8Array()) {
    531             forNode(child1).filter(PredictUint8Array);
    532             forNode(child2).filter(PredictInt32);
    533             forNode(child3).filter(PredictNumber);
    534             break;
    535         }
    536         if (m_graph[child1].shouldSpeculateUint16Array()) {
    537             forNode(child1).filter(PredictUint16Array);
    538             forNode(child2).filter(PredictInt32);
    539             forNode(child3).filter(PredictNumber);
    540             break;
    541         }
    542         if (m_graph[child1].shouldSpeculateUint32Array()) {
    543             forNode(child1).filter(PredictUint32Array);
    544             forNode(child2).filter(PredictInt32);
    545             forNode(child3).filter(PredictNumber);
    546             break;
    547         }
    548         if (m_graph[child1].shouldSpeculateFloat32Array()) {
    549             forNode(child1).filter(PredictFloat32Array);
    550             forNode(child2).filter(PredictInt32);
    551             forNode(child3).filter(PredictNumber);
    552             break;
    553         }
    554         if (m_graph[child1].shouldSpeculateFloat64Array()) {
    555             forNode(child1).filter(PredictFloat64Array);
    556             forNode(child2).filter(PredictInt32);
    557             forNode(child3).filter(PredictNumber);
    558             break;
    559         }
    560            
    561         forNode(child1).filter(PredictArray);
    562         forNode(child2).filter(PredictInt32);
     502        if (m_graph[node.child1()].shouldSpeculateByteArray()) {
     503            forNode(node.child1()).filter(PredictByteArray);
     504            forNode(node.child2()).filter(PredictInt32);
     505            forNode(node.child3()).filter(PredictNumber);
     506            break;
     507        }
     508       
     509        if (m_graph[node.child1()].shouldSpeculateInt8Array()) {
     510            forNode(node.child1()).filter(PredictInt8Array);
     511            forNode(node.child2()).filter(PredictInt32);
     512            forNode(node.child3()).filter(PredictNumber);
     513            break;
     514        }
     515        if (m_graph[node.child1()].shouldSpeculateInt16Array()) {
     516            forNode(node.child1()).filter(PredictInt16Array);
     517            forNode(node.child2()).filter(PredictInt32);
     518            forNode(node.child3()).filter(PredictNumber);
     519            break;
     520        }
     521        if (m_graph[node.child1()].shouldSpeculateInt32Array()) {
     522            forNode(node.child1()).filter(PredictInt32Array);
     523            forNode(node.child2()).filter(PredictInt32);
     524            forNode(node.child3()).filter(PredictNumber);
     525            break;
     526        }
     527        if (m_graph[node.child1()].shouldSpeculateUint8Array()) {
     528            forNode(node.child1()).filter(PredictUint8Array);
     529            forNode(node.child2()).filter(PredictInt32);
     530            forNode(node.child3()).filter(PredictNumber);
     531            break;
     532        }
     533        if (m_graph[node.child1()].shouldSpeculateUint16Array()) {
     534            forNode(node.child1()).filter(PredictUint16Array);
     535            forNode(node.child2()).filter(PredictInt32);
     536            forNode(node.child3()).filter(PredictNumber);
     537            break;
     538        }
     539        if (m_graph[node.child1()].shouldSpeculateUint32Array()) {
     540            forNode(node.child1()).filter(PredictUint32Array);
     541            forNode(node.child2()).filter(PredictInt32);
     542            forNode(node.child3()).filter(PredictNumber);
     543            break;
     544        }
     545        if (m_graph[node.child1()].shouldSpeculateFloat32Array()) {
     546            forNode(node.child1()).filter(PredictFloat32Array);
     547            forNode(node.child2()).filter(PredictInt32);
     548            forNode(node.child3()).filter(PredictNumber);
     549            break;
     550        }
     551        if (m_graph[node.child1()].shouldSpeculateFloat64Array()) {
     552            forNode(node.child1()).filter(PredictFloat64Array);
     553            forNode(node.child2()).filter(PredictInt32);
     554            forNode(node.child3()).filter(PredictNumber);
     555            break;
     556        }
     557           
     558        forNode(node.child1()).filter(PredictArray);
     559        forNode(node.child2()).filter(PredictInt32);
    563560        break;
    564561    }
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r103250 r103255  
    16631663            NodeIndex property = get(currentInstruction[2].u.operand);
    16641664            NodeIndex value = get(currentInstruction[3].u.operand);
    1665             NodeIndex propertyStorage = addToGraph(GetIndexedPropertyStorage, base, property);
    1666 
    1667             addVarArgChild(base);
    1668             addVarArgChild(property);
    1669             addVarArgChild(value);
    1670             addVarArgChild(propertyStorage);
    1671            
    1672             addToGraph(Node::VarArg, PutByVal, OpInfo(0), OpInfo(0));
     1665
     1666            addToGraph(PutByVal, base, property, value);
    16731667
    16741668            NEXT_OPCODE(op_put_by_val);
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r103250 r103255  
    227227    /* this must be the directly subsequent property put. */\
    228228    macro(GetByVal, NodeResultJS | NodeMustGenerate | NodeMightClobber) \
    229     macro(PutByVal, NodeMustGenerate | NodeClobbersWorld | NodeHasVarArgs) \
    230     macro(PutByValAlias, NodeMustGenerate | NodeClobbersWorld | NodeHasVarArgs) \
     229    macro(PutByVal, NodeMustGenerate | NodeClobbersWorld) \
     230    macro(PutByValAlias, NodeMustGenerate | NodeClobbersWorld) \
    231231    macro(GetById, NodeResultJS | NodeMustGenerate | NodeClobbersWorld) \
    232232    macro(PutById, NodeMustGenerate | NodeClobbersWorld) \
     
    235235    macro(PutStructure, NodeMustGenerate | NodeClobbersWorld) \
    236236    macro(GetPropertyStorage, NodeResultStorage) \
    237     macro(GetIndexedPropertyStorage, NodeResultStorage) \
     237    macro(GetIndexedPropertyStorage, NodeMustGenerate | NodeResultStorage) \
    238238    macro(GetByOffset, NodeResultJS) \
    239239    macro(PutByOffset, NodeMustGenerate | NodeClobbersWorld) \
  • trunk/Source/JavaScriptCore/dfg/DFGPropagator.cpp

    r103250 r103255  
    193193           
    194194        case PutByVal: {
    195             NodeIndex base = m_graph.m_varArgChildren[node.firstChild()];
    196             NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    197             NodeIndex value = m_graph.m_varArgChildren[node.firstChild() + 2];
    198             changed |= m_graph[base].mergeArithNodeFlags(flags | NodeUsedAsNumber | NodeNeedsNegZero);
    199             changed |= m_graph[property].mergeArithNodeFlags(flags | NodeUsedAsNumber);
    200             changed |= m_graph[value].mergeArithNodeFlags(flags | NodeUsedAsNumber | NodeNeedsNegZero);
     195            changed |= m_graph[node.child1()].mergeArithNodeFlags(flags | NodeUsedAsNumber | NodeNeedsNegZero);
     196            changed |= m_graph[node.child2()].mergeArithNodeFlags(flags | NodeUsedAsNumber);
     197            changed |= m_graph[node.child3()].mergeArithNodeFlags(flags | NodeUsedAsNumber | NodeNeedsNegZero);
    201198            break;
    202199        }
     
    934931            break;
    935932        }
    936         case PutByVal:
    937         case PutByValAlias: {
    938             NodeIndex storage = m_graph.m_varArgChildren[node.firstChild() + 3];
    939             if (m_graph[storage].op == Nop)
    940                 node.children.variable.numChildren = 3;
    941             break;
    942         }
    943            
    944933        case GetByVal:
    945934        case StringCharAt:
     
    10971086    }
    10981087   
    1099     bool byValIndexIsPure(Node& node)
    1100     {
    1101         PredictedType prediction = node.prediction();
     1088    bool byValIsPure(Node& node)
     1089    {
     1090        PredictedType prediction = m_graph[node.child2()].prediction();
    11021091        return (prediction & PredictInt32) || !prediction;
    11031092    }
     
    11211110            return !logicalNotIsPure(node);
    11221111        case GetByVal:
    1123             return !byValIndexIsPure(m_graph[node.child2()]);
     1112            return !byValIsPure(node);
    11241113        default:
    11251114            ASSERT_NOT_REACHED();
     
    11911180            switch (node.op) {
    11921181            case GetByVal:
    1193                 if (!byValIndexIsPure(m_graph[node.child2()]))
     1182                if (!byValIsPure(node))
    11941183                    return NoNode;
    11951184                if (node.child1() == child1 && canonicalize(node.child2()) == canonicalize(child2))
     
    11971186                break;
    11981187            case PutByVal:
    1199             case PutByValAlias: {
    1200                
    1201                 NodeIndex base = m_graph.m_varArgChildren[node.firstChild()];
    1202                     NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1203                 if (!byValIndexIsPure(m_graph[property]))
     1188            case PutByValAlias:
     1189                if (!byValIsPure(node))
    12041190                    return NoNode;
    1205                 if (base == child1 && canonicalize(property) == canonicalize(child2))
    1206                     return m_graph.m_varArgChildren[node.firstChild() + 2];
     1191                if (node.child1() == child1 && canonicalize(node.child2()) == canonicalize(child2))
     1192                    return node.child3();
    12071193                // We must assume that the PutByVal will clobber the location we're getting from.
    12081194                // FIXME: We can do better; if we know that the PutByVal is accessing an array of a
    12091195                // different type than the GetByVal, then we know that they won't clobber each other.
    12101196                return NoNode;
    1211             }
    12121197            case PutStructure:
    12131198            case PutByOffset:
     
    12651250               
    12661251            case PutByVal:
    1267             case PutByValAlias: {
    1268                 NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1269                 if (byValIndexIsPure(m_graph[property])) {
     1252            case PutByValAlias:
     1253                if (byValIsPure(node)) {
    12701254                    // If PutByVal speculates that it's accessing an array with an
    12711255                    // integer index, then it's impossible for it to cause a structure
     
    12741258                }
    12751259                return false;
    1276             }
    1277 
     1260               
    12781261            default:
    12791262                if (clobbersWorld(index))
     
    13101293               
    13111294            case PutByVal:
    1312             case PutByValAlias: {
    1313                 NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1314                 if (byValIndexIsPure(m_graph[property])) {
     1295            case PutByValAlias:
     1296                if (byValIsPure(node)) {
    13151297                    // If PutByVal speculates that it's accessing an array with an
    13161298                    // integer index, then it's impossible for it to cause a structure
     
    13191301                }
    13201302                return NoNode;
    1321             }
    1322 
     1303               
    13231304            default:
    13241305                if (clobbersWorld(index))
     
    13481329               
    13491330            case PutByVal:
    1350             case PutByValAlias: {
    1351                 NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1352                 if (byValIndexIsPure(m_graph[property])) {
     1331            case PutByValAlias:
     1332                if (byValIsPure(node)) {
    13531333                    // If PutByVal speculates that it's accessing an array with an
    13541334                    // integer index, then it's impossible for it to cause a structure
     
    13571337                }
    13581338                return NoNode;
    1359             }
    1360 
     1339               
    13611340            default:
    13621341                if (clobbersWorld(index))
     
    13681347    }
    13691348
    1370     NodeIndex getIndexedPropertyStorageLoadElimination(NodeIndex child1)
     1349    NodeIndex getIndexedPropertyStorageLoadElimination(NodeIndex child1, bool hasIntegerIndexPrediction)
    13711350    {
    13721351        NodeIndex start = startIndexForChildren(child1);
     
    13771356                PredictedType basePrediction = m_graph[node.child2()].prediction();
    13781357                bool nodeHasIntegerIndexPrediction = !(!(basePrediction & PredictInt32) && basePrediction);
    1379                 if (node.child1() == child1 && nodeHasIntegerIndexPrediction)
     1358                if (node.child1() == child1 && hasIntegerIndexPrediction == nodeHasIntegerIndexPrediction)
    13801359                    return index;
    13811360                break;
     
    13921371                break;
    13931372               
    1394             case PutByVal: {
    1395                 NodeIndex base = m_graph.m_varArgChildren[node.firstChild()];
    1396                 NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1397                 if (isFixedIndexedStorageObjectPrediction(m_graph[base].prediction()) && byValIndexIsPure(m_graph[property]))
     1373            case PutByVal:
     1374                if (isFixedIndexedStorageObjectPrediction(m_graph[node.child1()].prediction()) && byValIsPure(node))
    13981375                    break;
    13991376                return NoNode;
    1400             }
    14011377
    14021378            default:
     
    15791555           
    15801556        case GetByVal:
    1581             if (byValIndexIsPure(m_graph[node.child2()]))
     1557            if (byValIsPure(node))
    15821558                setReplacement(getByValLoadElimination(node.child1(), node.child2()));
    15831559            break;
    15841560           
    1585         case PutByVal: {
    1586             NodeIndex base = m_graph.m_varArgChildren[node.firstChild()];
    1587             NodeIndex property = m_graph.m_varArgChildren[node.firstChild() + 1];
    1588             if (byValIndexIsPure(m_graph[property]) && getByValLoadElimination(base, property) != NoNode)
     1561        case PutByVal:
     1562            if (byValIsPure(node) && getByValLoadElimination(node.child1(), node.child2()) != NoNode)
    15891563                node.op = PutByValAlias;
    15901564            break;
    1591         }
    15921565           
    15931566        case CheckStructure:
     
    16041577            PredictedType basePrediction = m_graph[node.child2()].prediction();
    16051578            bool nodeHasIntegerIndexPrediction = !(!(basePrediction & PredictInt32) && basePrediction);
    1606             if (nodeHasIntegerIndexPrediction)
    1607                 setReplacement(getIndexedPropertyStorageLoadElimination(node.child1()));
     1579            setReplacement(getIndexedPropertyStorageLoadElimination(node.child1(), nodeHasIntegerIndexPrediction));
    16081580            break;
    16091581        }
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r103250 r103255  
    15541554}
    15551555
    1556 void SpeculativeJIT::compilePutByValForByteArray(Node& node)
    1557 {
    1558     NodeIndex baseIndex = m_jit.graph().m_varArgChildren[node.firstChild()];
    1559     NodeIndex propertyIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    1560     NodeIndex valueIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    1561     NodeIndex storageIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    1562    
    1563     if (!isByteArrayPrediction(m_state.forNode(baseIndex).m_type)) {
    1564         SpeculateCellOperand base(this, baseIndex);
    1565         speculationCheck(BadType, JSValueSource::unboxedCell(base.gpr()), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base.gpr(), JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSByteArray::s_info)));
    1566     }
     1556void SpeculativeJIT::compilePutByValForByteArray(GPRReg base, GPRReg property, Node& node)
     1557{
     1558    NodeIndex baseIndex = node.child1();
     1559    NodeIndex valueIndex = node.child3();
     1560   
     1561    if (!isByteArrayPrediction(m_state.forNode(baseIndex).m_type))
     1562        speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSByteArray::s_info)));
    15671563    GPRTemporary value;
    15681564    GPRReg valueGPR;
     
    16111607        valueGPR = gpr;
    16121608    }
    1613     StorageOperand storage(this, storageIndex);
    1614     SpeculateIntegerOperand property(this, propertyIndex);
     1609    ASSERT_UNUSED(valueGPR, valueGPR != property);
     1610    ASSERT(valueGPR != base);
     1611    GPRTemporary storage(this);
    16151612    GPRReg storageReg = storage.gpr();
    1616     MacroAssembler::Jump outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, property.gpr(), MacroAssembler::Address(storageReg, ByteArray::offsetOfSize()));
    1617     m_jit.store8(value.gpr(), MacroAssembler::BaseIndex(storageReg, property.gpr(), MacroAssembler::TimesOne, ByteArray::offsetOfData()));
     1613    ASSERT(valueGPR != storageReg);
     1614    m_jit.loadPtr(MacroAssembler::Address(base, JSByteArray::offsetOfStorage()), storageReg);
     1615    MacroAssembler::Jump outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, property, MacroAssembler::Address(storageReg, ByteArray::offsetOfSize()));
     1616    m_jit.store8(value.gpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesOne, ByteArray::offsetOfData()));
    16181617    outOfBounds.link(&m_jit);
    16191618    noResult(m_compileIndex);
     
    17121711}
    17131712
    1714 void SpeculativeJIT::compilePutByValForIntTypedArray(const TypedArrayDescriptor& descriptor, Node& node, size_t elementSize, TypedArraySpeculationRequirements speculationRequirements, TypedArraySignedness signedness)
    1715 {
    1716     NodeIndex baseIndex = m_jit.graph().m_varArgChildren[node.firstChild()];
    1717     NodeIndex propertyIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    1718     NodeIndex valueIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    1719     NodeIndex storageIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    1720 
    1721     if (speculationRequirements != NoTypedArrayTypeSpecCheck) {
    1722         SpeculateCellOperand base(this, baseIndex);
    1723         speculationCheck(BadType, JSValueSource::unboxedCell(base.gpr()), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base.gpr()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
    1724     }
    1725    
    1726     StorageOperand storage(this, storageIndex);
    1727     GPRReg storageReg = storage.gpr();
    1728     SpeculateIntegerOperand property(this, propertyIndex);
    1729     GPRReg propertyReg = property.gpr();
    1730     MacroAssembler::Jump outOfBounds;
    1731     if (speculationRequirements != NoTypedArrayTypeSpecCheck || speculationRequirements != NoTypedArraySpecCheck) {
    1732         SpeculateCellOperand base(this, baseIndex);
    1733         if (speculationRequirements != NoTypedArrayTypeSpecCheck)
    1734             speculationCheck(BadType, JSValueSource::unboxedCell(base.gpr()), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base.gpr(), JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
    1735         if (speculationRequirements != NoTypedArraySpecCheck)
    1736             outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(base.gpr(), descriptor.m_lengthOffset));
    1737     }
     1713void SpeculativeJIT::compilePutByValForIntTypedArray(const TypedArrayDescriptor& descriptor, GPRReg base, GPRReg property, Node& node, size_t elementSize, TypedArraySpeculationRequirements speculationRequirements, TypedArraySignedness signedness)
     1714{
     1715    NodeIndex baseIndex = node.child1();
     1716    NodeIndex valueIndex = node.child3();
     1717   
     1718    if (speculationRequirements != NoTypedArrayTypeSpecCheck)
     1719        speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
    17381720    GPRTemporary value;
    17391721    GPRReg valueGPR;
     
    17771759        valueGPR = gpr;
    17781760    }
     1761    ASSERT_UNUSED(valueGPR, valueGPR != property);
     1762    ASSERT(valueGPR != base);
     1763    GPRTemporary storage(this);
     1764    GPRReg storageReg = storage.gpr();
     1765    ASSERT(valueGPR != storageReg);
     1766    m_jit.loadPtr(MacroAssembler::Address(base, descriptor.m_storageOffset), storageReg);
     1767    MacroAssembler::Jump outOfBounds;
     1768    if (speculationRequirements != NoTypedArraySpecCheck)
     1769        outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, property, MacroAssembler::Address(base, descriptor.m_lengthOffset));
    17791770
    17801771    switch (elementSize) {
    17811772    case 1:
    1782         m_jit.store8(value.gpr(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesOne));
     1773        m_jit.store8(value.gpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesOne));
    17831774        break;
    17841775    case 2:
    1785         m_jit.store16(value.gpr(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesTwo));
     1776        m_jit.store16(value.gpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesTwo));
    17861777        break;
    17871778    case 4:
    1788         m_jit.store32(value.gpr(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesFour));
     1779        m_jit.store32(value.gpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesFour));
    17891780        break;
    17901781    default:
     
    18411832}
    18421833
    1843 void SpeculativeJIT::compilePutByValForFloatTypedArray(const TypedArrayDescriptor& descriptor, Node& node, size_t elementSize, TypedArraySpeculationRequirements speculationRequirements)
    1844 {
    1845     NodeIndex baseIndex = m_jit.graph().m_varArgChildren[node.firstChild()];
    1846     NodeIndex propertyIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    1847     NodeIndex valueIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    1848     NodeIndex storageIndex = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
     1834void SpeculativeJIT::compilePutByValForFloatTypedArray(const TypedArrayDescriptor& descriptor, GPRReg base, GPRReg property, Node& node, size_t elementSize, TypedArraySpeculationRequirements speculationRequirements)
     1835{
     1836    NodeIndex baseIndex = node.child1();
     1837    NodeIndex valueIndex = node.child3();
    18491838   
    18501839    SpeculateDoubleOperand valueOp(this, valueIndex);
    1851     SpeculateStrictInt32Operand property(this, propertyIndex);
    1852     StorageOperand storage(this, storageIndex);
     1840   
     1841    if (speculationRequirements != NoTypedArrayTypeSpecCheck)
     1842        speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
     1843   
     1844    GPRTemporary result(this);
     1845   
     1846    GPRTemporary storage(this);
    18531847    GPRReg storageReg = storage.gpr();
    1854     GPRReg propertyReg = property.gpr();
    1855    
     1848   
     1849    m_jit.loadPtr(MacroAssembler::Address(base, descriptor.m_storageOffset), storageReg);
    18561850    MacroAssembler::Jump outOfBounds;
    1857     if (speculationRequirements != NoTypedArrayTypeSpecCheck || speculationRequirements != NoTypedArraySpecCheck) {
    1858         SpeculateCellOperand base(this, baseIndex);
    1859         if (speculationRequirements != NoTypedArrayTypeSpecCheck)
    1860             speculationCheck(BadType, JSValueSource::unboxedCell(base.gpr()), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base.gpr(), JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(descriptor.m_classInfo)));
    1861         if (speculationRequirements != NoTypedArraySpecCheck)
    1862             outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(base.gpr(), descriptor.m_lengthOffset));
    1863     }
    1864    
    1865 
     1851    if (speculationRequirements != NoTypedArraySpecCheck)
     1852        outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, property, MacroAssembler::Address(base, descriptor.m_lengthOffset));
    18661853   
    18671854    switch (elementSize) {
     
    18701857        m_jit.moveDouble(valueOp.fpr(), scratch.fpr());
    18711858        m_jit.convertDoubleToFloat(valueOp.fpr(), scratch.fpr());
    1872         m_jit.storeFloat(scratch.fpr(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesFour));
     1859        m_jit.storeFloat(scratch.fpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesFour));
    18731860        break;
    18741861    }
    18751862    case 8:
    1876         m_jit.storeDouble(valueOp.fpr(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight));
     1863        m_jit.storeDouble(valueOp.fpr(), MacroAssembler::BaseIndex(storageReg, property, MacroAssembler::TimesEight));
    18771864        break;
    18781865    default:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r103250 r103255  
    19711971    void compileUInt32ToNumber(Node&);
    19721972    void compileGetByValOnByteArray(Node&);
    1973     void compilePutByValForByteArray(Node&);
     1973    void compilePutByValForByteArray(GPRReg base, GPRReg property, Node&);
    19741974    void compileArithMul(Node&);
    19751975    void compileArithMod(Node&);
     
    19871987    void compileGetIndexedPropertyStorage(Node&);
    19881988    void compileGetByValOnIntTypedArray(const TypedArrayDescriptor&, Node&, size_t elementSize, TypedArraySpeculationRequirements, TypedArraySignedness);
    1989     void compilePutByValForIntTypedArray(const TypedArrayDescriptor&, Node&, size_t elementSize, TypedArraySpeculationRequirements, TypedArraySignedness);
     1989    void compilePutByValForIntTypedArray(const TypedArrayDescriptor&, GPRReg base, GPRReg property, Node&, size_t elementSize, TypedArraySpeculationRequirements, TypedArraySignedness);
    19901990    void compileGetByValOnFloatTypedArray(const TypedArrayDescriptor&, Node&, size_t elementSize, TypedArraySpeculationRequirements);
    1991     void compilePutByValForFloatTypedArray(const TypedArrayDescriptor&, Node&, size_t elementSize, TypedArraySpeculationRequirements);
     1991    void compilePutByValForFloatTypedArray(const TypedArrayDescriptor&, GPRReg base, GPRReg property, Node&, size_t elementSize, TypedArraySpeculationRequirements);
    19921992   
    19931993    // It is acceptable to have structure be equal to scratch, so long as you're fine
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r103250 r103255  
    26942694
    26952695    case PutByVal: {
    2696         NodeIndex child1 = m_jit.graph().m_varArgChildren[node.firstChild()];
    2697         NodeIndex child2 = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    2698         NodeIndex child3 = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    2699         NodeIndex child4 = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    2700 
    2701         PredictedType basePrediction = at(child2).prediction();
     2696        PredictedType basePrediction = at(node.child2()).prediction();
    27022697        if (!(basePrediction & PredictInt32) && basePrediction) {
    2703             SpeculateCellOperand base(this, child1); // Save a register, speculate cell. We'll probably be right.
    2704             JSValueOperand property(this, child2);
    2705             JSValueOperand value(this, child3);
     2698            SpeculateCellOperand base(this, node.child1()); // Save a register, speculate cell. We'll probably be right.
     2699            JSValueOperand property(this, node.child2());
     2700            JSValueOperand value(this, node.child3());
    27062701            GPRReg baseGPR = base.gpr();
    27072702            GPRReg propertyTagGPR = property.tagGPR();
     
    27172712        }
    27182713
    2719         if (at(child1).shouldSpeculateByteArray()) {
    2720             compilePutByValForByteArray(node);
     2714        SpeculateCellOperand base(this, node.child1());
     2715        SpeculateStrictInt32Operand property(this, node.child2());
     2716        if (at(node.child1()).shouldSpeculateByteArray()) {
     2717            compilePutByValForByteArray(base.gpr(), property.gpr(), node);
    27212718            break;
    27222719        }
    2723        
    2724         if (at(child1).shouldSpeculateInt8Array()) {
    2725             compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), isInt8ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2720        if (at(node.child1()).shouldSpeculateByteArray()) {
     2721            compilePutByValForByteArray(base.gpr(), property.gpr(), node);
     2722            break;
     2723        }
     2724       
     2725        if (at(node.child1()).shouldSpeculateInt8Array()) {
     2726            compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), isInt8ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27262727            if (!m_compileOkay)
    27272728                return;
     
    27292730        }
    27302731       
    2731         if (at(child1).shouldSpeculateInt16Array()) {
    2732             compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), isInt16ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2732        if (at(node.child1()).shouldSpeculateInt16Array()) {
     2733            compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), isInt16ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27332734            if (!m_compileOkay)
    27342735                return;
     
    27362737        }
    27372738       
    2738         if (at(child1).shouldSpeculateInt32Array()) {
    2739             compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), isInt32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2739        if (at(node.child1()).shouldSpeculateInt32Array()) {
     2740            compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), isInt32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27402741            if (!m_compileOkay)
    27412742                return;
     
    27432744        }
    27442745       
    2745         if (at(child1).shouldSpeculateUint8Array()) {
    2746             compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), isUint8ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2746        if (at(node.child1()).shouldSpeculateUint8Array()) {
     2747            compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27472748            if (!m_compileOkay)
    27482749                return;
     
    27502751        }
    27512752       
    2752         if (at(child1).shouldSpeculateUint16Array()) {
    2753             compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), isUint16ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2753        if (at(node.child1()).shouldSpeculateUint16Array()) {
     2754            compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), isUint16ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27542755            if (!m_compileOkay)
    27552756                return;
     
    27572758        }
    27582759       
    2759         if (at(child1).shouldSpeculateUint32Array()) {
    2760             compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), isUint32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2760        if (at(node.child1()).shouldSpeculateUint32Array()) {
     2761            compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), isUint32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27612762            if (!m_compileOkay)
    27622763                return;
     
    27642765        }
    27652766       
    2766         if (at(child1).shouldSpeculateFloat32Array()) {
    2767             compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), isFloat32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
     2767        if (at(node.child1()).shouldSpeculateFloat32Array()) {
     2768            compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), isFloat32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
    27682769            if (!m_compileOkay)
    27692770                return;
     
    27712772        }
    27722773       
    2773         if (at(child1).shouldSpeculateFloat64Array()) {
    2774             compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), isFloat64ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
     2774        if (at(node.child1()).shouldSpeculateFloat64Array()) {
     2775            compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), isFloat64ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
    27752776            if (!m_compileOkay)
    27762777                return;
     
    27782779        }
    27792780
    2780         SpeculateCellOperand base(this, child1);
    2781         SpeculateStrictInt32Operand property(this, child2);
    2782         JSValueOperand value(this, child3);
     2781        JSValueOperand value(this, node.child3());
     2782        GPRTemporary scratch(this);
    27832783
    27842784        // Map base, property & value into registers, allocate a scratch register.
     
    27872787        GPRReg valueTagReg = value.tagGPR();
    27882788        GPRReg valuePayloadReg = value.payloadGPR();
     2789        GPRReg scratchReg = scratch.gpr();
    27892790       
    27902791        if (!m_compileOkay)
    27912792            return;
    2792 
    2793         {
    2794             GPRTemporary scratch(this);
    2795             writeBarrier(baseReg, valueTagReg, child3, WriteBarrierForPropertyAccess, scratch.gpr());
    2796         }
     2793       
     2794        writeBarrier(baseReg, valueTagReg, node.child3(), WriteBarrierForPropertyAccess, scratchReg);
    27972795
    27982796        // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
    27992797        // If we have predicted the base to be type array, we can skip the check.
    2800         if (!isArrayPrediction(m_state.forNode(child1).m_type))
    2801             speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), child1, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
    2802 
    2803         StorageOperand storage(this, child4);
    2804         GPRReg storageReg = storage.gpr();
     2798        if (!isArrayPrediction(m_state.forNode(node.child1()).m_type))
     2799            speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
    28052800
    28062801        base.use();
    28072802        property.use();
    28082803        value.use();
    2809         storage.use();
    28102804       
    28112805        MacroAssembler::Jump withinArrayBounds = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
    28122806
    28132807        // Code to handle put beyond array bounds.
    2814         silentSpillAllRegisters(InvalidGPRReg);
     2808        silentSpillAllRegisters(scratchReg);
    28152809        callOperation(operationPutByValBeyondArrayBounds, baseReg, propertyReg, valueTagReg, valuePayloadReg);
    2816         silentFillAllRegisters(InvalidGPRReg);
     2810        silentFillAllRegisters(scratchReg);
    28172811        JITCompiler::Jump wasBeyondArrayBounds = m_jit.jump();
    28182812
    28192813        withinArrayBounds.link(&m_jit);
     2814
     2815        // Get the array storage.
     2816        GPRReg storageReg = scratchReg;
     2817        m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
    28202818
    28212819        // Check if we're writing to a hole; if so increment m_numValuesInVector.
     
    28432841
    28442842    case PutByValAlias: {
    2845         NodeIndex child1 = m_jit.graph().m_varArgChildren[node.firstChild()];
    2846         NodeIndex child2 = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    2847         NodeIndex child3 = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    2848         NodeIndex child4 = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    2849 
    2850         if (at(child1).shouldSpeculateByteArray()) {
    2851             compilePutByValForByteArray(node);
     2843        SpeculateCellOperand base(this, node.child1());
     2844        SpeculateStrictInt32Operand property(this, node.child2());
     2845
     2846        if (at(node.child1()).shouldSpeculateByteArray()) {
     2847            compilePutByValForByteArray(base.gpr(), property.gpr(), node);
    28522848            break;
    28532849        }
    28542850       
    2855         if (at(child1).shouldSpeculateInt8Array()) {
    2856             compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), NoTypedArraySpecCheck, SignedTypedArray);
     2851        if (at(node.child1()).shouldSpeculateInt8Array()) {
     2852            compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), NoTypedArraySpecCheck, SignedTypedArray);
    28572853            if (!m_compileOkay)
    28582854                return;
     
    28602856        }
    28612857       
    2862         if (at(child1).shouldSpeculateInt16Array()) {
    2863             compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), NoTypedArraySpecCheck, SignedTypedArray);
     2858        if (at(node.child1()).shouldSpeculateInt16Array()) {
     2859            compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), NoTypedArraySpecCheck, SignedTypedArray);
    28642860            if (!m_compileOkay)
    28652861                return;
     
    28672863        }
    28682864       
    2869         if (at(child1).shouldSpeculateInt32Array()) {
    2870             compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), NoTypedArraySpecCheck, SignedTypedArray);
     2865        if (at(node.child1()).shouldSpeculateInt32Array()) {
     2866            compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), NoTypedArraySpecCheck, SignedTypedArray);
    28712867            if (!m_compileOkay)
    28722868                return;
     
    28742870        }
    28752871       
    2876         if (at(child1).shouldSpeculateUint8Array()) {
    2877             compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2872        if (at(node.child1()).shouldSpeculateUint8Array()) {
     2873            compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28782874            if (!m_compileOkay)
    28792875                return;
     
    28812877        }
    28822878       
    2883         if (at(child1).shouldSpeculateUint16Array()) {
    2884             compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2879        if (at(node.child1()).shouldSpeculateUint16Array()) {
     2880            compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28852881            if (!m_compileOkay)
    28862882                return;
     
    28882884        }
    28892885       
    2890         if (at(child1).shouldSpeculateUint32Array()) {
    2891             compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2886        if (at(node.child1()).shouldSpeculateUint32Array()) {
     2887            compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28922888            if (!m_compileOkay)
    28932889                return;
     
    28952891        }
    28962892       
    2897         if (at(child1).shouldSpeculateFloat32Array()) {
    2898             compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), NoTypedArraySpecCheck);
     2893        if (at(node.child1()).shouldSpeculateFloat32Array()) {
     2894            compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), NoTypedArraySpecCheck);
    28992895            if (!m_compileOkay)
    29002896                return;
     
    29022898        }
    29032899       
    2904         if (at(child1).shouldSpeculateFloat64Array()) {
    2905             compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), NoTypedArraySpecCheck);
     2900        if (at(node.child1()).shouldSpeculateFloat64Array()) {
     2901            compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), NoTypedArraySpecCheck);
    29062902            if (!m_compileOkay)
    29072903                return;
    29082904            break;           
    29092905        }
    2910        
    2911         JSValueOperand value(this, child3);
    2912         {
    2913             SpeculateCellOperand base(this, child1);
    2914             GPRTemporary scratch(this, base);
    2915             GPRReg baseReg = base.gpr();
    2916             GPRReg scratchReg = scratch.gpr();
    2917             writeBarrier(baseReg, value.tagGPR(), child3, WriteBarrierForPropertyAccess, scratchReg);
    2918         }
    2919    
    2920         SpeculateStrictInt32Operand property(this, child2);
    2921         StorageOperand storage(this, child4);
     2906
     2907        JSValueOperand value(this, node.child3());
     2908        GPRTemporary scratch(this, base);
     2909       
     2910        GPRReg baseReg = base.gpr();
     2911        GPRReg scratchReg = scratch.gpr();
     2912
     2913        writeBarrier(baseReg, value.tagGPR(), node.child3(), WriteBarrierForPropertyAccess, scratchReg);
     2914
     2915        // Get the array storage.
     2916        GPRReg storageReg = scratchReg;
     2917        m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
     2918
    29222919        // Store the value to the array.
    29232920        GPRReg propertyReg = property.gpr();
    2924         m_jit.store32(value.tagGPR(), MacroAssembler::BaseIndex(storage.gpr(), propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
    2925         m_jit.store32(value.payloadGPR(), MacroAssembler::BaseIndex(storage.gpr(), propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
     2921        m_jit.store32(value.tagGPR(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
     2922        m_jit.store32(value.payloadGPR(), MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
    29262923
    29272924        noResult(m_compileIndex);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r103250 r103255  
    25982598            break;
    25992599        }
    2600         ASSERT(node.child3() != NoNode);
     2600       
    26012601        if (at(node.child1()).prediction() == PredictString) {
    26022602            compileGetByValOnString(node);
     
    26962696
    26972697    case PutByVal: {
    2698         NodeIndex child1 = m_jit.graph().m_varArgChildren[node.firstChild()];
    2699         NodeIndex child2 = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    2700         NodeIndex child3 = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    2701 
    2702         PredictedType basePrediction = at(child2).prediction();
     2698        PredictedType basePrediction = at(node.child2()).prediction();
    27032699        if (!(basePrediction & PredictInt32) && basePrediction) {
    2704             JSValueOperand arg1(this, child1);
    2705             JSValueOperand arg2(this, child2);
    2706             JSValueOperand arg3(this, child3);
     2700            JSValueOperand arg1(this, node.child1());
     2701            JSValueOperand arg2(this, node.child2());
     2702            JSValueOperand arg3(this, node.child3());
    27072703            GPRReg arg1GPR = arg1.gpr();
    27082704            GPRReg arg2GPR = arg2.gpr();
     
    27162712        }
    27172713
    2718         if (at(child1).shouldSpeculateByteArray()) {
    2719             compilePutByValForByteArray(node);
     2714        SpeculateCellOperand base(this, node.child1());
     2715        SpeculateStrictInt32Operand property(this, node.child2());
     2716        if (at(node.child1()).shouldSpeculateByteArray()) {
     2717            compilePutByValForByteArray(base.gpr(), property.gpr(), node);
    27202718            break;
    27212719        }
    27222720       
    2723         if (at(child1).shouldSpeculateInt8Array()) {
    2724             compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), isInt8ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2721        if (at(node.child1()).shouldSpeculateInt8Array()) {
     2722            compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), isInt8ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27252723            if (!m_compileOkay)
    27262724                return;
     
    27282726        }
    27292727       
    2730         if (at(child1).shouldSpeculateInt16Array()) {
    2731             compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), isInt16ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2728        if (at(node.child1()).shouldSpeculateInt16Array()) {
     2729            compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), isInt16ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27322730            if (!m_compileOkay)
    27332731                return;
     
    27352733        }
    27362734
    2737         if (at(child1).shouldSpeculateInt32Array()) {
    2738             compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), isInt32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
     2735        if (at(node.child1()).shouldSpeculateInt32Array()) {
     2736            compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), isInt32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);
    27392737            if (!m_compileOkay)
    27402738                return;
     
    27422740        }
    27432741       
    2744         if (at(child1).shouldSpeculateUint8Array()) {
    2745             compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), isUint8ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2742        if (at(node.child1()).shouldSpeculateUint8Array()) {
     2743            compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27462744            if (!m_compileOkay)
    27472745                return;
     
    27492747        }
    27502748       
    2751         if (at(child1).shouldSpeculateUint16Array()) {
    2752             compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), isUint16ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2749        if (at(node.child1()).shouldSpeculateUint16Array()) {
     2750            compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), isUint16ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27532751            if (!m_compileOkay)
    27542752                return;
     
    27562754        }
    27572755       
    2758         if (at(child1).shouldSpeculateUint32Array()) {
    2759             compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), isUint32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
     2756        if (at(node.child1()).shouldSpeculateUint32Array()) {
     2757            compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), isUint32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);
    27602758            if (!m_compileOkay)
    27612759                return;
     
    27632761        }
    27642762       
    2765         if (at(child1).shouldSpeculateFloat32Array()) {
    2766             compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), isFloat32ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
     2763        if (at(node.child1()).shouldSpeculateFloat32Array()) {
     2764            compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), isFloat32ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
    27672765            if (!m_compileOkay)
    27682766                return;
     
    27702768        }
    27712769       
    2772         if (at(child1).shouldSpeculateFloat64Array()) {
    2773             compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), isFloat64ArrayPrediction(m_state.forNode(child1).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
     2770        if (at(node.child1()).shouldSpeculateFloat64Array()) {
     2771            compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), isFloat64ArrayPrediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);
    27742772            if (!m_compileOkay)
    27752773                return;
    27762774            break;           
    27772775        }
    2778        
    2779         SpeculateCellOperand base(this, child1);
    2780         SpeculateStrictInt32Operand property(this, child2);
    2781         JSValueOperand value(this, child3);
    2782         NodeIndex child4 = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    2783         StorageOperand storage(this, child4);
     2776
     2777        JSValueOperand value(this, node.child3());
    27842778        GPRTemporary scratch(this);
    2785        
     2779
    27862780        // Map base, property & value into registers, allocate a scratch register.
    27872781        GPRReg baseReg = base.gpr();
    27882782        GPRReg propertyReg = property.gpr();
    27892783        GPRReg valueReg = value.gpr();
    2790         GPRReg storageReg = storage.gpr();
    27912784        GPRReg scratchReg = scratch.gpr();
    27922785       
     
    27942787            return;
    27952788       
    2796         writeBarrier(baseReg, value.gpr(), child3, WriteBarrierForPropertyAccess, scratchReg);
     2789        writeBarrier(baseReg, value.gpr(), node.child3(), WriteBarrierForPropertyAccess, scratchReg);
    27972790
    27982791        // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
    27992792        // If we have predicted the base to be type array, we can skip the check.
    2800         if (!isArrayPrediction(m_state.forNode(child1).m_type))
    2801             speculationCheck(BadType, JSValueRegs(baseReg), child1, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
     2793        if (!isArrayPrediction(m_state.forNode(node.child1()).m_type))
     2794            speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
    28022795
    28032796        base.use();
    28042797        property.use();
    28052798        value.use();
    2806         storage.use();
    2807 
     2799       
    28082800        MacroAssembler::Jump withinArrayBounds = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
    28092801
     
    28162808        withinArrayBounds.link(&m_jit);
    28172809
     2810        // Get the array storage.
     2811        GPRReg storageReg = scratchReg;
     2812        m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
     2813
    28182814        // Check if we're writing to a hole; if so increment m_numValuesInVector.
    28192815        MacroAssembler::Jump notHoleValue = m_jit.branchTestPtr(MacroAssembler::NonZero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
     
    28392835
    28402836    case PutByValAlias: {
    2841         NodeIndex child1 = m_jit.graph().m_varArgChildren[node.firstChild()];
    2842         NodeIndex child2 = m_jit.graph().m_varArgChildren[node.firstChild() + 1];
    2843         NodeIndex child3 = m_jit.graph().m_varArgChildren[node.firstChild() + 2];
    2844         NodeIndex child4 = m_jit.graph().m_varArgChildren[node.firstChild() + 3];
    2845 
    2846         PredictedType basePrediction = at(child2).prediction();
     2837        PredictedType basePrediction = at(node.child2()).prediction();
    28472838        ASSERT_UNUSED(basePrediction, (basePrediction & PredictInt32) || !basePrediction);
    28482839
    2849         if (at(child1).shouldSpeculateByteArray()) {
    2850             compilePutByValForByteArray(node);
     2840        SpeculateCellOperand base(this, node.child1());
     2841        SpeculateStrictInt32Operand property(this, node.child2());
     2842        if (at(node.child1()).shouldSpeculateByteArray()) {
     2843            compilePutByValForByteArray(base.gpr(), property.gpr(), node);
    28512844            break;
    28522845        }
    28532846
    2854         if (at(child1).shouldSpeculateInt8Array()) {
    2855             compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), NoTypedArraySpecCheck, SignedTypedArray);
     2847        if (at(node.child1()).shouldSpeculateInt8Array()) {
     2848            compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), NoTypedArraySpecCheck, SignedTypedArray);
    28562849            if (!m_compileOkay)
    28572850                return;
    28582851            break;           
    28592852        }
    2860    
    2861         if (at(child1).shouldSpeculateInt16Array()) {
    2862             compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), NoTypedArraySpecCheck, SignedTypedArray);
     2853       
     2854        if (at(node.child1()).shouldSpeculateInt16Array()) {
     2855            compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), NoTypedArraySpecCheck, SignedTypedArray);
    28632856            if (!m_compileOkay)
    28642857                return;
    28652858            break;           
    28662859        }
    2867    
    2868         if (at(child1).shouldSpeculateInt32Array()) {
    2869             compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), NoTypedArraySpecCheck, SignedTypedArray);
     2860       
     2861        if (at(node.child1()).shouldSpeculateInt32Array()) {
     2862            compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), NoTypedArraySpecCheck, SignedTypedArray);
    28702863            if (!m_compileOkay)
    28712864                return;
    28722865            break;           
    28732866        }
    2874    
    2875         if (at(child1).shouldSpeculateUint8Array()) {
    2876             compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2867       
     2868        if (at(node.child1()).shouldSpeculateUint8Array()) {
     2869            compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28772870            if (!m_compileOkay)
    28782871                return;
    28792872            break;           
    28802873        }
    2881    
    2882         if (at(child1).shouldSpeculateUint16Array()) {
    2883             compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2874       
     2875        if (at(node.child1()).shouldSpeculateUint16Array()) {
     2876            compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28842877            if (!m_compileOkay)
    28852878                return;
    28862879            break;           
    28872880        }
    2888    
    2889         if (at(child1).shouldSpeculateUint32Array()) {
    2890             compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), NoTypedArraySpecCheck, UnsignedTypedArray);
     2881       
     2882        if (at(node.child1()).shouldSpeculateUint32Array()) {
     2883            compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), NoTypedArraySpecCheck, UnsignedTypedArray);
    28912884            if (!m_compileOkay)
    28922885                return;
    28932886            break;           
    28942887        }
    2895    
    2896         if (at(child1).shouldSpeculateFloat32Array()) {
    2897             compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), NoTypedArraySpecCheck);
     2888       
     2889        if (at(node.child1()).shouldSpeculateFloat32Array()) {
     2890            compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), NoTypedArraySpecCheck);
    28982891            if (!m_compileOkay)
    28992892                return;
    29002893            break;           
    29012894        }
    2902    
    2903         if (at(child1).shouldSpeculateFloat64Array()) {
    2904             compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), NoTypedArraySpecCheck);
     2895       
     2896        if (at(node.child1()).shouldSpeculateFloat64Array()) {
     2897            compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), NoTypedArraySpecCheck);
    29052898            if (!m_compileOkay)
    29062899                return;
     
    29082901        }
    29092902
    2910         SpeculateCellOperand base(this, child1);
    2911         SpeculateStrictInt32Operand property(this, child2);
    2912         JSValueOperand value(this, child3);
    2913 
    2914         {
    2915             GPRTemporary scratch(this);
    2916             GPRReg scratchReg = scratch.gpr();
    2917             writeBarrier(base.gpr(), value.gpr(), child3, WriteBarrierForPropertyAccess, scratchReg);
    2918         }
    2919         StorageOperand storage(this, child4);
     2903        JSValueOperand value(this, node.child3());
     2904        GPRTemporary scratch(this);
     2905       
     2906        GPRReg baseReg = base.gpr();
     2907        GPRReg scratchReg = scratch.gpr();
     2908
     2909        writeBarrier(base.gpr(), value.gpr(), node.child3(), WriteBarrierForPropertyAccess, scratchReg);
     2910
    29202911        // Get the array storage.
    2921         GPRReg storageReg = storage.gpr();
     2912        GPRReg storageReg = scratchReg;
     2913        m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
    29222914
    29232915        // Store the value to the array.
Note: See TracChangeset for help on using the changeset viewer.