Changeset 161392 in webkit
- Timestamp:
- Jan 6, 2014, 7:17:11 PM (12 years ago)
- Location:
- branches/jsCStack
- Files:
-
- 15 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/LayoutTests/ChangeLog
r160232 r161392 1 2014-01-06 Filip Pizlo <fpizlo@apple.com> 2 3 Merge trunk r160242, r160246, r160252, r160257. 4 1 5 2013-12-06 Michał Pakuła vel Rutka <m.pakula@samsung.com> 2 6 -
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r161390 r161392 1 2014-01-06 Filip Pizlo <fpizlo@apple.com> 2 3 Merge trunk r160238, r160242, r160246, r160252, r160257. 4 1 5 2014-01-06 Michael Saboff <msaboff@apple.com> 2 6 -
branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.h
r160835 r161392 427 427 { 428 428 return baselineCodeBlockForOriginAndBaselineCodeBlock(codeOrigin, m_profiledBlock); 429 } 430 431 bool isStrictModeFor(CodeOrigin codeOrigin) 432 { 433 if (!codeOrigin.inlineCallFrame) 434 return m_codeBlock->isStrictMode(); 435 return jsCast<FunctionExecutable*>(codeOrigin.inlineCallFrame->executable.get())->isStrictMode(); 436 } 437 438 ECMAMode ecmaModeFor(CodeOrigin codeOrigin) 439 { 440 return isStrictModeFor(codeOrigin) ? StrictMode : NotStrictMode; 429 441 } 430 442 -
branches/jsCStack/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r161125 r161392 106 106 case Call: 107 107 case Construct: 108 case ValueToInt32: 109 case Branch: 110 case LogicalNot: 108 111 // These are OK. 109 112 break; … … 147 150 switch (node->arrayMode().type()) { 148 151 case Array::ForceExit: 152 case Array::Generic: 149 153 case Array::String: 150 return CanCompileAndOSREnter;151 154 case Array::Int32: 152 155 case Array::Double: … … 158 161 return CannotCompile; 159 162 } 160 switch (node->arrayMode().speculation()) {161 case Array::SaneChain:162 case Array::InBounds:163 break;164 default:165 return CannotCompile;166 }167 163 break; 168 164 case PutByVal: 169 165 case PutByValAlias: 166 case PutByValDirect: 170 167 switch (node->arrayMode().type()) { 171 168 case Array::ForceExit: 172 return CanCompileAndOSREnter;169 case Array::Generic: 173 170 case Array::Int32: 174 171 case Array::Double: … … 203 200 break; 204 201 return CannotCompile; 205 case Branch:206 case LogicalNot:207 switch (node->child1().useKind()) {208 case BooleanUse:209 case Int32Use:210 case NumberUse:211 case StringUse:212 case ObjectOrOtherUse:213 break;214 default:215 return CannotCompile;216 }217 break;218 202 case Switch: 219 203 switch (node->switchData()->kind) { … … 224 208 return CannotCompile; 225 209 } 226 break;227 case ValueToInt32:228 if (node->child1().useKind() != BooleanUse)229 return CannotCompile;230 210 break; 231 211 default: -
branches/jsCStack/Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h
r160893 r161392 56 56 macro(I_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \ 57 57 macro(J_JITOperation_E, functionType(int64, intPtr)) \ 58 macro(J_JITOperation_EAZ, functionType(int64, intPtr, intPtr, int32)) \ 59 macro(J_JITOperation_EJJ, functionType(int64, intPtr, int64, int64)) \ 58 60 macro(J_JITOperation_EJssZ, functionType(int64, intPtr, intPtr, int32)) \ 59 61 macro(J_JITOperation_ESsiJI, functionType(int64, intPtr, intPtr, int64, intPtr)) \ … … 66 68 macro(P_JITOperation_EStSS, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \ 67 69 macro(P_JITOperation_EStZ, functionType(intPtr, intPtr, intPtr, int32)) \ 70 macro(S_JITOperation_EJ, functionType(intPtr, intPtr, int64)) \ 71 macro(V_JITOperation_EJJJ, functionType(voidType, intPtr, int64, int64, int64)) \ 68 72 macro(V_JITOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \ 69 73 macro(V_JITOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \ -
branches/jsCStack/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r160963 r161392 388 388 case PutByVal: 389 389 case PutByValAlias: 390 case PutByValDirect: 390 391 compilePutByVal(); 391 392 break; … … 510 511 void compileValueToInt32() 511 512 { 512 ASSERT(m_node->child1().useKind() == BooleanUse); 513 setInt32(m_out.zeroExt(lowBoolean(m_node->child1()), m_out.int32)); 513 switch (m_node->child1().useKind()) { 514 case Int32Use: 515 setInt32(lowInt32(m_node->child1())); 516 break; 517 518 case MachineIntUse: 519 setInt32(m_out.castToInt32(lowStrictInt52(m_node->child1()))); 520 break; 521 522 case NumberUse: 523 case NotCellUse: { 524 LoweredNodeValue value = m_int32Values.get(m_node->child1().node()); 525 if (isValid(value)) { 526 setInt32(value.value()); 527 break; 528 } 529 530 value = m_jsValueValues.get(m_node->child1().node()); 531 if (isValid(value)) { 532 LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case")); 533 LBasicBlock notIntCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not int case")); 534 LBasicBlock doubleCase = 0; 535 LBasicBlock notNumberCase = 0; 536 if (m_node->child1().useKind() == NotCellUse) { 537 doubleCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 double case")); 538 notNumberCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not number case")); 539 } 540 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ValueToInt32 continuation")); 541 542 Vector<ValueFromBlock> results; 543 544 m_out.branch(isNotInt32(value.value()), notIntCase, intCase); 545 546 LBasicBlock lastNext = m_out.appendTo(intCase, notIntCase); 547 results.append(m_out.anchor(unboxInt32(value.value()))); 548 m_out.jump(continuation); 549 550 if (m_node->child1().useKind() == NumberUse) { 551 m_out.appendTo(notIntCase, continuation); 552 FTL_TYPE_CHECK( 553 jsValueValue(value.value()), m_node->child1(), SpecFullNumber, 554 isCellOrMisc(value.value())); 555 results.append(m_out.anchor(doubleToInt32(unboxDouble(value.value())))); 556 m_out.jump(continuation); 557 } else { 558 m_out.appendTo(notIntCase, doubleCase); 559 m_out.branch(isCellOrMisc(value.value()), notNumberCase, doubleCase); 560 561 m_out.appendTo(doubleCase, notNumberCase); 562 results.append(m_out.anchor(doubleToInt32(unboxDouble(value.value())))); 563 m_out.jump(continuation); 564 565 m_out.appendTo(notNumberCase, continuation); 566 567 FTL_TYPE_CHECK( 568 jsValueValue(value.value()), m_node->child1(), ~SpecCell, 569 isCell(value.value())); 570 571 LValue specialResult = m_out.select( 572 m_out.equal( 573 value.value(), 574 m_out.constInt64(JSValue::encode(jsBoolean(true)))), 575 m_out.int32One, m_out.int32Zero); 576 results.append(m_out.anchor(specialResult)); 577 m_out.jump(continuation); 578 } 579 580 m_out.appendTo(continuation, lastNext); 581 setInt32(m_out.phi(m_out.int32, results)); 582 break; 583 } 584 585 value = m_doubleValues.get(m_node->child1().node()); 586 if (isValid(value)) { 587 setInt32(doubleToInt32(value.value())); 588 break; 589 } 590 591 terminate(Uncountable); 592 break; 593 } 594 595 case BooleanUse: 596 setInt32(m_out.zeroExt(lowBoolean(m_node->child1()), m_out.int32)); 597 break; 598 599 default: 600 RELEASE_ASSERT_NOT_REACHED(); 601 break; 602 } 514 603 } 515 604 … … 1423 1512 LValue storage = lowStorage(m_node->child3()); 1424 1513 1514 IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ? 1515 m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties; 1516 1425 1517 if (m_node->arrayMode().isInBounds()) { 1426 1518 speculate( … … 1429 1521 index, m_out.load32(storage, m_heaps.Butterfly_publicLength))); 1430 1522 1431 LValue result = m_out.load64(m_out.baseIndex( 1432 m_node->arrayMode().type() == Array::Int32 ? 1433 m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties, 1434 storage, m_out.zeroExt(index, m_out.intPtr), 1435 m_state.forNode(m_node->child2()).m_value)); 1523 LValue result = m_out.load64(baseIndex(heap, storage, index, m_node->child2())); 1436 1524 speculate(LoadFromHole, noValue(), 0, m_out.isZero64(result)); 1437 1525 setJSValue(result); … … 1439 1527 } 1440 1528 1441 // FIXME: Implement hole/OOB loads in the FTL. 1442 // https://bugs.webkit.org/show_bug.cgi?id=118077 1443 RELEASE_ASSERT_NOT_REACHED(); 1529 LValue base = lowCell(m_node->child1()); 1530 1531 LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous fast case")); 1532 LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous slow case")); 1533 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous continuation")); 1534 1535 m_out.branch( 1536 m_out.aboveOrEqual( 1537 index, m_out.load32(storage, m_heaps.Butterfly_publicLength)), 1538 slowCase, fastCase); 1539 1540 LBasicBlock lastNext = m_out.appendTo(fastCase, slowCase); 1541 1542 ValueFromBlock fastResult = m_out.anchor( 1543 m_out.load64(baseIndex(heap, storage, index, m_node->child2()))); 1544 m_out.branch(m_out.isZero64(fastResult.value()), slowCase, continuation); 1545 1546 m_out.appendTo(slowCase, continuation); 1547 ValueFromBlock slowResult = m_out.anchor( 1548 vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); 1549 m_out.jump(continuation); 1550 1551 m_out.appendTo(continuation, lastNext); 1552 setJSValue(m_out.phi(m_out.int64, fastResult, slowResult)); 1444 1553 return; 1445 1554 } … … 1448 1557 LValue index = lowInt32(m_node->child2()); 1449 1558 LValue storage = lowStorage(m_node->child3()); 1559 1560 IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties; 1450 1561 1451 1562 if (m_node->arrayMode().isInBounds()) { … … 1455 1566 index, m_out.load32(storage, m_heaps.Butterfly_publicLength))); 1456 1567 1457 LValue result = m_out.loadDouble(m_out.baseIndex( 1458 m_heaps.indexedDoubleProperties, 1459 storage, m_out.zeroExt(index, m_out.intPtr), 1460 m_state.forNode(m_node->child2()).m_value)); 1568 LValue result = m_out.loadDouble( 1569 baseIndex(heap, storage, index, m_node->child2())); 1461 1570 1462 1571 if (!m_node->arrayMode().isSaneChain()) { … … 1469 1578 } 1470 1579 1471 // FIXME: Implement hole/OOB loads in the FTL. 1472 // https://bugs.webkit.org/show_bug.cgi?id=118077 1473 RELEASE_ASSERT_NOT_REACHED(); 1580 LValue base = lowCell(m_node->child1()); 1581 1582 LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetByVal double in bounds")); 1583 LBasicBlock boxPath = FTL_NEW_BLOCK(m_out, ("GetByVal double boxing")); 1584 LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal double slow case")); 1585 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal double continuation")); 1586 1587 m_out.branch( 1588 m_out.aboveOrEqual( 1589 index, m_out.load32(storage, m_heaps.Butterfly_publicLength)), 1590 slowCase, inBounds); 1591 1592 LBasicBlock lastNext = m_out.appendTo(inBounds, boxPath); 1593 LValue doubleValue = m_out.loadDouble( 1594 baseIndex(heap, storage, index, m_node->child2())); 1595 m_out.branch( 1596 m_out.doubleNotEqualOrUnordered(doubleValue, doubleValue), slowCase, boxPath); 1597 1598 m_out.appendTo(boxPath, slowCase); 1599 ValueFromBlock fastResult = m_out.anchor(boxDouble(doubleValue)); 1600 m_out.jump(continuation); 1601 1602 m_out.appendTo(slowCase, continuation); 1603 ValueFromBlock slowResult = m_out.anchor( 1604 vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); 1605 m_out.jump(continuation); 1606 1607 m_out.appendTo(continuation, lastNext); 1608 setJSValue(m_out.phi(m_out.int64, fastResult, slowResult)); 1609 return; 1610 } 1611 1612 case Array::Generic: { 1613 setJSValue(vmCall( 1614 m_out.operation(operationGetByVal), m_callFrame, 1615 lowJSValue(m_node->child1()), lowJSValue(m_node->child2()))); 1474 1616 return; 1475 1617 } … … 1573 1715 Edge child3 = m_graph.varArgChild(m_node, 2); 1574 1716 Edge child4 = m_graph.varArgChild(m_node, 3); 1717 1718 switch (m_node->arrayMode().type()) { 1719 case Array::Generic: { 1720 V_JITOperation_EJJJ operation; 1721 if (m_node->op() == PutByValDirect) { 1722 if (m_graph.isStrictModeFor(m_node->codeOrigin)) 1723 operation = operationPutByValDirectStrict; 1724 else 1725 operation = operationPutByValDirectNonStrict; 1726 } else { 1727 if (m_graph.isStrictModeFor(m_node->codeOrigin)) 1728 operation = operationPutByValStrict; 1729 else 1730 operation = operationPutByValNonStrict; 1731 } 1732 1733 vmCall( 1734 m_out.operation(operation), m_callFrame, 1735 lowJSValue(child1), lowJSValue(child2), lowJSValue(child3)); 1736 return; 1737 } 1738 1739 default: 1740 break; 1741 } 1575 1742 1576 1743 LValue base = lowCell(child1); … … 1654 1821 1655 1822 if (isTypedView(type)) { 1656 if (m_node->op() == PutByVal) {1823 if (m_node->op() != PutByValAlias) { 1657 1824 speculate( 1658 1825 OutOfBounds, noValue(), 0, … … 1678 1845 intValue = lowInt32(child3); 1679 1846 else 1680 intValue = m_out.castToInt32(low Int52(child3));1847 intValue = m_out.castToInt32(lowStrictInt52(child3)); 1681 1848 1682 1849 if (isClamped(type)) { … … 1734 1901 m_out.appendTo(continuation, lastNext); 1735 1902 intValue = m_out.phi(m_out.int32, intValues); 1736 } else if (isSigned(type))1903 } else 1737 1904 intValue = doubleToInt32(doubleValue); 1738 else1739 intValue = doubleToUInt32(doubleValue);1740 1905 break; 1741 1906 } … … 2660 2825 } 2661 2826 2827 TypedPointer baseIndex(IndexedAbstractHeap& heap, LValue storage, LValue index, Edge edge) 2828 { 2829 return m_out.baseIndex( 2830 heap, storage, m_out.zeroExt(index, m_out.intPtr), 2831 m_state.forNode(edge).m_value); 2832 } 2833 2662 2834 LValue allocateCell(LValue allocator, LValue structure, LBasicBlock slowPath) 2663 2835 { … … 2832 3004 LValue length = m_out.load32(stringValue, m_heaps.JSString_length); 2833 3005 return m_out.notEqual(length, m_out.int32Zero); 3006 } 3007 case UntypedUse: { 3008 LValue value = lowJSValue(m_node->child1()); 3009 3010 LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped slow case")); 3011 LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped fast case")); 3012 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Boolify untyped continuation")); 3013 3014 m_out.branch(isNotBoolean(value), slowCase, fastCase); 3015 3016 LBasicBlock lastNext = m_out.appendTo(fastCase, slowCase); 3017 ValueFromBlock fastResult = m_out.anchor(unboxBoolean(value)); 3018 m_out.jump(continuation); 3019 3020 m_out.appendTo(slowCase, continuation); 3021 ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall( 3022 m_out.operation(operationConvertJSValueToBoolean), m_callFrame, value))); 3023 m_out.jump(continuation); 3024 3025 m_out.appendTo(continuation, lastNext); 3026 return m_out.phi(m_out.boolean, fastResult, slowResult); 2834 3027 } 2835 3028 default: … … 3049 3242 } 3050 3243 3051 LValue doubleToUInt32(LValue doubleValue)3052 {3053 if (Output::hasSensibleDoubleToInt())3054 return sensibleDoubleToInt32(doubleValue);3055 3056 return doubleToInt32(doubleValue, 0, pow(2, 32) - 1, false);3057 }3058 3059 3244 LValue sensibleDoubleToInt32(LValue doubleValue) 3060 3245 { … … 3287 3472 LValue lowCell(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation) 3288 3473 { 3289 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isCell(edge.useKind()));3474 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || DFG::isCell(edge.useKind())); 3290 3475 3291 3476 if (edge->op() == JSConstant) { … … 3594 3779 { 3595 3780 return m_out.testNonZero64(jsValue, m_tagMask); 3781 } 3782 3783 LValue isCell(LValue jsValue) 3784 { 3785 return m_out.testIsZero64(jsValue, m_tagMask); 3596 3786 } 3597 3787
Note:
See TracChangeset
for help on using the changeset viewer.