Changeset 119660 in webkit for trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
- Timestamp:
- Jun 6, 2012, 6:35:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r119655 r119660 1029 1029 dataLog("SpecInt@%d ", nodeIndex); 1030 1030 #endif 1031 PredictedType type = m_state.forNode(nodeIndex).m_type;1031 SpeculatedType type = m_state.forNode(nodeIndex).m_type; 1032 1032 Node& node = at(nodeIndex); 1033 1033 VirtualRegister virtualRegister = node.virtualRegister(); … … 1087 1087 GPRReg gpr = info.gpr(); 1088 1088 m_gprs.lock(gpr); 1089 if (!isInt32 Prediction(type))1089 if (!isInt32Speculation(type)) 1090 1090 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchPtr(MacroAssembler::Below, gpr, GPRInfo::tagTypeNumberRegister)); 1091 1091 info.fillJSValue(gpr, DataFormatJSInteger); … … 1176 1176 dataLog("SpecDouble@%d ", nodeIndex); 1177 1177 #endif 1178 PredictedType type = m_state.forNode(nodeIndex).m_type;1178 SpeculatedType type = m_state.forNode(nodeIndex).m_type; 1179 1179 Node& node = at(nodeIndex); 1180 1180 VirtualRegister virtualRegister = node.virtualRegister(); … … 1261 1261 JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister); 1262 1262 1263 if (!isNumber Prediction(type))1263 if (!isNumberSpeculation(type)) 1264 1264 speculationCheck(BadType, JSValueRegs(jsValueGpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister)); 1265 1265 … … 1329 1329 dataLog("SpecCell@%d ", nodeIndex); 1330 1330 #endif 1331 PredictedType type = m_state.forNode(nodeIndex).m_type;1331 SpeculatedType type = m_state.forNode(nodeIndex).m_type; 1332 1332 Node& node = at(nodeIndex); 1333 1333 VirtualRegister virtualRegister = node.virtualRegister(); … … 1359 1359 1360 1360 info.fillJSValue(gpr, DataFormatJS); 1361 if (!isCell Prediction(type))1361 if (!isCellSpeculation(type)) 1362 1362 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister)); 1363 1363 info.fillJSValue(gpr, DataFormatJSCell); … … 1375 1375 GPRReg gpr = info.gpr(); 1376 1376 m_gprs.lock(gpr); 1377 if (!isCell Prediction(type))1377 if (!isCellSpeculation(type)) 1378 1378 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister)); 1379 1379 info.fillJSValue(gpr, DataFormatJSCell); … … 1404 1404 dataLog("SpecBool@%d ", nodeIndex); 1405 1405 #endif 1406 PredictedType type = m_state.forNode(nodeIndex).m_type;1406 SpeculatedType type = m_state.forNode(nodeIndex).m_type; 1407 1407 Node& node = at(nodeIndex); 1408 1408 VirtualRegister virtualRegister = node.virtualRegister(); … … 1434 1434 1435 1435 info.fillJSValue(gpr, DataFormatJS); 1436 if (!isBoolean Prediction(type)) {1436 if (!isBooleanSpeculation(type)) { 1437 1437 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1438 1438 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg)); … … 1453 1453 GPRReg gpr = info.gpr(); 1454 1454 m_gprs.lock(gpr); 1455 if (!isBoolean Prediction(type)) {1455 if (!isBooleanSpeculation(type)) { 1456 1456 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1457 1457 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg)); … … 1500 1500 } 1501 1501 1502 void SpeculativeJIT::compileObjectEquality(Node& node, const ClassInfo* classInfo, PredictionChecker predictionCheck)1502 void SpeculativeJIT::compileObjectEquality(Node& node, const ClassInfo* classInfo, SpeculatedTypeChecker speculatedTypeChecker) 1503 1503 { 1504 1504 SpeculateCellOperand op1(this, node.child1()); … … 1510 1510 GPRReg resultGPR = result.gpr(); 1511 1511 1512 if (! predictionCheck(m_state.forNode(node.child1()).m_type))1512 if (!speculatedTypeChecker(m_state.forNode(node.child1()).m_type)) 1513 1513 speculationCheck(BadType, JSValueRegs(op1GPR), node.child1().index(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(classInfo))); 1514 if (! predictionCheck(m_state.forNode(node.child2()).m_type))1514 if (!speculatedTypeChecker(m_state.forNode(node.child2()).m_type)) 1515 1515 speculationCheck(BadType, JSValueRegs(op2GPR), node.child2().index(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(classInfo))); 1516 1516 … … 1527 1527 void SpeculativeJIT::compileObjectToObjectOrOtherEquality( 1528 1528 Edge leftChild, Edge rightChild, 1529 const ClassInfo* classInfo, PredictionChecker predictionCheck)1529 const ClassInfo* classInfo, SpeculatedTypeChecker speculatedTypeChecker) 1530 1530 { 1531 1531 SpeculateCellOperand op1(this, leftChild); … … 1537 1537 GPRReg resultGPR = result.gpr(); 1538 1538 1539 if (! predictionCheck(m_state.forNode(leftChild).m_type)) {1539 if (!speculatedTypeChecker(m_state.forNode(leftChild).m_type)) { 1540 1540 speculationCheck( 1541 1541 BadType, JSValueRegs(op1GPR), leftChild.index(), … … 1553 1553 // We know that within this branch, rightChild must be a cell. If the CFA can tell us that the 1554 1554 // proof, when filtered on cell, demonstrates that we have an object of the desired type 1555 // ( predictionCheck() will test for FinalObject or Array, currently), then we can skip the1555 // (speculationCheck() will test for FinalObject or Array, currently), then we can skip the 1556 1556 // speculation. 1557 if (! predictionCheck(m_state.forNode(rightChild).m_type & PredictCell)) {1557 if (!speculatedTypeChecker(m_state.forNode(rightChild).m_type & SpecCell)) { 1558 1558 speculationCheck( 1559 1559 BadType, JSValueRegs(op2GPR), rightChild.index(), … … 1574 1574 // We know that within this branch, rightChild must not be a cell. Check if that is enough to 1575 1575 // prove that it is either null or undefined. 1576 if (!isOther Prediction(m_state.forNode(rightChild).m_type & ~PredictCell)) {1576 if (!isOtherSpeculation(m_state.forNode(rightChild).m_type & ~SpecCell)) { 1577 1577 m_jit.move(op2GPR, resultGPR); 1578 1578 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR); … … 1597 1597 void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality( 1598 1598 Edge leftChild, Edge rightChild, NodeIndex branchNodeIndex, 1599 const ClassInfo* classInfo, PredictionChecker predictionCheck)1599 const ClassInfo* classInfo, SpeculatedTypeChecker speculatedTypeChecker) 1600 1600 { 1601 1601 Node& branchNode = at(branchNodeIndex); … … 1611 1611 GPRReg resultGPR = result.gpr(); 1612 1612 1613 if (! predictionCheck(m_state.forNode(leftChild).m_type)) {1613 if (!speculatedTypeChecker(m_state.forNode(leftChild).m_type)) { 1614 1614 speculationCheck( 1615 1615 BadType, JSValueRegs(op1GPR), leftChild.index(), … … 1627 1627 // We know that within this branch, rightChild must be a cell. If the CFA can tell us that the 1628 1628 // proof, when filtered on cell, demonstrates that we have an object of the desired type 1629 // ( predictionCheck() will test for FinalObject or Array, currently), then we can skip the1629 // (speculationCheck() will test for FinalObject or Array, currently), then we can skip the 1630 1630 // speculation. 1631 if (! predictionCheck(m_state.forNode(rightChild).m_type & PredictCell)) {1631 if (!speculatedTypeChecker(m_state.forNode(rightChild).m_type & SpecCell)) { 1632 1632 speculationCheck( 1633 1633 BadType, JSValueRegs(op2GPR), rightChild.index(), … … 1645 1645 // We know that within this branch, rightChild must not be a cell. Check if that is enough to 1646 1646 // prove that it is either null or undefined. 1647 if (isOther Prediction(m_state.forNode(rightChild).m_type & ~PredictCell))1647 if (isOtherSpeculation(m_state.forNode(rightChild).m_type & ~SpecCell)) 1648 1648 rightNotCell.link(&m_jit); 1649 1649 else { … … 1740 1740 { 1741 1741 if (at(node.child1()).shouldSpeculateFinalObjectOrOther()) { 1742 compileObjectOrOtherLogicalNot(node.child1(), &JSFinalObject::s_info, !isFinalObjectOrOther Prediction(m_state.forNode(node.child1()).m_type));1742 compileObjectOrOtherLogicalNot(node.child1(), &JSFinalObject::s_info, !isFinalObjectOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1743 1743 return; 1744 1744 } 1745 1745 if (at(node.child1()).shouldSpeculateArrayOrOther()) { 1746 compileObjectOrOtherLogicalNot(node.child1(), &JSArray::s_info, !isArrayOrOther Prediction(m_state.forNode(node.child1()).m_type));1746 compileObjectOrOtherLogicalNot(node.child1(), &JSArray::s_info, !isArrayOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1747 1747 return; 1748 1748 } … … 1767 1767 } 1768 1768 1769 PredictedType prediction = m_jit.getPrediction(node.child1());1770 if (isBoolean Prediction(prediction)) {1771 if (isBoolean Prediction(m_state.forNode(node.child1()).m_type)) {1769 SpeculatedType prediction = m_jit.getSpeculation(node.child1()); 1770 if (isBooleanSpeculation(prediction)) { 1771 if (isBooleanSpeculation(m_state.forNode(node.child1()).m_type)) { 1772 1772 SpeculateBooleanOperand value(this, node.child1()); 1773 1773 GPRTemporary result(this, value); … … 1842 1842 1843 1843 if (at(node.child1()).shouldSpeculateFinalObjectOrOther()) { 1844 emitObjectOrOtherBranch(node.child1(), taken, notTaken, &JSFinalObject::s_info, !isFinalObjectOrOther Prediction(m_state.forNode(node.child1()).m_type));1844 emitObjectOrOtherBranch(node.child1(), taken, notTaken, &JSFinalObject::s_info, !isFinalObjectOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1845 1845 } else if (at(node.child1()).shouldSpeculateArrayOrOther()) { 1846 emitObjectOrOtherBranch(node.child1(), taken, notTaken, &JSArray::s_info, !isArrayOrOther Prediction(m_state.forNode(node.child1()).m_type));1846 emitObjectOrOtherBranch(node.child1(), taken, notTaken, &JSArray::s_info, !isArrayOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1847 1847 } else if (at(node.child1()).shouldSpeculateNumber()) { 1848 1848 if (at(node.child1()).shouldSpeculateInteger()) { … … 1871 1871 GPRReg valueGPR = value.gpr(); 1872 1872 1873 bool predictBoolean = isBoolean Prediction(m_jit.getPrediction(node.child1()));1873 bool predictBoolean = isBooleanSpeculation(m_jit.getSpeculation(node.child1())); 1874 1874 1875 1875 if (predictBoolean) { 1876 if (isBoolean Prediction(m_state.forNode(node.child1()).m_type)) {1876 if (isBooleanSpeculation(m_state.forNode(node.child1()).m_type)) { 1877 1877 MacroAssembler::ResultCondition condition = MacroAssembler::NonZero; 1878 1878 … … 1941 1941 1942 1942 case GetLocal: { 1943 PredictedType prediction = node.variableAccessData()->prediction();1943 SpeculatedType prediction = node.variableAccessData()->prediction(); 1944 1944 AbstractValue& value = block()->valuesAtHead.operand(node.local()); 1945 1945 1946 1946 // If we have no prediction for this local, then don't attempt to compile. 1947 if (prediction == PredictNone) {1947 if (prediction == SpecNone) { 1948 1948 terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), NoNode); 1949 1949 break; … … 1967 1967 } 1968 1968 1969 if (isInt32 Prediction(value.m_type)) {1969 if (isInt32Speculation(value.m_type)) { 1970 1970 GPRTemporary result(this); 1971 1971 m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr()); … … 1991 1991 if (node.variableAccessData()->isCaptured()) 1992 1992 format = DataFormatJS; 1993 else if (isCell Prediction(value.m_type))1993 else if (isCellSpeculation(value.m_type)) 1994 1994 format = DataFormatJSCell; 1995 else if (isBoolean Prediction(value.m_type))1995 else if (isBooleanSpeculation(value.m_type)) 1996 1996 format = DataFormatJSBoolean; 1997 1997 else … … 2060 2060 } 2061 2061 2062 PredictedType predictedType = node.variableAccessData()->argumentAwarePrediction();2063 if (isInt32 Prediction(predictedType)) {2062 SpeculatedType predictedType = node.variableAccessData()->argumentAwarePrediction(); 2063 if (isInt32Speculation(predictedType)) { 2064 2064 SpeculateIntegerOperand value(this, node.child1()); 2065 2065 m_jit.store32(value.gpr(), JITCompiler::payloadFor(node.local())); … … 2068 2068 break; 2069 2069 } 2070 if (isArray Prediction(predictedType)) {2070 if (isArraySpeculation(predictedType)) { 2071 2071 SpeculateCellOperand cell(this, node.child1()); 2072 2072 GPRReg cellGPR = cell.gpr(); 2073 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))2073 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 2074 2074 speculationCheck(BadType, JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 2075 2075 m_jit.storePtr(cellGPR, JITCompiler::addressFor(node.local())); … … 2078 2078 break; 2079 2079 } 2080 if (isBoolean Prediction(predictedType)) {2080 if (isBooleanSpeculation(predictedType)) { 2081 2081 SpeculateBooleanOperand boolean(this, node.child1()); 2082 2082 m_jit.storePtr(boolean.gpr(), JITCompiler::addressFor(node.local())); … … 2177 2177 2178 2178 case CheckNumber: { 2179 if (!isNumber Prediction(m_state.forNode(node.child1()).m_type)) {2179 if (!isNumberSpeculation(m_state.forNode(node.child1()).m_type)) { 2180 2180 JSValueOperand op1(this, node.child1()); 2181 2181 JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, op1.gpr(), GPRInfo::tagTypeNumberRegister); … … 2377 2377 } 2378 2378 2379 if (!at(node.child2()).shouldSpeculateInteger() || !isActionableArray Prediction(at(node.child1()).prediction())) {2379 if (!at(node.child2()).shouldSpeculateInteger() || !isActionableArraySpeculation(at(node.child1()).prediction())) { 2380 2380 JSValueOperand base(this, node.child1()); 2381 2381 JSValueOperand property(this, node.child2()); … … 2398 2398 } 2399 2399 2400 if (at(node.child1()).prediction() == PredictString) {2400 if (at(node.child1()).prediction() == SpecString) { 2401 2401 compileGetByValOnString(node); 2402 2402 if (!m_compileOkay) … … 2406 2406 2407 2407 if (at(node.child1()).shouldSpeculateInt8Array()) { 2408 compileGetByValOnIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), isInt8Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2408 compileGetByValOnIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), node, sizeof(int8_t), isInt8ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2409 2409 if (!m_compileOkay) 2410 2410 return; … … 2413 2413 2414 2414 if (at(node.child1()).shouldSpeculateInt16Array()) { 2415 compileGetByValOnIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), isInt16Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2415 compileGetByValOnIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), node, sizeof(int16_t), isInt16ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2416 2416 if (!m_compileOkay) 2417 2417 return; … … 2420 2420 2421 2421 if (at(node.child1()).shouldSpeculateInt32Array()) { 2422 compileGetByValOnIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), isInt32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2422 compileGetByValOnIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), node, sizeof(int32_t), isInt32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2423 2423 if (!m_compileOkay) 2424 2424 return; … … 2427 2427 2428 2428 if (at(node.child1()).shouldSpeculateUint8Array()) { 2429 compileGetByValOnIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), isUint8Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2429 compileGetByValOnIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), node, sizeof(uint8_t), isUint8ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2430 2430 if (!m_compileOkay) 2431 2431 return; … … 2434 2434 2435 2435 if (at(node.child1()).shouldSpeculateUint8ClampedArray()) { 2436 compileGetByValOnIntTypedArray(m_jit.globalData()->uint8ClampedArrayDescriptor(), node, sizeof(uint8_t), isUint8ClampedArray Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2436 compileGetByValOnIntTypedArray(m_jit.globalData()->uint8ClampedArrayDescriptor(), node, sizeof(uint8_t), isUint8ClampedArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2437 2437 if (!m_compileOkay) 2438 2438 return; … … 2441 2441 2442 2442 if (at(node.child1()).shouldSpeculateUint16Array()) { 2443 compileGetByValOnIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), isUint16Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2443 compileGetByValOnIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), node, sizeof(uint16_t), isUint16ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2444 2444 if (!m_compileOkay) 2445 2445 return; … … 2448 2448 2449 2449 if (at(node.child1()).shouldSpeculateUint32Array()) { 2450 compileGetByValOnIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), isUint32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2450 compileGetByValOnIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), node, sizeof(uint32_t), isUint32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2451 2451 if (!m_compileOkay) 2452 2452 return; … … 2455 2455 2456 2456 if (at(node.child1()).shouldSpeculateFloat32Array()) { 2457 compileGetByValOnFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), isFloat32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);2457 compileGetByValOnFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), node, sizeof(float), isFloat32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks); 2458 2458 if (!m_compileOkay) 2459 2459 return; … … 2462 2462 2463 2463 if (at(node.child1()).shouldSpeculateFloat64Array()) { 2464 compileGetByValOnFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), isFloat64Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);2464 compileGetByValOnFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), node, sizeof(double), isFloat64ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks); 2465 2465 if (!m_compileOkay) 2466 2466 return; … … 2481 2481 return; 2482 2482 2483 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))2483 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 2484 2484 speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 2485 2485 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()))); … … 2502 2502 } 2503 2503 2504 if (!at(node.child2()).shouldSpeculateInteger() || !isActionableMutableArray Prediction(at(node.child1()).prediction())) {2504 if (!at(node.child2()).shouldSpeculateInteger() || !isActionableMutableArraySpeculation(at(node.child1()).prediction())) { 2505 2505 JSValueOperand arg1(this, node.child1()); 2506 2506 JSValueOperand arg2(this, node.child2()); … … 2535 2535 return; 2536 2536 2537 if (!isArguments Prediction(m_state.forNode(node.child1()).m_type)) {2537 if (!isArgumentsSpeculation(m_state.forNode(node.child1()).m_type)) { 2538 2538 speculationCheck( 2539 2539 BadType, JSValueSource::unboxedCell(baseReg), node.child1(), … … 2579 2579 2580 2580 if (at(node.child1()).shouldSpeculateInt8Array()) { 2581 compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), isInt8Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2581 compilePutByValForIntTypedArray(m_jit.globalData()->int8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int8_t), isInt8ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2582 2582 if (!m_compileOkay) 2583 2583 return; … … 2586 2586 2587 2587 if (at(node.child1()).shouldSpeculateInt16Array()) { 2588 compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), isInt16Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2588 compilePutByValForIntTypedArray(m_jit.globalData()->int16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int16_t), isInt16ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2589 2589 if (!m_compileOkay) 2590 2590 return; … … 2593 2593 2594 2594 if (at(node.child1()).shouldSpeculateInt32Array()) { 2595 compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), isInt32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray);2595 compilePutByValForIntTypedArray(m_jit.globalData()->int32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(int32_t), isInt32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, SignedTypedArray); 2596 2596 if (!m_compileOkay) 2597 2597 return; … … 2600 2600 2601 2601 if (at(node.child1()).shouldSpeculateUint8Array()) { 2602 compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2602 compilePutByValForIntTypedArray(m_jit.globalData()->uint8ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2603 2603 if (!m_compileOkay) 2604 2604 return; … … 2607 2607 2608 2608 if (at(node.child1()).shouldSpeculateUint8ClampedArray()) { 2609 compilePutByValForIntTypedArray(m_jit.globalData()->uint8ClampedArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8ClampedArray Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray, ClampRounding);2609 compilePutByValForIntTypedArray(m_jit.globalData()->uint8ClampedArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint8_t), isUint8ClampedArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray, ClampRounding); 2610 2610 break; 2611 2611 } 2612 2612 2613 2613 if (at(node.child1()).shouldSpeculateUint16Array()) { 2614 compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), isUint16Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2614 compilePutByValForIntTypedArray(m_jit.globalData()->uint16ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint16_t), isUint16ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2615 2615 if (!m_compileOkay) 2616 2616 return; … … 2619 2619 2620 2620 if (at(node.child1()).shouldSpeculateUint32Array()) { 2621 compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), isUint32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray);2621 compilePutByValForIntTypedArray(m_jit.globalData()->uint32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(uint32_t), isUint32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks, UnsignedTypedArray); 2622 2622 if (!m_compileOkay) 2623 2623 return; … … 2626 2626 2627 2627 if (at(node.child1()).shouldSpeculateFloat32Array()) { 2628 compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), isFloat32Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);2628 compilePutByValForFloatTypedArray(m_jit.globalData()->float32ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(float), isFloat32ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks); 2629 2629 if (!m_compileOkay) 2630 2630 return; … … 2633 2633 2634 2634 if (at(node.child1()).shouldSpeculateFloat64Array()) { 2635 compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), isFloat64Array Prediction(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks);2635 compilePutByValForFloatTypedArray(m_jit.globalData()->float64ArrayDescriptor(), base.gpr(), property.gpr(), node, sizeof(double), isFloat64ArraySpeculation(m_state.forNode(node.child1()).m_type) ? NoTypedArrayTypeSpecCheck : AllTypedArraySpecChecks); 2636 2636 if (!m_compileOkay) 2637 2637 return; … … 2657 2657 // Check that base is an array, and that property is contained within m_vector (< m_vectorLength). 2658 2658 // If we have predicted the base to be type array, we can skip the check. 2659 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))2659 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 2660 2660 speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 2661 2661 … … 2702 2702 } 2703 2703 2704 ASSERT(isActionableMutableArray Prediction(at(node.child1()).prediction()));2704 ASSERT(isActionableMutableArraySpeculation(at(node.child1()).prediction())); 2705 2705 ASSERT(at(node.child2()).shouldSpeculateInteger()); 2706 2706 … … 2854 2854 writeBarrier(baseGPR, valueGPR, node.child2(), WriteBarrierForPropertyAccess, storageGPR, storageLengthGPR); 2855 2855 2856 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))2856 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 2857 2857 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 2858 2858 … … 2892 2892 GPRReg storageLengthGPR = storageLength.gpr(); 2893 2893 2894 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))2894 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 2895 2895 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 2896 2896 … … 3019 3019 op1.use(); 3020 3020 3021 if (!(m_state.forNode(node.child1()).m_type & ~( PredictNumber | PredictBoolean)))3021 if (!(m_state.forNode(node.child1()).m_type & ~(SpecNumber | SpecBoolean))) 3022 3022 m_jit.move(op1GPR, resultGPR); 3023 3023 else { … … 3113 3113 3114 3114 case ConvertThis: { 3115 if (isObject Prediction(m_state.forNode(node.child1()).m_type)) {3115 if (isObjectSpeculation(m_state.forNode(node.child1()).m_type)) { 3116 3116 SpeculateCellOperand thisValue(this, node.child1()); 3117 3117 GPRTemporary result(this, thisValue); … … 3121 3121 } 3122 3122 3123 if (isOther Prediction(at(node.child1()).prediction())) {3123 if (isOtherSpeculation(at(node.child1()).prediction())) { 3124 3124 JSValueOperand thisValue(this, node.child1()); 3125 3125 GPRTemporary scratch(this, thisValue); … … 3127 3127 GPRReg scratchGPR = scratch.gpr(); 3128 3128 3129 if (!isOther Prediction(m_state.forNode(node.child1()).m_type)) {3129 if (!isOtherSpeculation(m_state.forNode(node.child1()).m_type)) { 3130 3130 m_jit.move(thisValueGPR, scratchGPR); 3131 3131 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR); … … 3138 3138 } 3139 3139 3140 if (isObject Prediction(at(node.child1()).prediction())) {3140 if (isObjectSpeculation(at(node.child1()).prediction())) { 3141 3141 SpeculateCellOperand thisValue(this, node.child1()); 3142 3142 GPRTemporary result(this, thisValue); … … 3144 3144 GPRReg resultGPR = result.gpr(); 3145 3145 3146 if (!isObject Prediction(m_state.forNode(node.child1()).m_type))3146 if (!isObjectSpeculation(m_state.forNode(node.child1()).m_type)) 3147 3147 speculationCheck(BadType, JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(JITCompiler::Equal, JITCompiler::Address(thisValueGPR, JSCell::classInfoOffset()), JITCompiler::TrustedImmPtr(&JSString::s_info))); 3148 3148 … … 3266 3266 } 3267 3267 3268 if (isCell Prediction(at(node.child1()).prediction())) {3268 if (isCellSpeculation(at(node.child1()).prediction())) { 3269 3269 SpeculateCellOperand base(this, node.child1()); 3270 3270 GPRTemporary result(this, base); … … 3316 3316 } 3317 3317 3318 if (isCell Prediction(at(node.child1()).prediction())) {3318 if (isCellSpeculation(at(node.child1()).prediction())) { 3319 3319 SpeculateCellOperand base(this, node.child1()); 3320 3320 GPRReg baseGPR = base.gpr(); … … 3363 3363 GPRReg resultGPR = result.gpr(); 3364 3364 3365 if (!isArray Prediction(m_state.forNode(node.child1()).m_type))3365 if (!isArraySpeculation(m_state.forNode(node.child1()).m_type)) 3366 3366 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSArray::s_info))); 3367 3367 … … 3387 3387 GPRReg resultGPR = result.gpr(); 3388 3388 3389 if (!isString Prediction(m_state.forNode(node.child1()).m_type))3389 if (!isStringSpeculation(m_state.forNode(node.child1()).m_type)) 3390 3390 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSString::s_info))); 3391 3391 … … 3397 3397 3398 3398 case GetInt8ArrayLength: { 3399 compileGetTypedArrayLength(m_jit.globalData()->int8ArrayDescriptor(), node, !isInt8Array Prediction(m_state.forNode(node.child1()).m_type));3399 compileGetTypedArrayLength(m_jit.globalData()->int8ArrayDescriptor(), node, !isInt8ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3400 3400 break; 3401 3401 } 3402 3402 case GetInt16ArrayLength: { 3403 compileGetTypedArrayLength(m_jit.globalData()->int16ArrayDescriptor(), node, !isInt16Array Prediction(m_state.forNode(node.child1()).m_type));3403 compileGetTypedArrayLength(m_jit.globalData()->int16ArrayDescriptor(), node, !isInt16ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3404 3404 break; 3405 3405 } 3406 3406 case GetInt32ArrayLength: { 3407 compileGetTypedArrayLength(m_jit.globalData()->int32ArrayDescriptor(), node, !isInt32Array Prediction(m_state.forNode(node.child1()).m_type));3407 compileGetTypedArrayLength(m_jit.globalData()->int32ArrayDescriptor(), node, !isInt32ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3408 3408 break; 3409 3409 } 3410 3410 case GetUint8ArrayLength: { 3411 compileGetTypedArrayLength(m_jit.globalData()->uint8ArrayDescriptor(), node, !isUint8Array Prediction(m_state.forNode(node.child1()).m_type));3411 compileGetTypedArrayLength(m_jit.globalData()->uint8ArrayDescriptor(), node, !isUint8ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3412 3412 break; 3413 3413 } 3414 3414 case GetUint8ClampedArrayLength: { 3415 compileGetTypedArrayLength(m_jit.globalData()->uint8ClampedArrayDescriptor(), node, !isUint8ClampedArray Prediction(m_state.forNode(node.child1()).m_type));3415 compileGetTypedArrayLength(m_jit.globalData()->uint8ClampedArrayDescriptor(), node, !isUint8ClampedArraySpeculation(m_state.forNode(node.child1()).m_type)); 3416 3416 break; 3417 3417 } 3418 3418 case GetUint16ArrayLength: { 3419 compileGetTypedArrayLength(m_jit.globalData()->uint16ArrayDescriptor(), node, !isUint16Array Prediction(m_state.forNode(node.child1()).m_type));3419 compileGetTypedArrayLength(m_jit.globalData()->uint16ArrayDescriptor(), node, !isUint16ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3420 3420 break; 3421 3421 } 3422 3422 case GetUint32ArrayLength: { 3423 compileGetTypedArrayLength(m_jit.globalData()->uint32ArrayDescriptor(), node, !isUint32Array Prediction(m_state.forNode(node.child1()).m_type));3423 compileGetTypedArrayLength(m_jit.globalData()->uint32ArrayDescriptor(), node, !isUint32ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3424 3424 break; 3425 3425 } 3426 3426 case GetFloat32ArrayLength: { 3427 compileGetTypedArrayLength(m_jit.globalData()->float32ArrayDescriptor(), node, !isFloat32Array Prediction(m_state.forNode(node.child1()).m_type));3427 compileGetTypedArrayLength(m_jit.globalData()->float32ArrayDescriptor(), node, !isFloat32ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3428 3428 break; 3429 3429 } 3430 3430 case GetFloat64ArrayLength: { 3431 compileGetTypedArrayLength(m_jit.globalData()->float64ArrayDescriptor(), node, !isFloat64Array Prediction(m_state.forNode(node.child1()).m_type));3431 compileGetTypedArrayLength(m_jit.globalData()->float64ArrayDescriptor(), node, !isFloat64ArraySpeculation(m_state.forNode(node.child1()).m_type)); 3432 3432 break; 3433 3433 } … … 3441 3441 AbstractValue& value = m_state.forNode(node.child1()); 3442 3442 if (value.m_structure.isSubsetOf(node.structureSet()) 3443 && isCell Prediction(value.m_type)) {3443 && isCellSpeculation(value.m_type)) { 3444 3444 noResult(m_compileIndex); 3445 3445 break; … … 3882 3882 GPRReg resultGPR = result.gpr(); 3883 3883 3884 if (!isEmpty Prediction(3884 if (!isEmptySpeculation( 3885 3885 m_state.variables().operand( 3886 3886 m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type)) { … … 3941 3941 GPRReg resultGPR = result.gpr(); 3942 3942 3943 if (!isEmpty Prediction(3943 if (!isEmptySpeculation( 3944 3944 m_state.variables().operand( 3945 3945 m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type)) { … … 4043 4043 4044 4044 case CheckArgumentsNotCreated: { 4045 ASSERT(!isEmpty Prediction(4045 ASSERT(!isEmptySpeculation( 4046 4046 m_state.variables().operand( 4047 4047 m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type));
Note:
See TracChangeset
for help on using the changeset viewer.