Changeset 205107 in webkit
- Timestamp:
- Aug 28, 2016, 4:31:46 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r205091 r205107 1 2016-08-28 Saam Barati <sbarati@apple.com> 2 3 Make SpeculatedType a 64-bit integer 4 https://bugs.webkit.org/show_bug.cgi?id=161268 5 6 Reviewed by Filip Pizlo and Benjamin Poulain. 7 8 I'm going to introduce two new types into this and we only 9 have room for one in 32-bits. So, this patch widens SpeculatedType 10 to 64 bits. This also pulls this information through the DFG where 11 we needed to change DFGNode to support this. 12 13 * bytecode/SpeculatedType.h: 14 * dfg/DFGNode.cpp: 15 (JSC::DFG::Node::convertToPutHint): 16 (JSC::DFG::Node::promotedLocationDescriptor): 17 * dfg/DFGNode.h: 18 (JSC::DFG::Node::Node): 19 (JSC::DFG::Node::convertToCheckStructure): 20 (JSC::DFG::Node::constant): 21 (JSC::DFG::Node::convertToConstant): 22 (JSC::DFG::Node::convertToConstantStoragePointer): 23 (JSC::DFG::Node::convertToPutStack): 24 (JSC::DFG::Node::convertToGetStack): 25 (JSC::DFG::Node::convertToGetByOffset): 26 (JSC::DFG::Node::convertToMultiGetByOffset): 27 (JSC::DFG::Node::convertToPutByOffset): 28 (JSC::DFG::Node::convertToMultiPutByOffset): 29 (JSC::DFG::Node::convertToPhantomNewObject): 30 (JSC::DFG::Node::convertToPhantomNewFunction): 31 (JSC::DFG::Node::convertToPhantomNewGeneratorFunction): 32 (JSC::DFG::Node::convertToPhantomCreateActivation): 33 (JSC::DFG::Node::convertToGetLocal): 34 (JSC::DFG::Node::lazyJSValue): 35 (JSC::DFG::Node::initializationValueForActivation): 36 (JSC::DFG::Node::tryGetVariableAccessData): 37 (JSC::DFG::Node::variableAccessData): 38 (JSC::DFG::Node::unlinkedLocal): 39 (JSC::DFG::Node::unlinkedMachineLocal): 40 (JSC::DFG::Node::stackAccessData): 41 (JSC::DFG::Node::phi): 42 (JSC::DFG::Node::identifierNumber): 43 (JSC::DFG::Node::getPutInfo): 44 (JSC::DFG::Node::accessorAttributes): 45 (JSC::DFG::Node::newArrayBufferData): 46 (JSC::DFG::Node::indexingType): 47 (JSC::DFG::Node::typedArrayType): 48 (JSC::DFG::Node::inlineCapacity): 49 (JSC::DFG::Node::scopeOffset): 50 (JSC::DFG::Node::capturedArgumentsOffset): 51 (JSC::DFG::Node::variablePointer): 52 (JSC::DFG::Node::callVarargsData): 53 (JSC::DFG::Node::loadVarargsData): 54 (JSC::DFG::Node::targetBytecodeOffsetDuringParsing): 55 (JSC::DFG::Node::targetBlock): 56 (JSC::DFG::Node::branchData): 57 (JSC::DFG::Node::switchData): 58 (JSC::DFG::Node::getHeapPrediction): 59 (JSC::DFG::Node::cellOperand): 60 (JSC::DFG::Node::watchpointSet): 61 (JSC::DFG::Node::storagePointer): 62 (JSC::DFG::Node::uidOperand): 63 (JSC::DFG::Node::typeInfoOperand): 64 (JSC::DFG::Node::transition): 65 (JSC::DFG::Node::structureSet): 66 (JSC::DFG::Node::structure): 67 (JSC::DFG::Node::storageAccessData): 68 (JSC::DFG::Node::multiGetByOffsetData): 69 (JSC::DFG::Node::multiPutByOffsetData): 70 (JSC::DFG::Node::objectMaterializationData): 71 (JSC::DFG::Node::arrayMode): 72 (JSC::DFG::Node::arithMode): 73 (JSC::DFG::Node::arithRoundingMode): 74 (JSC::DFG::Node::setArithRoundingMode): 75 (JSC::DFG::Node::executionCounter): 76 (JSC::DFG::Node::typeLocation): 77 (JSC::DFG::Node::basicBlockLocation): 78 (JSC::DFG::Node::numberOfArgumentsToSkip): 79 (JSC::DFG::Node::OpInfoWrapper::OpInfoWrapper): 80 (JSC::DFG::Node::OpInfoWrapper::operator=): 81 * dfg/DFGOpInfo.h: 82 (JSC::DFG::OpInfo::OpInfo): 83 * dfg/DFGPromotedHeapLocation.h: 84 (JSC::DFG::PromotedLocationDescriptor::imm1): 85 (JSC::DFG::PromotedLocationDescriptor::imm2): 86 1 87 2016-08-27 Don Olmstead <don.olmstead@am.sony.com> 2 88 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r200034 r205107 38 38 class Structure; 39 39 40 typedef uint 32_t SpeculatedType;40 typedef uint64_t SpeculatedType; 41 41 static const SpeculatedType SpecNone = 0; // We don't know anything yet. 42 42 static const SpeculatedType SpecFinalObject = 1u << 0; // It's definitely a JSFinalObject. -
trunk/Source/JavaScriptCore/dfg/DFGNode.cpp
r203808 r205107 159 159 m_op = LazyJSConstant; 160 160 m_flags &= ~NodeMustGenerate; 161 m_opInfo = bitwise_cast<uintptr_t>(graph.m_lazyJSValues.add(value));161 m_opInfo = graph.m_lazyJSValues.add(value); 162 162 children.reset(); 163 163 } … … 166 166 { 167 167 m_op = PutHint; 168 m_opInfo = descriptor.imm1() .m_value;169 m_opInfo2 = descriptor.imm2() .m_value;168 m_opInfo = descriptor.imm1(); 169 m_opInfo2 = descriptor.imm2(); 170 170 child1() = base->defaultEdge(); 171 171 child2() = value->defaultEdge(); … … 207 207 PromotedLocationDescriptor Node::promotedLocationDescriptor() 208 208 { 209 return PromotedLocationDescriptor(static_cast<PromotedLocationKind>(m_opInfo ), m_opInfo2);209 return PromotedLocationDescriptor(static_cast<PromotedLocationKind>(m_opInfo.as<uint32_t>()), m_opInfo2.as<uint32_t>()); 210 210 } 211 211 -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r204992 r205107 55 55 #include "TypeLocation.h" 56 56 #include "ValueProfile.h" 57 #include <type_traits> 57 58 #include <wtf/ListDump.h> 58 59 … … 255 256 , m_refCount(1) 256 257 , m_prediction(SpecNone) 257 , m_opInfo(0)258 , m_opInfo2(0)259 258 , owner(nullptr) 260 259 { … … 271 270 , m_refCount(1) 272 271 , m_prediction(SpecNone) 273 , m_opInfo(0)274 , m_opInfo2(0)275 272 , owner(nullptr) 276 273 { … … 289 286 , m_prediction(SpecNone) 290 287 , m_opInfo(imm.m_value) 291 , m_opInfo2(0)292 288 , owner(nullptr) 293 289 { … … 305 301 , m_prediction(SpecNone) 306 302 , m_opInfo(imm.m_value) 307 , m_opInfo2(0)308 303 , owner(nullptr) 309 304 { … … 407 402 { 408 403 setOpAndDefaultFlags(CheckStructure); 409 m_opInfo = bitwise_cast<uintptr_t>(set);404 m_opInfo = set; 410 405 } 411 406 … … 472 467 } 473 468 474 return bitwise_cast<FrozenValue*>(m_opInfo);469 return m_opInfo.as<FrozenValue*>(); 475 470 } 476 471 … … 485 480 m_op = JSConstant; 486 481 m_flags &= ~NodeMustGenerate; 487 m_opInfo = bitwise_cast<uintptr_t>(value);482 m_opInfo = value; 488 483 children.reset(); 489 484 } … … 495 490 ASSERT(op() == GetIndexedPropertyStorage); 496 491 m_op = ConstantStoragePointer; 497 m_opInfo = bitwise_cast<uintptr_t>(pointer);492 m_opInfo = pointer; 498 493 children.reset(); 499 494 } … … 512 507 m_op = PutStack; 513 508 m_flags |= NodeMustGenerate; 514 m_opInfo = bitwise_cast<uintptr_t>(data);515 m_opInfo2 = 0;509 m_opInfo = data; 510 m_opInfo2 = OpInfoWrapper(); 516 511 } 517 512 … … 520 515 m_op = GetStack; 521 516 m_flags &= ~NodeMustGenerate; 522 m_opInfo = bitwise_cast<uintptr_t>(data);523 m_opInfo2 = 0;517 m_opInfo = data; 518 m_opInfo2 = OpInfoWrapper(); 524 519 children.reset(); 525 520 } … … 528 523 { 529 524 ASSERT(m_op == GetById || m_op == GetByIdFlush || m_op == MultiGetByOffset); 530 m_opInfo = bitwise_cast<uintptr_t>(&data);525 m_opInfo = &data; 531 526 children.setChild1(storage); 532 527 children.setChild2(base); … … 538 533 { 539 534 ASSERT(m_op == GetById || m_op == GetByIdFlush); 540 m_opInfo = bitwise_cast<intptr_t>(data);535 m_opInfo = data; 541 536 child1().setUseKind(CellUse); 542 537 m_op = MultiGetByOffset; … … 547 542 { 548 543 ASSERT(m_op == PutById || m_op == PutByIdDirect || m_op == PutByIdFlush || m_op == MultiPutByOffset); 549 m_opInfo = bitwise_cast<uintptr_t>(&data);544 m_opInfo = &data; 550 545 children.setChild3(children.child2()); 551 546 children.setChild2(base); … … 557 552 { 558 553 ASSERT(m_op == PutById || m_op == PutByIdDirect || m_op == PutByIdFlush); 559 m_opInfo = bitwise_cast<intptr_t>(data);554 m_opInfo = data; 560 555 m_op = MultiPutByOffset; 561 556 } … … 573 568 m_flags &= ~NodeHasVarArgs; 574 569 m_flags |= NodeMustGenerate; 575 m_opInfo = 0;576 m_opInfo2 = 0;570 m_opInfo = OpInfoWrapper(); 571 m_opInfo2 = OpInfoWrapper(); 577 572 children = AdjacencyList(); 578 573 } … … 583 578 m_op = PhantomNewFunction; 584 579 m_flags |= NodeMustGenerate; 585 m_opInfo = 0;586 m_opInfo2 = 0;580 m_opInfo = OpInfoWrapper(); 581 m_opInfo2 = OpInfoWrapper(); 587 582 children = AdjacencyList(); 588 583 } … … 593 588 m_op = PhantomNewGeneratorFunction; 594 589 m_flags |= NodeMustGenerate; 595 m_opInfo = 0;596 m_opInfo2 = 0;590 m_opInfo = OpInfoWrapper(); 591 m_opInfo2 = OpInfoWrapper(); 597 592 children = AdjacencyList(); 598 593 } … … 604 599 m_flags &= ~NodeHasVarArgs; 605 600 m_flags |= NodeMustGenerate; 606 m_opInfo = 0;607 m_opInfo2 = 0;601 m_opInfo = OpInfoWrapper(); 602 m_opInfo2 = OpInfoWrapper(); 608 603 children = AdjacencyList(); 609 604 } … … 628 623 ASSERT(m_op == GetLocalUnlinked); 629 624 m_op = GetLocal; 630 m_opInfo = bitwise_cast<uintptr_t>(variable);631 m_opInfo2 = 0;625 m_opInfo = variable; 626 m_opInfo2 = OpInfoWrapper(); 632 627 children.setChild1(Edge(phi)); 633 628 } … … 739 734 { 740 735 ASSERT(hasLazyJSValue()); 741 return * bitwise_cast<LazyJSValue*>(m_opInfo);736 return *m_opInfo.as<LazyJSValue*>(); 742 737 } 743 738 … … 747 742 { 748 743 ASSERT(op() == CreateActivation); 749 return bitwise_cast<FrozenValue*>(m_opInfo2)->value();744 return m_opInfo2.as<FrozenValue*>()->value(); 750 745 } 751 746 … … 815 810 VariableAccessData* tryGetVariableAccessData() 816 811 { 817 VariableAccessData* result = reinterpret_cast<VariableAccessData*>(m_opInfo);812 VariableAccessData* result = m_opInfo.as<VariableAccessData*>(); 818 813 if (!result) 819 814 return 0; … … 823 818 VariableAccessData* variableAccessData() 824 819 { 825 return reinterpret_cast<VariableAccessData*>(m_opInfo)->find();820 return m_opInfo.as<VariableAccessData*>()->find(); 826 821 } 827 822 … … 853 848 { 854 849 ASSERT(hasUnlinkedLocal()); 855 return static_cast<VirtualRegister>(m_opInfo);850 return VirtualRegister(m_opInfo.as<int32_t>()); 856 851 } 857 852 … … 870 865 { 871 866 ASSERT(hasUnlinkedMachineLocal()); 872 return VirtualRegister(m_opInfo2 );867 return VirtualRegister(m_opInfo2.as<int32_t>()); 873 868 } 874 869 … … 887 882 { 888 883 ASSERT(hasStackAccessData()); 889 return bitwise_cast<StackAccessData*>(m_opInfo);884 return m_opInfo.as<StackAccessData*>(); 890 885 } 891 886 … … 898 893 { 899 894 ASSERT(hasPhi()); 900 return bitwise_cast<Node*>(m_opInfo);895 return m_opInfo.as<Node*>(); 901 896 } 902 897 … … 933 928 { 934 929 ASSERT(hasIdentifier()); 935 return m_opInfo ;930 return m_opInfo.as<unsigned>(); 936 931 } 937 932 … … 950 945 { 951 946 ASSERT(hasGetPutInfo()); 952 return m_opInfo2 ;947 return m_opInfo2.as<unsigned>(); 953 948 } 954 949 … … 974 969 case PutSetterById: 975 970 case PutGetterSetterById: 976 return m_opInfo2 ;971 return m_opInfo2.as<int32_t>(); 977 972 case PutGetterByVal: 978 973 case PutSetterByVal: 979 return m_opInfo ;974 return m_opInfo.as<int32_t>(); 980 975 default: 981 976 RELEASE_ASSERT_NOT_REACHED(); … … 1025 1020 { 1026 1021 ASSERT(hasConstantBuffer()); 1027 return reinterpret_cast<NewArrayBufferData*>(m_opInfo);1022 return m_opInfo.as<NewArrayBufferData*>(); 1028 1023 } 1029 1024 … … 1063 1058 if (op() == NewArrayBuffer) 1064 1059 return newArrayBufferData()->indexingType; 1065 return m_opInfo;1060 return static_cast<IndexingType>(m_opInfo.as<uint32_t>()); 1066 1061 } 1067 1062 … … 1079 1074 { 1080 1075 ASSERT(hasTypedArrayType()); 1081 TypedArrayType result = static_cast<TypedArrayType>(m_opInfo );1076 TypedArrayType result = static_cast<TypedArrayType>(m_opInfo.as<uint32_t>()); 1082 1077 ASSERT(isTypedView(result)); 1083 1078 return result; … … 1092 1087 { 1093 1088 ASSERT(hasInlineCapacity()); 1094 return m_opInfo ;1089 return m_opInfo.as<unsigned>(); 1095 1090 } 1096 1091 … … 1109 1104 { 1110 1105 ASSERT(hasScopeOffset()); 1111 return ScopeOffset(m_opInfo );1106 return ScopeOffset(m_opInfo.as<uint32_t>()); 1112 1107 } 1113 1108 … … 1120 1115 { 1121 1116 ASSERT(hasDirectArgumentsOffset()); 1122 return DirectArgumentsOffset(m_opInfo );1117 return DirectArgumentsOffset(m_opInfo.as<uint32_t>()); 1123 1118 } 1124 1119 … … 1130 1125 WriteBarrier<Unknown>* variablePointer() 1131 1126 { 1132 return bitwise_cast<WriteBarrier<Unknown>*>(m_opInfo);1127 return m_opInfo.as<WriteBarrier<Unknown>*>(); 1133 1128 } 1134 1129 … … 1153 1148 { 1154 1149 ASSERT(hasCallVarargsData()); 1155 return bitwise_cast<CallVarargsData*>(m_opInfo);1150 return m_opInfo.as<CallVarargsData*>(); 1156 1151 } 1157 1152 … … 1164 1159 { 1165 1160 ASSERT(hasLoadVarargsData()); 1166 return bitwise_cast<LoadVarargsData*>(m_opInfo);1161 return m_opInfo.as<LoadVarargsData*>(); 1167 1162 } 1168 1163 … … 1260 1255 { 1261 1256 ASSERT(isJump()); 1262 return m_opInfo ;1257 return m_opInfo.as<unsigned>(); 1263 1258 } 1264 1259 … … 1266 1261 { 1267 1262 ASSERT(isJump()); 1268 return *bitwise_cast<BasicBlock**>(&m_opInfo );1263 return *bitwise_cast<BasicBlock**>(&m_opInfo.u.pointer); 1269 1264 } 1270 1265 … … 1272 1267 { 1273 1268 ASSERT(isBranch()); 1274 return bitwise_cast<BranchData*>(m_opInfo);1269 return m_opInfo.as<BranchData*>(); 1275 1270 } 1276 1271 … … 1278 1273 { 1279 1274 ASSERT(isSwitch()); 1280 return bitwise_cast<SwitchData*>(m_opInfo);1275 return m_opInfo.as<SwitchData*>(); 1281 1276 } 1282 1277 … … 1438 1433 { 1439 1434 ASSERT(hasHeapPrediction()); 1440 return static_cast<SpeculatedType>(m_opInfo2);1435 return m_opInfo2.as<SpeculatedType>(); 1441 1436 } 1442 1437 … … 1467 1462 { 1468 1463 ASSERT(hasCellOperand()); 1469 return reinterpret_cast<FrozenValue*>(m_opInfo);1464 return m_opInfo.as<FrozenValue*>(); 1470 1465 } 1471 1466 … … 1479 1474 { 1480 1475 ASSERT(hasCellOperand()); 1481 m_opInfo = bitwise_cast<uintptr_t>(value);1476 m_opInfo = value; 1482 1477 } 1483 1478 … … 1490 1485 { 1491 1486 ASSERT(hasWatchpointSet()); 1492 return reinterpret_cast<WatchpointSet*>(m_opInfo);1487 return m_opInfo.as<WatchpointSet*>(); 1493 1488 } 1494 1489 … … 1501 1496 { 1502 1497 ASSERT(hasStoragePointer()); 1503 return reinterpret_cast<void*>(m_opInfo);1498 return m_opInfo.as<void*>(); 1504 1499 } 1505 1500 … … 1512 1507 { 1513 1508 ASSERT(hasUidOperand()); 1514 return reinterpret_cast<UniquedStringImpl*>(m_opInfo);1509 return m_opInfo.as<UniquedStringImpl*>(); 1515 1510 } 1516 1511 … … 1522 1517 unsigned typeInfoOperand() 1523 1518 { 1524 ASSERT(hasTypeInfoOperand() && m_opInfo <= UCHAR_MAX);1525 return static_cast<unsigned>(m_opInfo);1519 ASSERT(hasTypeInfoOperand() && m_opInfo.as<uint32_t>() <= static_cast<uint32_t>(UCHAR_MAX)); 1520 return m_opInfo.as<uint32_t>(); 1526 1521 } 1527 1522 … … 1541 1536 { 1542 1537 ASSERT(hasTransition()); 1543 return reinterpret_cast<Transition*>(m_opInfo);1538 return m_opInfo.as<Transition*>(); 1544 1539 } 1545 1540 … … 1559 1554 { 1560 1555 ASSERT(hasStructureSet()); 1561 return * reinterpret_cast<StructureSet*>(m_opInfo);1556 return *m_opInfo.as<StructureSet*>(); 1562 1557 } 1563 1558 … … 1577 1572 { 1578 1573 ASSERT(hasStructure()); 1579 return reinterpret_cast<Structure*>(m_opInfo);1574 return m_opInfo.as<Structure*>(); 1580 1575 } 1581 1576 … … 1595 1590 { 1596 1591 ASSERT(hasStorageAccessData()); 1597 return * bitwise_cast<StorageAccessData*>(m_opInfo);1592 return *m_opInfo.as<StorageAccessData*>(); 1598 1593 } 1599 1594 … … 1606 1601 { 1607 1602 ASSERT(hasMultiGetByOffsetData()); 1608 return * reinterpret_cast<MultiGetByOffsetData*>(m_opInfo);1603 return *m_opInfo.as<MultiGetByOffsetData*>(); 1609 1604 } 1610 1605 … … 1617 1612 { 1618 1613 ASSERT(hasMultiPutByOffsetData()); 1619 return * reinterpret_cast<MultiPutByOffsetData*>(m_opInfo);1614 return *m_opInfo.as<MultiPutByOffsetData*>(); 1620 1615 } 1621 1616 … … 1635 1630 { 1636 1631 ASSERT(hasObjectMaterializationData()); 1637 return * reinterpret_cast<ObjectMaterializationData*>(m_opInfo2);1632 return *m_opInfo2.as<ObjectMaterializationData*>(); 1638 1633 } 1639 1634 … … 1744 1739 ASSERT(hasArrayMode()); 1745 1740 if (op() == ArrayifyToStructure) 1746 return ArrayMode::fromWord(m_opInfo2 );1747 return ArrayMode::fromWord(m_opInfo );1741 return ArrayMode::fromWord(m_opInfo2.as<uint32_t>()); 1742 return ArrayMode::fromWord(m_opInfo.as<uint32_t>()); 1748 1743 } 1749 1744 … … 1778 1773 { 1779 1774 ASSERT(hasArithMode()); 1780 return static_cast<Arith::Mode>(m_opInfo );1775 return static_cast<Arith::Mode>(m_opInfo.as<uint32_t>()); 1781 1776 } 1782 1777 … … 1794 1789 { 1795 1790 ASSERT(hasArithRoundingMode()); 1796 return static_cast<Arith::RoundingMode>(m_opInfo );1791 return static_cast<Arith::RoundingMode>(m_opInfo.as<uint32_t>()); 1797 1792 } 1798 1793 … … 1800 1795 { 1801 1796 ASSERT(hasArithRoundingMode()); 1802 m_opInfo = static_cast<uint ptr_t>(mode);1797 m_opInfo = static_cast<uint32_t>(mode); 1803 1798 } 1804 1799 … … 1829 1824 Profiler::ExecutionCounter* executionCounter() 1830 1825 { 1831 return bitwise_cast<Profiler::ExecutionCounter*>(m_opInfo);1826 return m_opInfo.as<Profiler::ExecutionCounter*>(); 1832 1827 } 1833 1828 … … 2272 2267 { 2273 2268 ASSERT(hasTypeLocation()); 2274 return reinterpret_cast<TypeLocation*>(m_opInfo);2269 return m_opInfo.as<TypeLocation*>(); 2275 2270 } 2276 2271 … … 2283 2278 { 2284 2279 ASSERT(hasBasicBlockLocation()); 2285 return reinterpret_cast<BasicBlockLocation*>(m_opInfo);2280 return m_opInfo.as<BasicBlockLocation*>(); 2286 2281 } 2287 2282 … … 2309 2304 { 2310 2305 ASSERT(op() == CreateRest || op() == GetRestLength); 2311 return static_cast<unsigned>(m_opInfo);2306 return m_opInfo.as<unsigned>(); 2312 2307 } 2313 2308 … … 2346 2341 // Immediate values, accesses type-checked via accessors above. The first one is 2347 2342 // big enough to store a pointer. 2348 uintptr_t m_opInfo; 2349 uintptr_t m_opInfo2; 2343 struct OpInfoWrapper { 2344 OpInfoWrapper() 2345 { 2346 u.int64 = 0; 2347 } 2348 OpInfoWrapper(uint32_t intValue) 2349 { 2350 u.int64 = 0; 2351 u.int32 = intValue; 2352 } 2353 OpInfoWrapper(uint64_t intValue) 2354 { 2355 u.int64 = intValue; 2356 } 2357 OpInfoWrapper(void* pointer) 2358 { 2359 u.int64 = 0; 2360 u.pointer = pointer; 2361 } 2362 OpInfoWrapper& operator=(uint32_t int32) 2363 { 2364 u.int64 = 0; 2365 u.int32 = int32; 2366 return *this; 2367 } 2368 OpInfoWrapper& operator=(int32_t int32) 2369 { 2370 u.int64 = 0; 2371 u.int32 = int32; 2372 return *this; 2373 } 2374 OpInfoWrapper& operator=(uint64_t int64) 2375 { 2376 u.int64 = int64; 2377 return *this; 2378 } 2379 OpInfoWrapper& operator=(void* pointer) 2380 { 2381 u.int64 = 0; 2382 u.pointer = pointer; 2383 return *this; 2384 } 2385 template <typename T> 2386 ALWAYS_INLINE auto as() const -> typename std::enable_if<std::is_pointer<T>::value, T>::type 2387 { 2388 return static_cast<T>(u.pointer); 2389 } 2390 template <typename T> 2391 ALWAYS_INLINE auto as() const -> typename std::enable_if<std::is_integral<T>::value && sizeof(T) == 4, T>::type 2392 { 2393 return u.int32; 2394 } 2395 template <typename T> 2396 ALWAYS_INLINE auto as() const -> typename std::enable_if<std::is_integral<T>::value && sizeof(T) == 8, T>::type 2397 { 2398 return u.int64; 2399 } 2400 union { 2401 uint32_t int32; 2402 uint64_t int64; 2403 void* pointer; 2404 } u; 2405 }; 2406 OpInfoWrapper m_opInfo; 2407 OpInfoWrapper m_opInfo2; 2350 2408 2351 2409 // Miscellaneous data that is usually meaningless, but can hold some analysis results -
trunk/Source/JavaScriptCore/dfg/DFGOpInfo.h
r199075 r205107 38 38 struct OpInfo { 39 39 OpInfo() : m_value(0) { } 40 explicit OpInfo(int32_t value) : m_value(static_cast<uintptr_t>(value)) { } 41 explicit OpInfo(uint32_t value) : m_value(static_cast<uintptr_t>(value)) { } 42 #if OS(DARWIN) || USE(JSVALUE64) 43 explicit OpInfo(size_t value) : m_value(static_cast<uintptr_t>(value)) { } 40 explicit OpInfo(int32_t value) : m_value(static_cast<uint64_t>(value)) { } 41 explicit OpInfo(uint32_t value) : m_value(static_cast<uint64_t>(value)) { } 42 explicit OpInfo(uint64_t value) : m_value(static_cast<uint64_t>(value)) { } 43 #if OS(DARWIN) 44 explicit OpInfo(uintptr_t value) : m_value(static_cast<uint64_t>(value)) { } 44 45 #endif 45 explicit OpInfo(void* value) : m_value( reinterpret_cast<uintptr_t>(value)) { }46 uint ptr_t m_value;46 explicit OpInfo(void* value) : m_value(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(value))) { } 47 uint64_t m_value; 47 48 }; 48 49 -
trunk/Source/JavaScriptCore/dfg/DFGPromotedHeapLocation.h
r199075 r205107 88 88 unsigned info() const { return m_info; } 89 89 90 OpInfo imm1() const { return OpInfo(static_cast<uint32_t>(m_kind)); }91 OpInfo imm2() const { return OpInfo(static_cast<uint32_t>(m_info)); }90 unsigned imm1() const { return static_cast<uint32_t>(m_kind); } 91 unsigned imm2() const { return static_cast<uint32_t>(m_info); } 92 92 93 93 unsigned hash() const
Note:
See TracChangeset
for help on using the changeset viewer.