Lines Matching refs:__
1398 #define __ gasm()->
1408 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1409 auto if_heapnumber = __ MakeDeferredLabel();
1410 auto if_int32 = __ MakeLabel();
1412 Node* value32 = __ RoundFloat64ToInt32(value);
1413 __ GotoIf(__ Float64Equal(value, __ ChangeInt32ToFloat64(value32)),
1415 __ Goto(&if_heapnumber);
1417 __ Bind(&if_int32);
1420 Node* zero = __ Int32Constant(0);
1421 auto if_zero = __ MakeDeferredLabel();
1422 auto if_smi = __ MakeLabel();
1424 __ GotoIf(__ Word32Equal(value32, zero), &if_zero);
1425 __ Goto(&if_smi);
1427 __ Bind(&if_zero);
1430 __ GotoIf(__ Int32LessThan(__ Float64ExtractHighWord32(value), zero),
1432 __ Goto(&if_smi);
1435 __ Bind(&if_smi);
1440 __ Goto(&done, value_smi);
1446 __ Bind(&if_heapnumber);
1449 __ Goto(&done, value_number);
1452 __ Bind(&done);
1467 auto if_true = __ MakeLabel();
1468 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1470 __ GotoIf(value, &if_true);
1471 __ Goto(&done, __ FalseConstant());
1473 __ Bind(&if_true);
1474 __ Goto(&done, __ TrueConstant());
1476 __ Bind(&done);
1496 auto if_overflow = __ MakeDeferredLabel();
1497 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1501 __ Bind(&if_overflow);
1502 Node* number = AllocateHeapNumberWithValue(__ ChangeInt32ToFloat64(value));
1503 __ Goto(&done, number);
1505 __ Bind(&done);
1512 auto if_not_in_smi_range = __ MakeDeferredLabel();
1513 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1515 Node* value32 = __ TruncateInt64ToInt32(value);
1516 __ GotoIfNot(__ Word64Equal(__ ChangeInt32ToInt64(value32), value),
1521 __ Goto(&done, value_smi);
1526 __ Bind(&if_not_in_smi_range);
1527 Node* number = AllocateHeapNumberWithValue(__ ChangeInt64ToFloat64(value));
1528 __ Goto(&done, number);
1530 __ Bind(&done);
1540 auto if_not_in_smi_range = __ MakeDeferredLabel();
1541 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1543 Node* check = __ Uint32LessThanOrEqual(value, SmiMaxValueConstant());
1544 __ GotoIfNot(check, &if_not_in_smi_range);
1545 __ Goto(&done, ChangeUint32ToSmi(value));
1547 __ Bind(&if_not_in_smi_range);
1548 Node* number = AllocateHeapNumberWithValue(__ ChangeUint32ToFloat64(value));
1550 __ Goto(&done, number);
1551 __ Bind(&done);
1559 auto if_not_in_smi_range = __ MakeDeferredLabel();
1560 auto done = __ MakeLabel(MachineRepresentation::kTagged);
1563 __ Uint64LessThanOrEqual(value, __ Int64Constant(Smi::kMaxValue));
1564 __ GotoIfNot(check, &if_not_in_smi_range);
1565 __ Goto(&done, ChangeInt64ToSmi(value));
1567 __ Bind(&if_not_in_smi_range);
1568 Node* number = AllocateHeapNumberWithValue(__ ChangeInt64ToFloat64(value));
1570 __ Goto(&done, number);
1571 __ Bind(&done);
1588 return __ TaggedEqual(value, __ TrueConstant());
1595 auto if_heapnumber = __ MakeDeferredLabel();
1596 auto if_bigint = __ MakeDeferredLabel();
1598 Node* zero = __ Int32Constant(0);
1599 Node* fzero = __ Float64Constant(0.0);
1602 __ GotoIf(__ TaggedEqual(value, __ FalseConstant()), done, zero);
1605 __ GotoIf(__ TaggedEqual(value, __ EmptyStringConstant()), done, zero);
1608 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1613 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
1614 __ GotoIfNot(
1615 __ Word32Equal(
1616 __ Word32And(value_map_bitfield,
1617 __ Int32Constant(Map::Bits1::IsUndetectableBit::kMask)),
1622 __ GotoIf(__ TaggedEqual(value_map, __ HeapNumberMapConstant()),
1626 __ GotoIf(__ TaggedEqual(value_map, __ BigIntMapConstant()), &if_bigint);
1629 __ Goto(done, __ Int32Constant(1));
1631 __ Bind(&if_heapnumber);
1636 __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1637 __ Goto(done, __ Float64LessThan(fzero, __ Float64Abs(value_value)));
1640 __ Bind(&if_bigint);
1642 Node* bitfield = __ LoadField(AccessBuilder::ForBigIntBitfield(), value);
1643 Node* length_is_zero = __ Word32Equal(
1644 __ Word32And(bitfield, __ Int32Constant(BigInt::LengthBits::kMask)),
1645 __ Int32Constant(0));
1646 __ Goto(done, __ Word32Equal(length_is_zero, zero));
1651 auto done = __ MakeLabel(MachineRepresentation::kBit);
1652 auto if_smi = __ MakeDeferredLabel();
1655 __ GotoIf(ObjectIsSmi(value), &if_smi);
1659 __ Bind(&if_smi);
1662 __ Goto(&done, __ Word32Equal(__ TaggedEqual(value, __ SmiConstant(0)),
1663 __ Int32Constant(0)));
1666 __ Bind(&done);
1671 auto done = __ MakeLabel(MachineRepresentation::kBit);
1675 __ Bind(&done);
1682 auto if_not_smi = __ MakeDeferredLabel();
1683 auto done = __ MakeLabel(MachineRepresentation::kWord32);
1686 __ GotoIfNot(check, &if_not_smi);
1687 __ Goto(&done, ChangeSmiToInt32(value));
1689 __ Bind(&if_not_smi);
1692 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1693 vfalse = __ ChangeFloat64ToInt32(vfalse);
1694 __ Goto(&done, vfalse);
1696 __ Bind(&done);
1703 auto if_not_smi = __ MakeDeferredLabel();
1704 auto done = __ MakeLabel(MachineRepresentation::kWord32);
1707 __ GotoIfNot(check, &if_not_smi);
1708 __ Goto(&done, ChangeSmiToInt32(value));
1710 __ Bind(&if_not_smi);
1713 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1714 vfalse = __ ChangeFloat64ToUint32(vfalse);
1715 __ Goto(&done, vfalse);
1717 __ Bind(&done);
1724 auto if_not_smi = __ MakeDeferredLabel();
1725 auto done = __ MakeLabel(MachineRepresentation::kWord64);
1728 __ GotoIfNot(check, &if_not_smi);
1729 __ Goto(&done, ChangeSmiToInt64(value));
1731 __ Bind(&if_not_smi);
1734 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1735 vfalse = __ ChangeFloat64ToInt64(vfalse);
1736 __ Goto(&done, vfalse);
1738 __ Bind(&done);
1749 auto if_not_smi = __ MakeDeferredLabel();
1750 auto done = __ MakeLabel(MachineRepresentation::kWord32);
1753 __ GotoIfNot(check, &if_not_smi);
1754 __ Goto(&done, value);
1756 __ Bind(&if_not_smi);
1759 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1760 vfalse = __ ChangeFloat64ToInt32(vfalse);
1762 __ Goto(&done, vfalse);
1764 __ Bind(&done);
1771 auto if_not_smi = __ MakeDeferredLabel();
1772 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
1775 __ GotoIfNot(check, &if_not_smi);
1777 vtrue = __ ChangeInt32ToFloat64(vtrue);
1778 __ Goto(&done, vtrue);
1780 __ Bind(&if_not_smi);
1783 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
1784 __ Goto(&done, vfalse);
1786 __ Bind(&done);
1796 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1798 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
1799 Node* check_instance_type = __ Uint32LessThanOrEqual(
1800 __ Int32Sub(value_instance_type,
1801 __ Int32Constant(FIRST_JS_FUNCTION_TYPE)),
1802 __ Int32Constant(LAST_JS_FUNCTION_TYPE - FIRST_JS_FUNCTION_TYPE));
1803 __ DeoptimizeIfNot(DeoptimizeReason::kWrongCallTarget, FeedbackSource(),
1809 __ LoadField(AccessBuilder::ForJSFunctionFeedbackCell(), value);
1810 Node* check_cell = __ WordEqual(value_cell, __ HeapConstant(feedback_cell));
1811 __ DeoptimizeIfNot(DeoptimizeReason::kWrongFeedbackCell, FeedbackSource(),
1820 Node* bitfield3 = __ LoadField(AccessBuilder::ForMapBitField3(), value_map);
1821 Node* is_not_deprecated = __ Word32Equal(
1822 __ Word32And(bitfield3,
1823 __ Int32Constant(Map::Bits3::IsDeprecatedBit::kMask)),
1824 __ Int32Constant(0));
1825 __ DeoptimizeIf(reason, feedback_source, is_not_deprecated, frame_state);
1830 Node* result = __ Call(call_descriptor, __ CEntryStubConstant(1), value,
1831 __ ExternalConstant(ExternalReference::Create(id)),
1832 __ Int32Constant(1), __ NoContextConstant());
1834 __ DeoptimizeIf(DeoptimizeReason::kInstanceMigrationFailed, feedback_source,
1846 auto done = __ MakeLabel();
1847 auto migrate = __ MakeDeferredLabel();
1850 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1854 Node* map = __ HeapConstant(maps[i]);
1855 Node* check = __ TaggedEqual(value_map, map);
1857 __ BranchWithCriticalSafetyCheck(check, &done, &migrate);
1859 auto next_map = __ MakeLabel();
1860 __ BranchWithCriticalSafetyCheck(check, &done, &next_map);
1861 __ Bind(&next_map);
1866 __ Bind(&migrate);
1871 value_map = __ LoadField(AccessBuilder::ForMap(), value);
1875 Node* map = __ HeapConstant(maps[i]);
1876 Node* check = __ TaggedEqual(value_map, map);
1878 __ DeoptimizeIfNot(DeoptimizeReason::kWrongMap, p.feedback(), check,
1881 auto next_map = __ MakeLabel();
1882 __ BranchWithCriticalSafetyCheck(check, &done, &next_map);
1883 __ Bind(&next_map);
1887 __ Goto(&done);
1888 __ Bind(&done);
1890 auto done = __ MakeLabel();
1893 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1896 Node* map = __ HeapConstant(maps[i]);
1897 Node* check = __ TaggedEqual(value_map, map);
1900 __ DeoptimizeIfNot(DeoptimizeReason::kWrongMap, p.feedback(), check,
1903 auto next_map = __ MakeLabel();
1904 __ BranchWithCriticalSafetyCheck(check, &done, &next_map);
1905 __ Bind(&next_map);
1908 __ Goto(&done);
1909 __ Bind(&done);
1914 auto done = __ MakeLabel();
1916 Node* bitfield3 = __ LoadField(AccessBuilder::ForMapBitField3(), value_map);
1917 Node* is_not_deprecated = __ Word32Equal(
1918 __ Word32And(bitfield3,
1919 __ Int32Constant(Map::Bits3::IsDeprecatedBit::kMask)),
1920 __ Int32Constant(0));
1921 __ GotoIf(is_not_deprecated, &done);
1926 __ Call(call_descriptor, __ CEntryStubConstant(1), value,
1927 __ ExternalConstant(ExternalReference::Create(id)),
1928 __ Int32Constant(1), __ NoContextConstant());
1929 __ Goto(&done);
1930 __ Bind(&done);
1938 auto done = __ MakeLabel(MachineRepresentation::kBit);
1941 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1944 Node* map = __ HeapConstant(maps[i]);
1945 Node* check = __ TaggedEqual(value_map, map);
1947 auto next_map = __ MakeLabel();
1948 auto passed = __ MakeLabel();
1949 __ BranchWithCriticalSafetyCheck(check, &passed, &next_map);
1951 __ Bind(&passed);
1952 __ Goto(&done, __ Int32Constant(1));
1954 __ Bind(&next_map);
1956 __ Goto(&done, __ Int32Constant(0));
1958 __ Bind(&done);
1966 auto if_not_smi = __ MakeDeferredLabel();
1967 auto done = __ MakeLabel();
1970 __ GotoIfNot(check0, &if_not_smi);
1971 __ Goto(&done);
1973 __ Bind(&if_not_smi);
1974 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1975 Node* check1 = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
1976 __ DeoptimizeIfNot(DeoptimizeReason::kNotAHeapNumber, params.feedback(),
1978 __ Goto(&done);
1980 __ Bind(&done);
1988 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1990 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
1993 Node* check = __ Uint32LessThanOrEqual(
1994 __ Uint32Constant(FIRST_JS_RECEIVER_TYPE), value_instance_type);
1995 __ DeoptimizeIfNot(DeoptimizeReason::kNotAJavaScriptObject, FeedbackSource(),
2004 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2006 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
2011 Node* check0 = __ Uint32LessThanOrEqual(__ Uint32Constant(ODDBALL_TYPE),
2013 __ DeoptimizeIfNot(DeoptimizeReason::kNotAJavaScriptObjectOrNullOrUndefined,
2017 Node* check1 = __ TaggedEqual(value_map, __ BooleanMapConstant());
2018 __ DeoptimizeIf(DeoptimizeReason::kNotAJavaScriptObjectOrNullOrUndefined,
2026 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2029 __ TaggedEqual(value_map, __ HeapConstant(factory()->symbol_map()));
2030 __ DeoptimizeIfNot(DeoptimizeReason::kNotASymbol, FeedbackSource(), check,
2039 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2041 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
2043 Node* check = __ Uint32LessThan(value_instance_type,
2044 __ Uint32Constant(FIRST_NONSTRING_TYPE));
2045 __ DeoptimizeIfNot(DeoptimizeReason::kNotAString, params.feedback(), check,
2054 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2056 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
2058 Node* check = __ Word32Equal(
2059 __ Word32And(value_instance_type,
2060 __ Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)),
2061 __ Int32Constant(kInternalizedTag));
2062 __ DeoptimizeIfNot(DeoptimizeReason::kWrongInstanceType, FeedbackSource(),
2071 __ DeoptimizeIfNot(p.reason(), p.feedback(), value, frame_state);
2085 Node* value = __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs,
2086 rhs, __ NoContextConstant());
2096 Node* value = __ Int32AddWithOverflow(lhs, rhs);
2097 Node* check = __ Projection(1, value);
2098 __ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
2100 return __ Projection(0, value);
2108 Node* value = __ Int32SubWithOverflow(lhs, rhs);
2109 Node* check = __ Projection(1, value);
2110 __ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
2112 return __ Projection(0, value);
2119 Node* zero = __ Int32Constant(0);
2130 Node* mask = __ Int32Constant(divisor - 1);
2131 Node* shift = __ Int32Constant(base::bits::WhichPowerOfTwo(divisor));
2132 Node* check = __ Word32Equal(__ Word32And(lhs, mask), zero);
2133 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
2135 return __ Word32Sar(lhs, shift);
2137 auto if_rhs_positive = __ MakeLabel();
2138 auto if_rhs_negative = __ MakeDeferredLabel();
2139 auto done = __ MakeLabel(MachineRepresentation::kWord32);
2142 Node* check_rhs_positive = __ Int32LessThan(zero, rhs);
2143 __ Branch(check_rhs_positive, &if_rhs_positive, &if_rhs_negative);
2145 __ Bind(&if_rhs_positive);
2148 __ Goto(&done, __ Int32Div(lhs, rhs));
2151 __ Bind(&if_rhs_negative);
2153 auto if_lhs_minint = __ MakeDeferredLabel();
2154 auto if_lhs_notminint = __ MakeLabel();
2157 Node* check_rhs_zero = __ Word32Equal(rhs, zero);
2158 __ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(),
2162 Node* check_lhs_zero = __ Word32Equal(lhs, zero);
2163 __ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(),
2168 Node* check_lhs_minint = __ Word32Equal(lhs, __ Int32Constant(kMinInt));
2169 __ Branch(check_lhs_minint, &if_lhs_minint, &if_lhs_notminint);
2171 __ Bind(&if_lhs_minint);
2174 Node* check_rhs_minusone = __ Word32Equal(rhs, __ Int32Constant(-1));
2175 __ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(),
2179 __ Goto(&done, __ Int32Div(lhs, rhs));
2182 __ Bind(&if_lhs_notminint);
2185 __ Goto(&done, __ Int32Div(lhs, rhs));
2189 __ Bind(&done);
2193 Node* check = __ Word32Equal(lhs, __ Int32Mul(value, rhs));
2194 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
2208 Node* add = __ Int32AddWithOverflow(value, value);
2209 Node* ovf = __ Projection(1, add);
2210 __ GotoIf(ovf, if_overflow);
2211 Node* value_smi = __ Projection(0, add);
2213 __ Goto(done, value_smi);
2222 Node* add = __ Int32AddWithOverflow(value, value);
2223 Node* check = __ Projection(1, add);
2224 __ DeoptimizeIf(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2226 Node* result = __ Projection(0, add);
2231 auto if_rhs_power_of_two = __ MakeLabel();
2232 auto done = __ MakeLabel(MachineRepresentation::kWord32);
2235 Node* one = __ Int32Constant(1);
2236 Node* msk = __ Int32Sub(rhs, one);
2239 __ GotoIf(__ Word32Equal(__ Word32And(rhs, msk), __ Int32Constant(0)),
2243 __ Goto(&done, __ Uint32Mod(lhs, rhs));
2246 __ Bind(&if_rhs_power_of_two);
2249 __ Goto(&done, __ Word32And(lhs, msk));
2252 __ Bind(&done);
2285 auto if_rhs_not_positive = __ MakeDeferredLabel();
2286 auto if_lhs_negative = __ MakeDeferredLabel();
2287 auto if_rhs_power_of_two = __ MakeLabel();
2288 auto rhs_checked = __ MakeLabel(MachineRepresentation::kWord32);
2289 auto done = __ MakeLabel(MachineRepresentation::kWord32);
2291 Node* zero = __ Int32Constant(0);
2294 Node* check0 = __ Int32LessThanOrEqual(rhs, zero);
2295 __ GotoIf(check0, &if_rhs_not_positive);
2296 __ Goto(&rhs_checked, rhs);
2298 __ Bind(&if_rhs_not_positive);
2302 Node* vtrue0 = __ Int32Sub(zero, rhs);
2305 __ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(),
2306 __ Word32Equal(vtrue0, zero), frame_state);
2307 __ Goto(&rhs_checked, vtrue0);
2310 __ Bind(&rhs_checked);
2313 __ GotoIf(__ Int32LessThan(lhs, zero), &if_lhs_negative);
2316 __ Goto(&done, BuildUint32Mod(lhs, rhs));
2319 __ Bind(&if_lhs_negative);
2325 Node* res = __ Uint32Mod(__ Int32Sub(zero, lhs), rhs);
2328 __ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(),
2329 __ Word32Equal(res, zero), frame_state);
2330 __ Goto(&done, __ Int32Sub(zero, res));
2333 __ Bind(&done);
2341 Node* zero = __ Int32Constant(0);
2352 Node* mask = __ Uint32Constant(divisor - 1);
2353 Node* shift = __ Uint32Constant(base::bits::WhichPowerOfTwo(divisor));
2354 Node* check = __ Word32Equal(__ Word32And(lhs, mask), zero);
2355 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
2357 return __ Word32Shr(lhs, shift);
2360 Node* check = __ Word32Equal(rhs, zero);
2361 __ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(), check,
2365 Node* value = __ Uint32Div(lhs, rhs);
2368 check = __ Word32Equal(lhs, __ Int32Mul(rhs, value));
2369 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, FeedbackSource(),
2380 Node* zero = __ Int32Constant(0);
2383 Node* check = __ Word32Equal(rhs, zero);
2384 __ DeoptimizeIf(DeoptimizeReason::kDivisionByZero, FeedbackSource(), check,
2397 Node* projection = __ Int32MulWithOverflow(lhs, rhs);
2398 Node* check = __ Projection(1, projection);
2399 __ DeoptimizeIf(DeoptimizeReason::kOverflow, FeedbackSource(), check,
2402 Node* value = __ Projection(0, projection);
2405 auto if_zero = __ MakeDeferredLabel();
2406 auto check_done = __ MakeLabel();
2407 Node* zero = __ Int32Constant(0);
2408 Node* check_zero = __ Word32Equal(value, zero);
2409 __ GotoIf(check_zero, &if_zero);
2410 __ Goto(&check_done);
2412 __ Bind(&if_zero);
2414 Node* check_or = __ Int32LessThan(__ Word32Or(lhs, rhs), zero);
2415 __ DeoptimizeIf(DeoptimizeReason::kMinusZero, FeedbackSource(), check_or,
2417 __ Goto(&check_done);
2419 __ Bind(&check_done);
2438 Node* value32 = __ TruncateInt64ToInt32(value);
2439 Node* check = __ Word64Equal(__ ChangeInt32ToInt64(value32), value);
2440 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2450 Node* value32 = __ TruncateInt64ToInt32(value);
2451 Node* check = __ Word64Equal(__ ChangeInt32ToInt64(value32), value);
2452 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2468 Node* check = __ Uint32LessThan(index, limit);
2470 __ DeoptimizeIfNot(DeoptimizeReason::kOutOfBounds,
2474 auto if_abort = __ MakeDeferredLabel();
2475 auto done = __ MakeLabel();
2477 __ Branch(check, &done, &if_abort);
2479 __ Bind(&if_abort);
2480 __ Unreachable(&done);
2482 __ Bind(&done);
2492 Node* unsafe = __ Int32LessThan(value, __ Int32Constant(0));
2493 __ DeoptimizeIf(DeoptimizeReason::kLostPrecision, params.feedback(), unsafe,
2502 Node* check = __ Uint32LessThanOrEqual(value, SmiMaxValueConstant());
2503 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2514 Node* check = __ Uint64LessThan(index, limit);
2516 __ DeoptimizeIfNot(DeoptimizeReason::kOutOfBounds,
2520 auto if_abort = __ MakeDeferredLabel();
2521 auto done = __ MakeLabel();
2523 __ Branch(check, &done, &if_abort);
2525 __ Bind(&if_abort);
2526 __ Unreachable(&done);
2528 __ Bind(&done);
2538 Node* check = __ Uint64LessThanOrEqual(value, __ Int64Constant(kMaxInt));
2539 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2541 return __ TruncateInt64ToInt32(value);
2550 __ Uint64LessThanOrEqual(value, __ Int64Constant(Smi::kMaxValue));
2551 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecision, params.feedback(), check,
2559 Node* value32 = __ RoundFloat64ToInt32(value);
2560 Node* check_same = __ Float64Equal(value, __ ChangeInt32ToFloat64(value32));
2561 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecisionOrNaN, feedback,
2566 auto if_zero = __ MakeDeferredLabel();
2567 auto check_done = __ MakeLabel();
2569 Node* check_zero = __ Word32Equal(value32, __ Int32Constant(0));
2570 __ GotoIf(check_zero, &if_zero);
2571 __ Goto(&check_done);
2573 __ Bind(&if_zero);
2575 Node* check_negative = __ Int32LessThan(__ Float64ExtractHighWord32(value),
2576 __ Int32Constant(0));
2577 __ DeoptimizeIf(DeoptimizeReason::kMinusZero, feedback, check_negative,
2579 __ Goto(&check_done);
2581 __ Bind(&check_done);
2590 __ TruncateFloat64ToInt64(value, TruncateKind::kArchitectureDefault);
2595 Node* check_same = __ Float64Equal(value, __ ChangeInt64ToFloat64(value64));
2596 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecisionOrNaN, feedback,
2599 __ IntLessThan(value64, __ Int64Constant(kMaxSafeInteger));
2600 __ DeoptimizeIfNot(DeoptimizeReason::kNotAnArrayIndex, feedback, check_max,
2603 __ IntLessThan(__ Int64Constant(-kMaxSafeInteger), value64);
2604 __ DeoptimizeIfNot(DeoptimizeReason::kNotAnArrayIndex, feedback, check_min,
2608 Node* value32 = __ RoundFloat64ToInt32(value);
2609 Node* check_same = __ Float64Equal(value, __ ChangeInt32ToFloat64(value32));
2610 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecisionOrNaN, feedback,
2629 __ TruncateFloat64ToInt64(value, TruncateKind::kSetOverflowToMin);
2630 Node* check_same = __ Float64Equal(value, __ ChangeInt64ToFloat64(value64));
2631 __ DeoptimizeIfNot(DeoptimizeReason::kLostPrecisionOrNaN, feedback,
2636 auto if_zero = __ MakeDeferredLabel();
2637 auto check_done = __ MakeLabel();
2639 Node* check_zero = __ Word64Equal(value64, __ Int64Constant(0));
2640 __ GotoIf(check_zero, &if_zero);
2641 __ Goto(&check_done);
2643 __ Bind(&if_zero);
2645 Node* check_negative = __ Int32LessThan(__ Float64ExtractHighWord32(value),
2646 __ Int32Constant(0));
2647 __ DeoptimizeIf(DeoptimizeReason::kMinusZero, feedback, check_negative,
2649 __ Goto(&check_done);
2651 __ Bind(&check_done);
2670 __ DeoptimizeIfNot(DeoptimizeReason::kNotASmi, params.feedback(), check,
2680 auto if_not_smi = __ MakeDeferredLabel();
2681 auto done = __ MakeLabel(MachineType::PointerRepresentation());
2683 __ GotoIfNot(ObjectIsSmi(value), &if_not_smi);
2685 __ Goto(&done, ChangeSmiToIntPtr(value));
2689 __ Bind(&if_not_smi);
2690 auto if_not_heap_number = __ MakeDeferredLabel();
2691 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2692 Node* is_heap_number = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
2693 __ GotoIfNot(is_heap_number, &if_not_heap_number);
2695 Node* number = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
2697 __ Goto(&done, number);
2699 __ Bind(&if_not_heap_number);
2700 auto calculate_index = __ MakeDeferredLabel();
2702 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
2703 Node* is_string = __ Uint32LessThan(value_instance_type,
2704 __ Uint32Constant(FIRST_NONSTRING_TYPE));
2705 __ DeoptimizeIfNot(DeoptimizeReason::kNotAString, params.feedback(),
2712 __ ExternalConstant(ExternalReference::string_to_array_index_function());
2715 Node* index = __ Call(common()->Call(call_descriptor),
2718 __ DeoptimizeIf(DeoptimizeReason::kNotAnArrayIndex, params.feedback(),
2719 __ Word32Equal(index, __ Int32Constant(-1)), frame_state);
2721 __ Goto(&done, index);
2723 __ Bind(&done);
2733 auto if_not_smi = __ MakeDeferredLabel();
2734 auto done = __ MakeLabel(MachineRepresentation::kWord32);
2736 __ GotoIfNot(check, &if_not_smi);
2738 __ Goto(&done, ChangeSmiToInt32(value));
2742 __ Bind(&if_not_smi);
2743 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2744 Node* check_map = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
2745 __ DeoptimizeIfNot(DeoptimizeReason::kNotAHeapNumber, params.feedback(),
2747 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
2750 __ Goto(&done, vfalse);
2752 __ Bind(&done);
2762 auto if_not_smi = __ MakeDeferredLabel();
2763 auto done = __ MakeLabel(MachineRepresentation::kWord64);
2766 __ GotoIfNot(check, &if_not_smi);
2768 __ Goto(&done, ChangeSmiToInt64(value));
2772 __ Bind(&if_not_smi);
2773 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2774 Node* check_map = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
2775 __ DeoptimizeIfNot(DeoptimizeReason::kNotAHeapNumber, params.feedback(),
2777 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
2780 __ Goto(&done, vfalse);
2782 __ Bind(&done);
2789 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2790 Node* check_number = __ TaggedEqual(value_map, __ HeapNumberMapConstant());
2793 __ DeoptimizeIfNot(DeoptimizeReason::kNotAHeapNumber, feedback,
2798 auto check_done = __ MakeLabel();
2800 __ GotoIf(check_number, &check_done);
2801 __ DeoptimizeIfNot(DeoptimizeReason::kNotANumberOrBoolean, feedback,
2802 __ TaggedEqual(value_map, __ BooleanMapConstant()),
2806 __ Goto(&check_done);
2808 __ Bind(&check_done);
2812 auto check_done = __ MakeLabel();
2814 __ GotoIf(check_number, &check_done);
2818 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
2820 __ Word32Equal(instance_type, __ Int32Constant(ODDBALL_TYPE));
2821 __ DeoptimizeIfNot(DeoptimizeReason::kNotANumberOrOddball, feedback,
2825 __ Goto(&check_done);
2827 __ Bind(&check_done);
2831 return __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
2840 auto if_smi = __ MakeLabel();
2841 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
2844 __ GotoIf(check, &if_smi);
2850 __ Goto(&done, number);
2852 __ Bind(&if_smi);
2854 from_smi = __ ChangeInt32ToFloat64(from_smi);
2855 __ Goto(&done, from_smi);
2857 __ Bind(&done);
2867 __ DeoptimizeIfNot(DeoptimizeReason::kNotASmi, params.feedback(), check,
2879 __ DeoptimizeIf(DeoptimizeReason::kSmi, params.feedback(), check,
2890 __ DeoptimizeIf(DeoptimizeReason::kSmi, params.feedback(), smi_check,
2894 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
2895 Node* bi_check = __ TaggedEqual(value_map, __ BigIntMapConstant());
2896 __ DeoptimizeIfNot(DeoptimizeReason::kWrongInstanceType, params.feedback(),
2905 auto done = __ MakeLabel(MachineRepresentation::kTagged);
2909 __ GotoIf(__ Word64Equal(value, __ IntPtrConstant(0)), &done,
2914 __ Word64Shr(value, __ IntPtrConstant(63 - BigInt::SignBits::kShift));
2916 __ Word32Or(__ Int32Constant(BigInt::LengthBits::encode(1)), sign);
2920 Node* sign_mask = __ Word64Sar(value, __ Int64Constant(63));
2921 Node* absolute_value = __ Int64Sub(__ Word64Xor(value, sign_mask), sign_mask);
2922 __ Goto(&done, BuildAllocateBigInt(bitfield, absolute_value));
2924 __ Bind(&done);
2931 auto done = __ MakeLabel(MachineRepresentation::kTagged);
2935 __ GotoIf(__ Word64Equal(value, __ IntPtrConstant(0)), &done,
2939 __ Goto(&done, BuildAllocateBigInt(__ Int32Constant(bitfield), value));
2941 __ Bind(&done);
2948 auto done = __ MakeLabel(MachineRepresentation::kWord64);
2949 auto if_neg = __ MakeLabel();
2950 auto if_not_zero = __ MakeLabel();
2954 Node* bitfield = __ LoadField(AccessBuilder::ForBigIntBitfield(), value);
2955 __ GotoIfNot(__ Word32Equal(bitfield, __ Int32Constant(0)), &if_not_zero);
2956 __ Goto(&done, __ Int64Constant(0));
2958 __ Bind(&if_not_zero);
2961 __ LoadField(AccessBuilder::ForBigIntLeastSignificantDigit64(), value);
2963 __ Word32And(bitfield, __ Int32Constant(BigInt::SignBits::kMask));
2964 __ GotoIf(__ Word32Equal(sign, __ Int32Constant(1)), &if_neg);
2965 __ Goto(&done, lsd);
2967 __ Bind(&if_neg);
2968 __ Goto(&done, __ Int64Sub(__ Int64Constant(0), lsd));
2971 __ Bind(&done);
2978 auto if_not_smi = __ MakeDeferredLabel();
2979 auto done = __ MakeLabel(MachineRepresentation::kWord32);
2982 __ GotoIfNot(check, &if_not_smi);
2983 __ Goto(&done, ChangeSmiToInt32(value));
2985 __ Bind(&if_not_smi);
2988 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
2989 vfalse = __ TruncateFloat64ToWord32(vfalse);
2990 __ Goto(&done, vfalse);
2992 __ Bind(&done);
3002 auto if_not_smi = __ MakeLabel();
3003 auto done = __ MakeLabel(MachineRepresentation::kWord32);
3006 __ GotoIfNot(check, &if_not_smi);
3008 __ Goto(&done, ChangeSmiToInt32(value));
3012 __ Bind(&if_not_smi);
3015 number = __ TruncateFloat64ToWord32(number);
3016 __ Goto(&done, number);
3018 __ Bind(&done);
3025 Node* new_node = __ Allocate(allocation, size);
3039 return __ Call(call_descriptor, __ HeapConstant(callable.code()), argument,
3040 __ NoContextConstant());
3046 auto if_smi = __ MakeDeferredLabel();
3047 auto done = __ MakeLabel(MachineRepresentation::kBit);
3050 __ GotoIf(check, &if_smi);
3052 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3054 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
3055 Node* vfalse = __ Uint32LessThan(
3056 __ Int32Sub(value_instance_type,
3057 __ Int32Constant(FIRST_JS_ARRAY_BUFFER_VIEW_TYPE)),
3058 __ Int32Constant(LAST_JS_ARRAY_BUFFER_VIEW_TYPE -
3060 __ Goto(&done, vfalse);
3062 __ Bind(&if_smi);
3063 __ Goto(&done, __ Int32Constant(0));
3065 __ Bind(&done);
3072 auto if_smi = __ MakeDeferredLabel();
3073 auto done = __ MakeLabel(MachineRepresentation::kBit);
3076 __ GotoIf(check, &if_smi);
3077 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3078 Node* vfalse = __ TaggedEqual(value_map, __ BigIntMapConstant());
3079 __ Goto(&done, vfalse);
3081 __ Bind(&if_smi);
3082 __ Goto(&done, __ Int32Constant(0));
3084 __ Bind(&done);
3091 auto if_smi = __ MakeDeferredLabel();
3092 auto done = __ MakeLabel(MachineRepresentation::kBit);
3095 __ GotoIf(check, &if_smi);
3097 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3099 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
3100 Node* vfalse = __ Word32Equal(
3101 __ Int32Constant(Map::Bits1::IsCallableBit::kMask),
3102 __ Word32And(value_bit_field,
3103 __ Int32Constant(Map::Bits1::IsCallableBit::kMask)));
3104 __ Goto(&done, vfalse);
3106 __ Bind(&if_smi);
3107 __ Goto(&done, __ Int32Constant(0));
3109 __ Bind(&done);
3116 auto if_smi = __ MakeDeferredLabel();
3117 auto done = __ MakeLabel(MachineRepresentation::kBit);
3120 __ GotoIf(check, &if_smi);
3122 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3124 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
3125 Node* vfalse = __ Word32Equal(
3126 __ Int32Constant(Map::Bits1::IsConstructorBit::kMask),
3127 __ Word32And(value_bit_field,
3128 __ Int32Constant(Map::Bits1::IsConstructorBit::kMask)));
3129 __ Goto(&done, vfalse);
3131 __ Bind(&if_smi);
3132 __ Goto(&done, __ Int32Constant(0));
3134 __ Bind(&done);
3141 auto if_smi = __ MakeDeferredLabel();
3142 auto done = __ MakeLabel(MachineRepresentation::kBit);
3145 __ GotoIf(check, &if_smi);
3147 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3149 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
3150 Node* vfalse = __ Word32Equal(
3151 __ Int32Constant(Map::Bits1::IsCallableBit::kMask),
3152 __ Word32And(value_bit_field,
3153 __ Int32Constant((Map::Bits1::IsCallableBit::kMask) |
3155 __ Goto(&done, vfalse);
3157 __ Bind(&if_smi);
3158 __ Goto(&done, __ Int32Constant(0));
3160 __ Bind(&done);
3166 Node* check = __ Word32Equal(__ Float64ExtractHighWord32(value),
3167 __ Int32Constant(kHoleNanUpper32));
3173 Node* diff = __ Float64Sub(number, number);
3174 Node* check = __ Float64Equal(diff, diff);
3180 Node* zero = __ Int32Constant(0);
3181 Node* one = __ Int32Constant(1);
3183 auto done = __ MakeLabel(MachineRepresentation::kBit);
3186 __ GotoIf(ObjectIsSmi(object), &done, one);
3189 Node* value_map = __ LoadField(AccessBuilder::ForMap(), object);
3190 __ GotoIfNot(__ TaggedEqual(value_map, __ HeapNumberMapConstant()), &done,
3194 Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), object);
3195 Node* diff = __ Float64Sub(value, value);
3196 Node* check = __ Float64Equal(diff, diff);
3197 __ Goto(&done, check);
3199 __ Bind(&done);
3206 Node* diff = __ Float64Sub(number, trunc);
3207 Node* check = __ Float64Equal(diff, __ Float64Constant(0));
3213 Node* zero = __ Int32Constant(0);
3214 Node* one = __ Int32Constant(1);
3216 auto done = __ MakeLabel(MachineRepresentation::kBit);
3219 __ GotoIf(ObjectIsSmi(object), &done, one);
3222 Node* value_map = __ LoadField(AccessBuilder::ForMap(), object);
3223 __ GotoIfNot(__ TaggedEqual(value_map, __ HeapNumberMapConstant()), &done,
3227 Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), object);
3229 Node* diff = __ Float64Sub(value, trunc);
3230 Node* check = __ Float64Equal(diff, __ Float64Constant(0));
3231 __ Goto(&done, check);
3233 __ Bind(&done);
3239 Node* zero = __ Int32Constant(0);
3240 auto done = __ MakeLabel(MachineRepresentation::kBit);
3243 Node* diff = __ Float64Sub(number, trunc);
3244 Node* check = __ Float64Equal(diff, __ Float64Constant(0));
3245 __ GotoIfNot(check, &done, zero);
3246 Node* in_range = __ Float64LessThanOrEqual(
3247 __ Float64Abs(trunc), __ Float64Constant(kMaxSafeInteger));
3248 __ Goto(&done, in_range);
3250 __ Bind(&done);
3256 Node* zero = __ Int32Constant(0);
3257 Node* one = __ Int32Constant(1);
3259 auto done = __ MakeLabel(MachineRepresentation::kBit);
3262 __ GotoIf(ObjectIsSmi(object), &done, one);
3265 Node* value_map = __ LoadField(AccessBuilder::ForMap(), object);
3266 __ GotoIfNot(__ TaggedEqual(value_map, __ HeapNumberMapConstant()), &done,
3270 Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), object);
3272 Node* diff = __ Float64Sub(value, trunc);
3273 Node* check = __ Float64Equal(diff, __ Float64Constant(0));
3274 __ GotoIfNot(check, &done, zero);
3275 Node* in_range = __ Float64LessThanOrEqual(
3276 __ Float64Abs(trunc), __ Float64Constant(kMaxSafeInteger));
3277 __ Goto(&done, in_range);
3279 __ Bind(&done);
3298 Node* zero = __ Int32Constant(0);
3300 auto done = __ MakeLabel(MachineRepresentation::kBit);
3303 __ GotoIf(ObjectIsSmi(value), &done, zero);
3306 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3307 __ GotoIfNot(__ TaggedEqual(value_map, __ HeapNumberMapConstant()), &done,
3311 Node* value_value = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
3313 Node* value64 = __ BitcastFloat64ToInt64(value_value);
3314 __ Goto(&done, __ Word64Equal(value64, __ Int64Constant(kMinusZeroBits)));
3316 Node* value_lo = __ Float64ExtractLowWord32(value_value);
3317 __ GotoIfNot(__ Word32Equal(value_lo, __ Int32Constant(kMinusZeroLoBits)),
3319 Node* value_hi = __ Float64ExtractHighWord32(value_value);
3320 __ Goto(&done,
3321 __ Word32Equal(value_hi, __ Int32Constant(kMinusZeroHiBits)));
3324 __ Bind(&done);
3332 Node* value64 = __ BitcastFloat64ToInt64(value);
3333 return __ Word64Equal(value64, __ Int64Constant(kMinusZeroBits));
3335 auto done = __ MakeLabel(MachineRepresentation::kBit);
3337 Node* value_lo = __ Float64ExtractLowWord32(value);
3338 __ GotoIfNot(__ Word32Equal(value_lo, __ Int32Constant(kMinusZeroLoBits)),
3339 &done, __ Int32Constant(0));
3340 Node* value_hi = __ Float64ExtractHighWord32(value);
3341 __ Goto(&done,
3342 __ Word32Equal(value_hi, __ Int32Constant(kMinusZeroHiBits)));
3344 __ Bind(&done);
3351 Node* zero = __ Int32Constant(0);
3353 auto done = __ MakeLabel(MachineRepresentation::kBit);
3356 __ GotoIf(ObjectIsSmi(value), &done, zero);
3359 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3360 __ GotoIfNot(__ TaggedEqual(value_map, __ HeapNumberMapConstant()), &done,
3364 Node* value_value = __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
3365 __ Goto(&done,
3366 __ Word32Equal(__ Float64Equal(value_value, value_value), zero));
3368 __ Bind(&done);
3374 Node* diff = __ Float64Equal(number, number);
3375 Node* check = __ Word32Equal(diff, __ Int32Constant(0));
3382 auto if_primitive = __ MakeDeferredLabel();
3383 auto done = __ MakeLabel(MachineRepresentation::kBit);
3386 __ GotoIf(check0, &if_primitive);
3388 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3390 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
3392 Node* check1 = __ Uint32LessThanOrEqual(
3393 __ Uint32Constant(FIRST_JS_RECEIVER_TYPE), value_instance_type);
3394 __ GotoIfNot(check1, &if_primitive);
3397 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
3398 Node* check2 = __ Word32Equal(
3399 __ Int32Constant(0),
3400 __ Word32And(value_bit_field,
3401 __ Int32Constant(Map::Bits1::IsCallableBit::kMask)));
3402 __ Goto(&done, check2);
3404 __ Bind(&if_primitive);
3405 __ Goto(&done, __ Int32Constant(0));
3407 __ Bind(&done);
3414 auto if_smi = __ MakeLabel();
3415 auto done = __ MakeLabel(MachineRepresentation::kBit);
3417 __ GotoIf(ObjectIsSmi(value), &if_smi);
3418 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3419 __ Goto(&done, __ TaggedEqual(value_map, __ HeapNumberMapConstant()));
3421 __ Bind(&if_smi);
3422 __ Goto(&done, __ Int32Constant(1));
3424 __ Bind(&done);
3431 auto if_smi = __ MakeDeferredLabel();
3432 auto done = __ MakeLabel(MachineRepresentation::kBit);
3434 __ GotoIf(ObjectIsSmi(value), &if_smi);
3437 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3439 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
3440 Node* result = __ Uint32LessThanOrEqual(
3441 __ Uint32Constant(FIRST_JS_RECEIVER_TYPE), value_instance_type);
3442 __ Goto(&done, result);
3444 __ Bind(&if_smi);
3445 __ Goto(&done, __ Int32Constant(0));
3447 __ Bind(&done);
3459 auto if_smi = __ MakeDeferredLabel();
3460 auto done = __ MakeLabel(MachineRepresentation::kBit);
3463 __ GotoIf(check, &if_smi);
3464 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3466 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
3467 Node* vfalse = __ Uint32LessThan(value_instance_type,
3468 __ Uint32Constant(FIRST_NONSTRING_TYPE));
3469 __ Goto(&done, vfalse);
3471 __ Bind(&if_smi);
3472 __ Goto(&done, __ Int32Constant(0));
3474 __ Bind(&done);
3481 auto if_smi = __ MakeDeferredLabel();
3482 auto done = __ MakeLabel(MachineRepresentation::kBit);
3485 __ GotoIf(check, &if_smi);
3486 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3488 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
3490 __ Word32Equal(value_instance_type, __ Uint32Constant(SYMBOL_TYPE));
3491 __ Goto(&done, vfalse);
3493 __ Bind(&if_smi);
3494 __ Goto(&done, __ Int32Constant(0));
3496 __ Bind(&done);
3503 auto if_smi = __ MakeDeferredLabel();
3504 auto done = __ MakeLabel(MachineRepresentation::kBit);
3507 __ GotoIf(check, &if_smi);
3509 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
3511 __ LoadField(AccessBuilder::ForMapBitField(), value_map);
3512 Node* vfalse = __ Word32Equal(
3513 __ Word32Equal(
3514 __ Int32Constant(0),
3515 __ Word32And(value_bit_field,
3516 __ Int32Constant(Map::Bits1::IsUndetectableBit::kMask))),
3517 __ Int32Constant(0));
3518 __ Goto(&done, vfalse);
3520 __ Bind(&if_smi);
3521 __ Goto(&done, __ Int32Constant(0));
3523 __ Bind(&done);
3535 return __ Call(call_descriptor, __ HeapConstant(callable.code()), obj,
3536 __ NoContextConstant());
3548 return __ Call(call_descriptor, __ HeapConstant(callable.code()), obj);
3553 __ Load(MachineType::Pointer(), __ LoadFramePointer(),
3554 __ IntPtrConstant(StandardFrameConstants::kArgCOffset)));
3556 __ SmiSub(arguments_length, __ SmiConstant(kJSArgcReceiverSlots));
3564 auto done = __ MakeLabel(MachineRepresentation::kTaggedSigned);
3565 Node* frame = __ LoadFramePointer();
3568 __ Load(MachineType::Pointer(), frame,
3569 __ IntPtrConstant(StandardFrameConstants::kArgCOffset)));
3571 __ SmiSub(arguments_length, __ SmiConstant(kJSArgcReceiverSlots));
3573 __ SmiSub(arguments_length, __ SmiConstant(formal_parameter_count));
3574 __ GotoIf(__ SmiLessThan(rest_length, __ SmiConstant(0)), &done,
3575 __ SmiConstant(0));
3576 __ Goto(&done, rest_length);
3578 __ Bind(&done);
3586 auto done = __ MakeLabel(MachineRepresentation::kTaggedPointer);
3587 Node* zero_length = __ IntPtrEqual(length, __ IntPtrConstant(0));
3588 __ GotoIf(zero_length, &done,
3589 __ HeapConstant(factory()->empty_fixed_array()));
3592 Node* size = __ IntAdd(__ WordShl(length, __ IntPtrConstant(kDoubleSizeLog2)),
3593 __ IntPtrConstant(FixedDoubleArray::kHeaderSize));
3596 Node* result = __ Allocate(allocation, size);
3597 __ StoreField(AccessBuilder::ForMap(), result,
3598 __ FixedDoubleArrayMapConstant());
3599 __ StoreField(AccessBuilder::ForFixedArrayLength(), result,
3606 __ LoadField(AccessBuilder::ForHeapNumberValue(), __ TheHoleConstant());
3607 auto loop = __ MakeLoopLabel(MachineType::PointerRepresentation());
3608 __ Goto(&loop, __ IntPtrConstant(0));
3609 __ Bind(&loop);
3613 Node* check = __ UintLessThan(index, length);
3614 __ GotoIfNot(check, &done, result);
3619 __ StoreElement(access, result, index, the_hole);
3622 index = __ IntAdd(index, __ IntPtrConstant(1));
3623 __ Goto(&loop, index);
3626 __ Bind(&done);
3634 auto done = __ MakeLabel(MachineRepresentation::kTaggedPointer);
3635 Node* zero_length = __ IntPtrEqual(length, __ IntPtrConstant(0));
3636 __ GotoIf(zero_length, &done,
3637 __ HeapConstant(factory()->empty_fixed_array()));
3640 Node* size = __ IntAdd(__ WordShl(length, __ IntPtrConstant(kTaggedSizeLog2)),
3641 __ IntPtrConstant(FixedArray::kHeaderSize));
3644 Node* result = __ Allocate(allocation, size);
3645 __ StoreField(AccessBuilder::ForMap(), result, __ FixedArrayMapConstant());
3646 __ StoreField(AccessBuilder::ForFixedArrayLength(), result,
3650 Node* the_hole = __ TheHoleConstant();
3651 auto loop = __ MakeLoopLabel(MachineType::PointerRepresentation());
3652 __ Goto(&loop, __ IntPtrConstant(0));
3653 __ Bind(&loop);
3657 Node* check = __ UintLessThan(index, length);
3658 __ GotoIfNot(check, &done, result);
3664 __ StoreElement(access, result, index, the_hole);
3667 index = __ IntAdd(index, __ IntPtrConstant(1));
3668 __ Goto(&loop, index);
3671 __ Bind(&done);
3681 Node* frame = __ LoadFramePointer();
3699 return __ Call(call_descriptor, __ HeapConstant(callable.code()), frame,
3700 __ IntPtrConstant(parameters.formal_parameter_count()),
3710 Node* first_map = __ LoadField(AccessBuilder::ForMap(), first);
3712 __ LoadField(AccessBuilder::ForMapInstanceType(), first_map);
3713 Node* second_map = __ LoadField(AccessBuilder::ForMap(), second);
3715 __ LoadField(AccessBuilder::ForMapInstanceType(), second_map);
3721 auto if_onebyte = __ MakeLabel();
3722 auto if_twobyte = __ MakeLabel();
3723 auto done = __ MakeLabel(MachineRepresentation::kTaggedPointer);
3726 Node* instance_type = __ Word32And(first_instance_type, second_instance_type);
3728 __ Word32And(instance_type, __ Int32Constant(kStringEncodingMask));
3729 __ Branch(__ Word32Equal(encoding, __ Int32Constant(kTwoByteStringTag)),
3731 __ Bind(&if_onebyte);
3732 __ Goto(&done, __ HeapConstant(factory()->cons_one_byte_string_map()));
3733 __ Bind(&if_twobyte);
3734 __ Goto(&done, __ HeapConstant(factory()->cons_string_map()));
3735 __ Bind(&done);
3740 __ Allocate(AllocationType::kYoung, __ IntPtrConstant(ConsString::kSize));
3741 __ StoreField(AccessBuilder::ForMap(), result, result_map);
3742 __ StoreField(AccessBuilder::ForNameRawHashField(), result,
3743 __ Int32Constant(Name::kEmptyHashField));
3744 __ StoreField(AccessBuilder::ForStringLength(), result, length);
3745 __ StoreField(AccessBuilder::ForConsStringFirst(), result, first);
3746 __ StoreField(AccessBuilder::ForConsStringSecond(), result, second);
3761 return __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs, rhs,
3762 __ NoContextConstant());
3776 return __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs, rhs,
3777 __ NoContextConstant());
3784 auto is_float64_equal = __ MakeLabel();
3785 auto done = __ MakeLabel(MachineRepresentation::kBit);
3787 __ GotoIf(__ Float64Equal(lhs, rhs), &is_float64_equal);
3790 __ GotoIf(__ Float64Equal(lhs, lhs), &done, __ Int32Constant(0));
3791 __ GotoIf(__ Float64Equal(rhs, rhs), &done, __ Int32Constant(0));
3792 __ Goto(&done, __ Int32Constant(1));
3794 __ Bind(&is_float64_equal);
3797 Node* lhs_hi = __ Float64ExtractHighWord32(lhs);
3798 Node* rhs_hi = __ Float64ExtractHighWord32(rhs);
3799 __ Goto(&done, __ Word32Equal(lhs_hi, rhs_hi));
3801 __ Bind(&done);
3812 Node* unreachable = __ UnreachableWithoutConnectToEnd();
3828 return __ Call(call_descriptor, __ HeapConstant(callable.code()), string,
3829 __ NoContextConstant());
3836 auto loop = __ MakeLoopLabel(MachineRepresentation::kTagged,
3838 auto loop_next = __ MakeLabel(MachineRepresentation::kTagged,
3840 auto loop_done = __ MakeLabel(MachineRepresentation::kWord32);
3841 __ Goto(&loop, receiver, position);
3842 __ Bind(&loop);
3846 Node* receiver_map = __ LoadField(AccessBuilder::ForMap(), receiver);
3848 __ LoadField(AccessBuilder::ForMapInstanceType(), receiver_map);
3849 Node* receiver_representation = __ Word32And(
3850 receiver_instance_type, __ Int32Constant(kStringRepresentationMask));
3853 auto if_lessthanoreq_cons = __ MakeLabel();
3854 auto if_greaterthan_cons = __ MakeLabel();
3855 auto if_seqstring = __ MakeLabel();
3856 auto if_consstring = __ MakeLabel();
3857 auto if_thinstring = __ MakeLabel();
3858 auto if_externalstring = __ MakeLabel();
3859 auto if_slicedstring = __ MakeLabel();
3860 auto if_runtime = __ MakeDeferredLabel();
3862 __ Branch(__ Int32LessThanOrEqual(receiver_representation,
3863 __ Int32Constant(kConsStringTag)),
3866 __ Bind(&if_lessthanoreq_cons);
3868 __ Branch(__ Word32Equal(receiver_representation,
3869 __ Int32Constant(kConsStringTag)),
3873 __ Bind(&if_greaterthan_cons);
3875 __ GotoIf(__ Word32Equal(receiver_representation,
3876 __ Int32Constant(kThinStringTag)),
3878 __ GotoIf(__ Word32Equal(receiver_representation,
3879 __ Int32Constant(kExternalStringTag)),
3881 __ Branch(__ Word32Equal(receiver_representation,
3882 __ Int32Constant(kSlicedStringTag)),
3886 __ Bind(&if_seqstring);
3888 Node* receiver_is_onebyte = __ Word32Equal(
3889 __ Word32Equal(__ Word32And(receiver_instance_type,
3890 __ Int32Constant(kStringEncodingMask)),
3891 __ Int32Constant(kTwoByteStringTag)),
3892 __ Int32Constant(0));
3894 __ Goto(&loop_done, result);
3897 __ Bind(&if_consstring);
3900 __ LoadField(AccessBuilder::ForConsStringSecond(), receiver);
3901 __ GotoIfNot(__ TaggedEqual(receiver_second, __ EmptyStringConstant()),
3904 __ LoadField(AccessBuilder::ForConsStringFirst(), receiver);
3905 __ Goto(&loop_next, receiver_first, position);
3908 __ Bind(&if_thinstring);
3911 __ LoadField(AccessBuilder::ForThinStringActual(), receiver);
3912 __ Goto(&loop_next, receiver_actual, position);
3915 __ Bind(&if_externalstring);
3918 __ GotoIf(__ Word32Equal(
3919 __ Word32And(receiver_instance_type,
3920 __ Int32Constant(kUncachedExternalStringMask)),
3921 __ Int32Constant(kUncachedExternalStringTag)),
3924 Node* receiver_data = __ LoadField(
3927 auto if_onebyte = __ MakeLabel();
3928 auto if_twobyte = __ MakeLabel();
3929 __ Branch(
3930 __ Word32Equal(__ Word32And(receiver_instance_type,
3931 __ Int32Constant(kStringEncodingMask)),
3932 __ Int32Constant(kTwoByteStringTag)),
3935 __ Bind(&if_onebyte);
3937 Node* result = __ Load(MachineType::Uint8(), receiver_data, position);
3938 __ Goto(&loop_done, result);
3941 __ Bind(&if_twobyte);
3943 Node* result = __ Load(MachineType::Uint16(), receiver_data,
3944 __ WordShl(position, __ IntPtrConstant(1)));
3945 __ Goto(&loop_done, result);
3949 __ Bind(&if_slicedstring);
3952 __ LoadField(AccessBuilder::ForSlicedStringOffset(), receiver);
3954 __ LoadField(AccessBuilder::ForSlicedStringParent(), receiver);
3955 __ Goto(&loop_next, receiver_parent,
3956 __ IntAdd(position, ChangeSmiToIntPtr(receiver_offset)));
3959 __ Bind(&if_runtime);
3965 Node* result = __ Call(call_descriptor, __ CEntryStubConstant(1),
3967 __ ExternalConstant(ExternalReference::Create(id)),
3968 __ Int32Constant(2), __ NoContextConstant());
3969 __ Goto(&loop_done, ChangeSmiToInt32(result));
3972 __ Bind(&loop_next);
3973 __ Goto(&loop, loop_next.PhiAt(0), loop_next.PhiAt(1));
3975 __ Bind(&loop_done);
3989 auto return_result = __ MakeLabel(MachineRepresentation::kWord32);
3992 __ GotoIfNot(
3993 __ Word32Equal(__ Word32And(first_code_unit, __ Int32Constant(0xFC00)),
3994 __ Int32Constant(0xD800)),
3997 auto length = __ LoadField(AccessBuilder::ForStringLength(), receiver);
3998 auto next_index = __ IntAdd(position, __ IntPtrConstant(1));
3999 __ GotoIfNot(__ IntLessThan(next_index, length), &return_result,
4002 __ GotoIfNot(
4003 __ Word32Equal(__ Word32And(second_code_unit, __ Int32Constant(0xFC00)),
4004 __ Int32Constant(0xDC00)),
4007 auto surrogate_offset = __ Int32Constant(0x10000 - (0xD800 << 10) - 0xDC00);
4008 auto result = __ Int32Add(__ Word32Shl(first_code_unit, __ Int32Constant(10)),
4009 __ Int32Add(second_code_unit, surrogate_offset));
4010 __ Goto(&return_result, result);
4012 __ Bind(&return_result);
4018 auto one_byte_load = __ MakeLabel();
4019 auto done = __ MakeLabel(MachineRepresentation::kWord32);
4020 __ GotoIf(is_one_byte, &one_byte_load);
4021 Node* two_byte_result = __ LoadElement(
4023 __ Goto(&done, two_byte_result);
4025 __ Bind(&one_byte_load);
4026 Node* one_byte_element = __ LoadElement(
4028 __ Goto(&done, one_byte_element);
4030 __ Bind(&done);
4036 Node* code = __ Word32And(value, __ Uint32Constant(0xFFFF));
4038 auto if_not_one_byte = __ MakeDeferredLabel();
4039 auto cache_miss = __ MakeDeferredLabel();
4040 auto done = __ MakeLabel(MachineRepresentation::kTagged);
4043 Node* check1 = __ Uint32LessThanOrEqual(
4044 code, __ Uint32Constant(String::kMaxOneByteCharCode));
4045 __ GotoIfNot(check1, &if_not_one_byte);
4048 Node* cache = __ HeapConstant(factory()->single_character_string_cache());
4051 Node* index = machine()->Is32() ? code : __ ChangeUint32ToUint64(code);
4056 __ LoadElement(AccessBuilder::ForFixedArrayElement(), cache, index);
4058 Node* check2 = __ TaggedEqual(entry, __ UndefinedConstant());
4059 __ GotoIf(check2, &cache_miss);
4062 __ Goto(&done, entry);
4064 __ Bind(&cache_miss);
4068 __ Allocate(AllocationType::kYoung,
4069 __ IntPtrConstant(SeqOneByteString::SizeFor(1)));
4070 __ StoreField(AccessBuilder::ForMap(), vtrue2,
4071 __ HeapConstant(factory()->one_byte_string_map()));
4072 __ StoreField(AccessBuilder::ForNameRawHashField(), vtrue2,
4073 __ Int32Constant(Name::kEmptyHashField));
4074 __ StoreField(AccessBuilder::ForStringLength(), vtrue2,
4075 __ Int32Constant(1));
4076 __ Store(
4079 __ IntPtrConstant(SeqOneByteString::kHeaderSize - kHeapObjectTag),
4083 __ StoreElement(AccessBuilder::ForFixedArrayElement(), cache, index,
4085 __ Goto(&done, vtrue2);
4089 __ Bind(&if_not_one_byte);
4093 __ Allocate(AllocationType::kYoung,
4094 __ IntPtrConstant(SeqTwoByteString::SizeFor(1)));
4095 __ StoreField(AccessBuilder::ForMap(), vfalse1,
4096 __ HeapConstant(factory()->string_map()));
4097 __ StoreField(AccessBuilder::ForNameRawHashField(), vfalse1,
4098 __ Int32Constant(Name::kEmptyHashField));
4099 __ StoreField(AccessBuilder::ForStringLength(), vfalse1,
4100 __ Int32Constant(1));
4101 __ Store(
4104 __ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag),
4106 __ Goto(&done, vfalse1);
4109 __ Bind(&done);
4125 return __ Call(call_descriptor, __ HeapConstant(callable.code()), receiver,
4126 __ NoContextConstant());
4135 return __ Call(call_descriptor, __ CEntryStubConstant(1), receiver,
4136 __ ExternalConstant(ExternalReference::Create(id)),
4137 __ Int32Constant(1), __ NoContextConstant());
4156 auto if_not_single_code = __ MakeDeferredLabel();
4157 auto if_not_one_byte = __ MakeDeferredLabel();
4158 auto cache_miss = __ MakeDeferredLabel();
4159 auto done = __ MakeLabel(MachineRepresentation::kTagged);
4162 Node* check0 = __ Uint32LessThanOrEqual(code, __ Uint32Constant(0xFFFF));
4163 __ GotoIfNot(check0, &if_not_single_code);
4167 Node* check1 = __ Uint32LessThanOrEqual(
4168 code, __ Uint32Constant(String::kMaxOneByteCharCode));
4169 __ GotoIfNot(check1, &if_not_one_byte);
4172 Node* cache = __ HeapConstant(factory()->single_character_string_cache());
4175 Node* index = machine()->Is32() ? code : __ ChangeUint32ToUint64(code);
4180 __ LoadElement(AccessBuilder::ForFixedArrayElement(), cache, index);
4182 Node* check2 = __ TaggedEqual(entry, __ UndefinedConstant());
4183 __ GotoIf(check2, &cache_miss);
4186 __ Goto(&done, entry);
4188 __ Bind(&cache_miss);
4192 __ Allocate(AllocationType::kYoung,
4193 __ IntPtrConstant(SeqOneByteString::SizeFor(1)));
4194 __ StoreField(AccessBuilder::ForMap(), vtrue2,
4195 __ HeapConstant(factory()->one_byte_string_map()));
4196 __ StoreField(AccessBuilder::ForNameRawHashField(), vtrue2,
4197 __ Int32Constant(Name::kEmptyHashField));
4198 __ StoreField(AccessBuilder::ForStringLength(), vtrue2,
4199 __ Int32Constant(1));
4200 __ Store(
4203 __ IntPtrConstant(SeqOneByteString::kHeaderSize - kHeapObjectTag),
4207 __ StoreElement(AccessBuilder::ForFixedArrayElement(), cache, index,
4209 __ Goto(&done, vtrue2);
4213 __ Bind(&if_not_one_byte);
4217 __ Allocate(AllocationType::kYoung,
4218 __ IntPtrConstant(SeqTwoByteString::SizeFor(1)));
4219 __ StoreField(AccessBuilder::ForMap(), vfalse1,
4220 __ HeapConstant(factory()->string_map()));
4221 __ StoreField(AccessBuilder::ForNameRawHashField(), vfalse1,
4222 __ IntPtrConstant(Name::kEmptyHashField));
4223 __ StoreField(AccessBuilder::ForStringLength(), vfalse1,
4224 __ Int32Constant(1));
4225 __ Store(
4228 __ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag),
4230 __ Goto(&done, vfalse1);
4234 __ Bind(&if_not_single_code);
4238 Node* lead_offset = __ Int32Constant(0xD800 - (0x10000 >> 10));
4242 __ Int32Add(__ Word32Shr(code, __ Int32Constant(10)), lead_offset);
4245 Node* trail = __ Int32Add(__ Word32And(code, __ Int32Constant(0x3FF)),
4246 __ Int32Constant(0xDC00));
4250 code = __ Word32Or(__ Word32Shl(lead, __ Int32Constant(16)), trail);
4252 code = __ Word32Or(__ Word32Shl(trail, __ Int32Constant(16)), lead);
4257 __ Allocate(AllocationType::kYoung,
4258 __ IntPtrConstant(SeqTwoByteString::SizeFor(2)));
4259 __ StoreField(AccessBuilder::ForMap(), vfalse0,
4260 __ HeapConstant(factory()->string_map()));
4261 __ StoreField(AccessBuilder::ForNameRawHashField(), vfalse0,
4262 __ Int32Constant(Name::kEmptyHashField));
4263 __ StoreField(AccessBuilder::ForStringLength(), vfalse0,
4264 __ Int32Constant(2));
4265 __ Store(
4268 __ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag),
4270 __ Goto(&done, vfalse0);
4273 __ Bind(&done);
4288 return __ Call(call_descriptor, __ HeapConstant(callable.code()), subject,
4289 search_string, position, __ NoContextConstant());
4303 return __ Call(call_descriptor, __ HeapConstant(callable.code()), string,
4304 index, __ NoContextConstant());
4310 return __ LoadField(AccessBuilder::ForStringLength(), subject);
4323 return __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs, rhs,
4324 __ NoContextConstant());
4339 return __ Call(call_descriptor, __ HeapConstant(callable.code()), receiver,
4340 start, end, __ NoContextConstant());
4368 Node* value = __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs,
4369 rhs, __ NoContextConstant());
4372 __ DeoptimizeIf(DeoptimizeReason::kBigIntTooBig, FeedbackSource{},
4389 Node* value = __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs,
4390 rhs, __ NoContextConstant());
4393 __ DeoptimizeIf(DeoptimizeReason::kBigIntTooBig, FeedbackSource{},
4406 Node* value = __ Call(call_descriptor, __ HeapConstant(callable.code()),
4407 node->InputAt(0), __ NoContextConstant());
4421 auto if_nan = __ MakeDeferredLabel();
4422 auto done = __ MakeLabel();
4425 __ Branch(__ Float64Equal(value, value), &done, &if_nan);
4427 __ Bind(&if_nan);
4431 Node* check = __ Word32Equal(__ Float64ExtractHighWord32(value),
4432 __ Int32Constant(kHoleNanUpper32));
4433 __ DeoptimizeIf(DeoptimizeReason::kHole, params.feedback(), check,
4435 __ Goto(&done);
4438 __ Bind(&done);
4445 Node* check = __ TaggedEqual(value, __ TheHoleConstant());
4446 __ DeoptimizeIf(DeoptimizeReason::kHole, FeedbackSource(), check,
4454 auto if_is_hole = __ MakeDeferredLabel();
4455 auto done = __ MakeLabel(MachineRepresentation::kTagged);
4457 Node* check = __ TaggedEqual(value, __ TheHoleConstant());
4458 __ GotoIf(check, &if_is_hole);
4459 __ Goto(&done, value);
4461 __ Bind(&if_is_hole);
4462 __ Goto(&done, __ UndefinedConstant());
4464 __ Bind(&done);
4473 auto if_same = __ MakeLabel();
4474 auto if_notsame = __ MakeDeferredLabel();
4475 auto if_thinstring = __ MakeLabel();
4476 auto if_notthinstring = __ MakeLabel();
4479 __ Branch(__ TaggedEqual(exp, val), &if_same, &if_notsame);
4481 __ Bind(&if_notsame);
4484 __ DeoptimizeIf(DeoptimizeReason::kWrongName, FeedbackSource(),
4486 Node* val_map = __ LoadField(AccessBuilder::ForMap(), val);
4488 __ LoadField(AccessBuilder::ForMapInstanceType(), val_map);
4491 __ GotoIf(__ Word32Equal(val_instance_type,
4492 __ Int32Constant(THIN_ONE_BYTE_STRING_TYPE)),
4494 __ Branch(
4495 __ Word32Equal(val_instance_type, __ Int32Constant(THIN_STRING_TYPE)),
4498 __ Bind(&if_notthinstring);
4502 __ DeoptimizeIfNot(
4504 __ Word32Equal(__ Word32And(val_instance_type,
4505 __ Int32Constant(kIsNotStringMask |
4507 __ Int32Constant(kStringTag | kNotInternalizedTag)),
4515 Node* try_string_to_index_or_lookup_existing = __ ExternalConstant(
4518 __ ExternalConstant(ExternalReference::isolate_address(isolate()));
4522 __ Call(common()->Call(call_descriptor),
4526 __ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(),
4527 __ TaggedEqual(exp, val_internalized), frame_state);
4528 __ Goto(&if_same);
4531 __ Bind(&if_thinstring);
4535 __ LoadField(AccessBuilder::ForThinStringActual(), val);
4536 __ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(),
4537 __ TaggedEqual(exp, val_actual), frame_state);
4538 __ Goto(&if_same);
4542 __ Bind(&if_same);
4549 Node* check = __ TaggedEqual(exp, val);
4550 __ DeoptimizeIfNot(DeoptimizeReason::kWrongName, FeedbackSource(), check,
4556 __ Allocate(AllocationType::kYoung, __ IntPtrConstant(HeapNumber::kSize));
4557 __ StoreField(AccessBuilder::ForMap(), result, __ HeapNumberMapConstant());
4558 __ StoreField(AccessBuilder::ForHeapNumberValue(), result, value);
4565 return ChangeTaggedInt32ToSmi(__ Word32Shl(value, SmiShiftBitsConstant()));
4567 return __ WordShl(value, SmiShiftBitsConstant());
4574 return COMPRESS_POINTERS_BOOL ? __ BitcastWord32ToWord64(value)
4580 value = __ ChangeInt32ToInt64(value);
4587 value = __ TruncateInt64ToInt32(value);
4607 value = __ ChangeUint32ToUint64(value);
4615 Node* smi_value = __ Word32Shl(value, SmiShiftBitsConstant());
4618 return COMPRESS_POINTERS_BOOL ? __ BitcastWord32ToWord64(smi_value)
4619 : __ ChangeUint32ToUint64(smi_value);
4621 return __ WordShl(ChangeUint32ToUintPtr(value), SmiShiftBitsConstant());
4628 return __ WordSarShiftOutZeros(
4629 __ ChangeInt32ToInt64(__ TruncateInt64ToInt32(value)),
4632 return __ WordSarShiftOutZeros(value, SmiShiftBitsConstant());
4638 return __ Word32SarShiftOutZeros(__ TruncateInt64ToInt32(value),
4642 return __ TruncateInt64ToInt32(ChangeSmiToIntPtr(value));
4653 return __ Word32Equal(__ Word32And(value, __ Int32Constant(kSmiTagMask)),
4654 __ Int32Constant(kSmiTag));
4658 return __ Int32Constant(Smi::kMaxValue);
4663 return __ Int32Constant(kSmiShiftSize + kSmiTagSize);
4665 return __ IntPtrConstant(kSmiShiftSize + kSmiTagSize);
4670 return __ PlainPrimitiveToNumber(TNode<Object>::UncheckedCast(value));
4676 auto if_not_smi = __ MakeDeferredLabel();
4677 auto if_to_number_smi = __ MakeLabel();
4678 auto done = __ MakeLabel(MachineRepresentation::kWord32);
4681 __ GotoIfNot(check0, &if_not_smi);
4682 __ Goto(&done, ChangeSmiToInt32(value));
4684 __ Bind(&if_not_smi);
4686 __ PlainPrimitiveToNumber(TNode<Object>::UncheckedCast(value));
4689 __ GotoIf(check1, &if_to_number_smi);
4690 Node* number = __ LoadField(AccessBuilder::ForHeapNumberValue(), to_number);
4691 __ Goto(&done, __ TruncateFloat64ToWord32(number));
4693 __ Bind(&if_to_number_smi);
4694 __ Goto(&done, ChangeSmiToInt32(to_number));
4696 __ Bind(&done);
4703 auto if_not_smi = __ MakeDeferredLabel();
4704 auto if_to_number_smi = __ MakeLabel();
4705 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
4708 __ GotoIfNot(check0, &if_not_smi);
4710 __ Goto(&done, __ ChangeInt32ToFloat64(from_smi));
4712 __ Bind(&if_not_smi);
4714 __ PlainPrimitiveToNumber(TNode<Object>::UncheckedCast(value));
4716 __ GotoIf(check1, &if_to_number_smi);
4718 Node* number = __ LoadField(AccessBuilder::ForHeapNumberValue(), to_number);
4719 __ Goto(&done, number);
4721 __ Bind(&if_to_number_smi);
4723 number_from_smi = __ ChangeInt32ToFloat64(number_from_smi);
4724 __ Goto(&done, number_from_smi);
4726 __ Bind(&done);
4734 auto if_not_fixed_array = __ MakeDeferredLabel();
4735 auto done = __ MakeLabel(MachineRepresentation::kTagged);
4738 Node* elements_map = __ LoadField(AccessBuilder::ForMap(), elements);
4741 Node* check = __ TaggedEqual(elements_map, __ FixedArrayMapConstant());
4742 __ GotoIfNot(check, &if_not_fixed_array);
4744 __ Goto(&done, elements);
4746 __ Bind(&if_not_fixed_array);
4755 Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
4756 object, __ NoContextConstant());
4757 __ Goto(&done, result);
4759 __ Bind(&done);
4771 auto done = __ MakeLabel(MachineRepresentation::kTagged);
4772 auto if_grow = __ MakeDeferredLabel();
4773 auto if_not_grow = __ MakeLabel();
4776 Node* check = __ Uint32LessThan(index, elements_length);
4777 __ GotoIfNot(check, &if_grow);
4778 __ Goto(&done, elements);
4780 __ Bind(&if_grow);
4793 __ Call(call_descriptor, __ HeapConstant(callable.code()), object,
4794 ChangeInt32ToSmi(index), __ NoContextConstant());
4797 __ DeoptimizeIf(DeoptimizeReason::kCouldNotGrowElements, params.feedback(),
4799 __ Goto(&done, new_elements);
4801 __ Bind(&done);
4809 auto if_map_same = __ MakeDeferredLabel();
4810 auto done = __ MakeLabel();
4812 Node* source_map = __ HeapConstant(transition.source());
4813 Node* target_map = __ HeapConstant(transition.target());
4816 Node* object_map = __ LoadField(AccessBuilder::ForMap(), object);
4819 Node* check = __ TaggedEqual(object_map, source_map);
4820 __ GotoIf(check, &if_map_same);
4821 __ Goto(&done);
4823 __ Bind(&if_map_same);
4827 __ StoreField(AccessBuilder::ForMap(), object, target_map);
4835 __ Call(call_descriptor, __ CEntryStubConstant(1), object, target_map,
4836 __ ExternalConstant(ExternalReference::Create(id)),
4837 __ Int32Constant(2), __ NoContextConstant());
4841 __ Goto(&done);
4843 __ Bind(&done);
4849 __ LoadField(AccessBuilder::ForExternalIntPtr(), offset);
4850 return __ BitcastWordToTagged(object_pattern);
4856 Node* object_pattern = __ BitcastTaggedToWord(object);
4857 __ StoreField(AccessBuilder::ForExternalIntPtr(), offset, object_pattern);
4863 Node* value_map = __ LoadField(AccessBuilder::ForMap(), node);
4865 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
4866 Node* value_is_typed_array = __ Word32Equal(
4867 value_instance_type, __ Int32Constant(JS_TYPED_ARRAY_TYPE));
4868 __ GotoIfNot(value_is_typed_array, bailout);
4870 Node* bit_field2 = __ LoadField(AccessBuilder::ForMapBitField2(), value_map);
4871 Node* mask = __ Int32Constant(Map::Bits2::ElementsKindBits::kMask);
4872 Node* andit = __ Word32And(bit_field2, mask);
4873 Node* shift = __ Int32Constant(Map::Bits2::ElementsKindBits::kShift);
4874 Node* kind = __ Word32Shr(andit, shift);
4877 __ Word32Equal(kind, __ Int32Constant(expected_elements_kind));
4878 __ GotoIfNot(value_is_expected_elements_kind, bailout);
4881 __ LoadField(AccessBuilder::ForJSArrayBufferViewBuffer(), node);
4883 __ LoadField(AccessBuilder::ForJSArrayBufferBitField(), buffer);
4886 Node* buffer_is_not_detached = __ Word32Equal(
4887 __ Word32And(buffer_bit_field,
4888 __ Int32Constant(JSArrayBuffer::WasDetachedBit::kMask)),
4889 __ ZeroConstant());
4890 __ GotoIfNot(buffer_is_not_detached, bailout);
4893 Node* buffer_is_not_shared = __ Word32Equal(
4894 __ Word32And(buffer_bit_field,
4895 __ Int32Constant(JSArrayBuffer::IsSharedBit::kMask)),
4896 __ ZeroConstant());
4897 __ GotoIfNot(buffer_is_not_shared, bailout);
4902 __ LoadField(AccessBuilder::ForJSTypedArrayExternalPointer(), node);
4910 __ LoadField(AccessBuilder::ForJSTypedArrayBasePointer(), node);
4916 __ LoadField(AccessBuilder::ForJSTypedArrayLength(), node);
4932 Node* stack_slot = __ StackSlot(kSize, kAlign);
4934 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
4937 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
4955 Node* stack_slot = __ StackSlot(kSize, kAlign);
4956 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
4963 return __ TruncateFloat64ToFloat32(node);
4975 __ GotoIf(value_is_smi, if_error);
4977 Node* stack_slot = __ StackSlot(kSize, kAlign);
4978 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
4983 Node* value_map = __ LoadField(AccessBuilder::ForMap(), node);
4985 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
4987 __ Word32Equal(value_instance_type, __ Int32Constant(JS_ARRAY_TYPE));
4988 __ GotoIfNot(value_is_js_array, if_error);
4995 __ GotoIf(value_is_smi, if_error);
5014 auto merge = __ MakeLabel(MachineRepresentation::kTagged,
5022 auto next = __ MakeLabel();
5026 __ GotoIf(value_is_smi, if_error);
5035 Node* value_map = __ LoadField(AccessBuilder::ForMap(), node);
5037 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
5038 Node* value_is_js_array = __ Word32Equal(
5039 value_instance_type, __ Int32Constant(JS_ARRAY_TYPE));
5040 __ GotoIfNot(value_is_js_array, &next);
5044 Node* stack_slot = __ StackSlot(kSize, kAlign);
5046 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
5050 Node* target_address = __ ExternalConstant(ExternalReference::Create(
5052 __ Goto(&merge, target_address, stack_slot);
5064 Node* target_address = __ ExternalConstant(ExternalReference::Create(
5066 __ Goto(&merge, target_address, stack_slot);
5075 __ Bind(&next);
5077 __ Goto(if_error);
5079 __ Bind(&merge);
5088 Node* target_address = __ ExternalConstant(
5090 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
5095 Node* javascript_execution_assert = __ ExternalConstant(
5100 auto do_store = __ MakeLabel();
5102 __ Load(MachineType::Int8(), javascript_execution_assert, 0);
5103 __ GotoIf(__ Word32Equal(old_scope_value, __ Int32Constant(1)), &do_store);
5106 __ Unreachable(&do_store);
5107 __ Bind(&do_store);
5109 __ Store(StoreRepresentation(MachineRepresentation::kWord8, kNoWriteBarrier),
5110 javascript_execution_assert, 0, __ Int32Constant(0));
5115 inputs[c_arg_count + 2] = __ effect();
5116 inputs[c_arg_count + 3] = __ control();
5118 inputs[c_arg_count + 1] = __ effect();
5119 inputs[c_arg_count + 2] = __ control();
5123 Node* call = __ Call(call_descriptor, inputs_size, inputs);
5126 __ Store(StoreRepresentation(MachineRepresentation::kWord8, kNoWriteBarrier),
5127 javascript_execution_assert, 0, __ Int32Constant(1));
5130 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
5132 target_address, 0, __ IntPtrConstant(0));
5154 slow_inputs[index] = __ effect();
5155 slow_inputs[index + 1] = __ control();
5156 Node* slow_call_result = __ Call(
5184 stack_slot = __ StackSlot(kSize, kAlign);
5186 __ Store(
5190 __ Int32Constant(0));
5191 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
5197 __ Store(
5201 __ Int32Constant(0));
5202 __ Store(StoreRepresentation(MachineType::PointerRepresentation(),
5230 auto if_success = __ MakeLabel();
5231 auto if_error = __ MakeDeferredLabel();
5278 (c_functions.size() == 1) ? __ ExternalConstant(ExternalReference::Create(
5311 fast_call_result = __ UndefinedConstant();
5316 __ Word32And(c_call_result, __ Int32Constant(0xFF)));
5329 ChangeFloat64ToTagged(__ ChangeFloat32ToFloat64(c_call_result),
5341 ChangeFloat64ToTagged(__ ChangeInt64ToFloat64(c_call_result),
5346 auto merge = __ MakeLabel(MachineRepresentation::kTagged);
5349 Node* load = __ Load(
5353 Node* is_zero = __ Word32Equal(load, __ Int32Constant(0));
5354 __ Branch(is_zero, &if_success, &if_error);
5356 Node* true_constant = __ TrueConstant();
5357 __ Branch(true_constant, &if_success, &if_error);
5360 __ Bind(&if_success);
5361 __ Goto(&merge, fast_call_result);
5364 __ Bind(&if_error);
5367 __ Goto(&merge, slow_call_result);
5370 __ Bind(&merge);
5377 Node* zero = __ IntPtrConstant(0);
5378 Node* one = __ IntPtrConstant(1);
5382 index = __ ChangeInt32ToInt64(index);
5385 auto if_double = __ MakeDeferredLabel();
5386 auto done = __ MakeLabel(MachineRepresentation::kTagged);
5387 auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged);
5388 auto done_double = __ MakeLabel(MachineRepresentation::kFloat64);
5391 __ GotoIfNot(__ IntPtrEqual(__ WordAnd(index, one), zero), &if_double);
5397 auto if_outofobject = __ MakeLabel();
5398 __ GotoIf(__ IntLessThan(index, zero), &if_outofobject);
5403 __ IntAdd(__ WordShl(index, __ IntPtrConstant(kTaggedSizeLog2 - 1)),
5404 __ IntPtrConstant(JSObject::kHeaderSize - kHeapObjectTag));
5405 Node* field = __ Load(MachineType::AnyTagged(), object, offset);
5406 __ Goto(&loaded_field, field);
5411 __ Bind(&if_outofobject);
5413 Node* properties = __ LoadField(
5416 __ IntAdd(__ WordShl(__ IntSub(zero, index),
5417 __ IntPtrConstant(kTaggedSizeLog2 - 1)),
5418 __ IntPtrConstant((FixedArray::kHeaderSize - kTaggedSize) -
5420 Node* field = __ Load(MachineType::AnyTagged(), properties, offset);
5421 __ Goto(&loaded_field, field);
5427 __ Bind(&if_double);
5429 index = __ WordSar(index, one);
5432 auto if_outofobject = __ MakeLabel();
5433 __ GotoIf(__ IntLessThan(index, zero), &if_outofobject);
5438 __ IntAdd(__ WordShl(index, __ IntPtrConstant(kTaggedSizeLog2)),
5439 __ IntPtrConstant(JSObject::kHeaderSize - kHeapObjectTag));
5440 Node* field = __ Load(MachineType::AnyTagged(), object, offset);
5441 __ Goto(&loaded_field, field);
5444 __ Bind(&if_outofobject);
5446 Node* properties = __ LoadField(
5449 __ IntAdd(__ WordShl(__ IntSub(zero, index),
5450 __ IntPtrConstant(kTaggedSizeLog2)),
5451 __ IntPtrConstant((FixedArray::kHeaderSize - kTaggedSize) -
5453 Node* field = __ Load(MachineType::AnyTagged(), properties, offset);
5454 __ Goto(&loaded_field, field);
5458 __ Bind(&loaded_field);
5464 __ GotoIf(ObjectIsSmi(field), &done, field);
5465 Node* field_map = __ LoadField(AccessBuilder::ForMap(), field);
5466 __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done,
5469 Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field);
5470 __ Goto(&done_double, value);
5473 __ Bind(&done_double);
5476 __ Goto(&done, result);
5479 __ Bind(&done);
5492 Node* result = __ Word32ReverseBytes(value);
5493 result = __ Word32Sar(result, __ Int32Constant(16));
5498 Node* result = __ Word32ReverseBytes(value);
5499 result = __ Word32Shr(result, __ Int32Constant(16));
5505 return __ Word32ReverseBytes(value);
5508 Node* result = __ BitcastFloat32ToInt32(value);
5509 result = __ Word32ReverseBytes(result);
5510 result = __ BitcastInt32ToFloat32(result);
5516 Node* result = __ BitcastFloat64ToInt64(value);
5517 result = __ Word64ReverseBytes(result);
5518 result = __ BitcastInt64ToFloat64(result);
5521 Node* lo = __ Word32ReverseBytes(__ Float64ExtractLowWord32(value));
5522 Node* hi = __ Word32ReverseBytes(__ Float64ExtractHighWord32(value));
5523 Node* result = __ Float64Constant(0.0);
5524 result = __ Float64InsertLowWord32(result, hi);
5525 result = __ Float64InsertHighWord32(result, lo);
5546 __ Retain(object);
5551 Node* value = __ LoadUnaligned(machine_type, storage, index);
5552 auto big_endian = __ MakeLabel();
5553 auto done = __ MakeLabel(machine_type.representation());
5555 __ GotoIfNot(is_little_endian, &big_endian);
5558 __ Goto(&done, value);
5560 __ Goto(&done, BuildReverseBytes(element_type, value));
5564 __ Bind(&big_endian);
5567 __ Goto(&done, BuildReverseBytes(element_type, value));
5569 __ Goto(&done, value);
5574 __ Bind(&done);
5589 __ Retain(object);
5594 auto big_endian = __ MakeLabel();
5595 auto done = __ MakeLabel(machine_type.representation());
5597 __ GotoIfNot(is_little_endian, &big_endian);
5600 __ Goto(&done, value);
5602 __ Goto(&done, BuildReverseBytes(element_type, value));
5606 __ Bind(&big_endian);
5609 __ Goto(&done, BuildReverseBytes(element_type, value));
5611 __ Goto(&done, value);
5615 __ Bind(&done);
5616 __ StoreUnaligned(machine_type.representation(), storage, index,
5628 base = __ BitcastTaggedToWord(base);
5636 return __ UnsafePointerAdd(base, external);
5649 __ Retain(buffer);
5654 return __ LoadElement(AccessBuilder::ForTypedArrayElement(array_type, true),
5663 __ LoadElement(AccessBuilder::ForStackArgument(), base, index);
5665 return __ BitcastWordToTagged(argument);
5678 __ Retain(buffer);
5683 __ StoreElement(AccessBuilder::ForTypedArrayElement(array_type, true),
5695 Node* target_map = __ HeapConstant(target);
5698 __ StoreField(AccessBuilder::ForMap(), array, target_map);
5705 __ Call(call_descriptor, __ CEntryStubConstant(1), array, target_map,
5706 __ ExternalConstant(ExternalReference::Create(id)),
5707 __ Int32Constant(2), __ NoContextConstant());
5713 Node* ref_kind = __ Int32Constant(reference_kind);
5714 Node* ret = __ Int32LessThan(ref_kind, kind);
5759 Node* map = __ LoadField(AccessBuilder::ForMap(), array);
5762 Node* bit_field2 = __ LoadField(AccessBuilder::ForMapBitField2(), map);
5763 Node* mask = __ Int32Constant(Map::Bits2::ElementsKindBits::kMask);
5764 Node* andit = __ Word32And(bit_field2, mask);
5765 Node* shift = __ Int32Constant(Map::Bits2::ElementsKindBits::kShift);
5766 kind = __ Word32Shr(andit, shift);
5769 auto do_store = __ MakeLabel(MachineRepresentation::kWord32);
5771 __ GotoIf(ObjectIsSmi(value), &do_store, kind);
5774 auto transition_smi_array = __ MakeDeferredLabel();
5775 auto transition_double_to_fast = __ MakeDeferredLabel();
5777 __ GotoIfNot(IsElementsKindGreaterThan(kind, HOLEY_SMI_ELEMENTS),
5779 __ GotoIfNot(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS), &do_store,
5784 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
5785 Node* heap_number_map = __ HeapNumberMapConstant();
5786 Node* check = __ TaggedEqual(value_map, heap_number_map);
5787 __ GotoIfNot(check, &transition_double_to_fast);
5788 __ Goto(&do_store, kind);
5791 __ Bind(&transition_smi_array); // deferred code.
5795 auto if_value_not_heap_number = __ MakeLabel();
5796 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
5797 Node* heap_number_map = __ HeapNumberMapConstant();
5798 Node* check = __ TaggedEqual(value_map, heap_number_map);
5799 __ GotoIfNot(check, &if_value_not_heap_number);
5804 __ Goto(&do_store, __ Int32Constant(HOLEY_DOUBLE_ELEMENTS));
5806 __ Bind(&if_value_not_heap_number);
5809 __ Goto(&do_store, __ Int32Constant(HOLEY_ELEMENTS));
5813 __ Bind(&transition_double_to_fast); // deferred code.
5816 __ Goto(&do_store, __ Int32Constant(HOLEY_ELEMENTS));
5820 __ Bind(&do_store);
5823 Node* elements = __ LoadField(AccessBuilder::ForJSObjectElements(), array);
5824 auto if_kind_is_double = __ MakeLabel();
5825 auto done = __ MakeLabel();
5826 __ GotoIf(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS),
5830 __ StoreElement(AccessBuilder::ForFixedArrayElement(HOLEY_ELEMENTS),
5832 __ Goto(&done);
5834 __ Bind(&if_kind_is_double);
5837 auto do_double_store = __ MakeLabel();
5838 __ GotoIfNot(ObjectIsSmi(value), &do_double_store);
5841 Node* float_value = __ ChangeInt32ToFloat64(int_value);
5842 __ StoreElement(AccessBuilder::ForFixedDoubleArrayElement(), elements,
5844 __ Goto(&done);
5846 __ Bind(&do_double_store);
5849 __ LoadField(AccessBuilder::ForHeapNumberValue(), value);
5850 __ StoreElement(AccessBuilder::ForFixedDoubleArrayElement(), elements,
5851 index, __ Float64SilenceNaN(float_value));
5852 __ Goto(&done);
5856 __ Bind(&done);
5877 Node* map = __ LoadField(AccessBuilder::ForMap(), array);
5880 Node* bit_field2 = __ LoadField(AccessBuilder::ForMapBitField2(), map);
5881 Node* mask = __ Int32Constant(Map::Bits2::ElementsKindBits::kMask);
5882 Node* andit = __ Word32And(bit_field2, mask);
5883 Node* shift = __ Int32Constant(Map::Bits2::ElementsKindBits::kShift);
5884 kind = __ Word32Shr(andit, shift);
5887 auto do_store = __ MakeLabel();
5890 auto transition_smi_array = __ MakeDeferredLabel();
5892 __ GotoIfNot(IsElementsKindGreaterThan(kind, HOLEY_SMI_ELEMENTS),
5898 __ GotoIf(__ Word32Equal(kind, __ Int32Constant(HOLEY_DOUBLE_ELEMENTS)),
5900 __ Unreachable(&do_store);
5903 __ Bind(&transition_smi_array); // deferred code.
5908 __ Goto(&do_store);
5911 __ Bind(&do_store);
5913 Node* elements = __ LoadField(AccessBuilder::ForJSObjectElements(), array);
5914 __ StoreElement(AccessBuilder::ForFixedDoubleArrayElement(), elements, index,
5915 __ Float64SilenceNaN(value));
5938 Node* map = __ LoadField(AccessBuilder::ForMap(), array);
5941 Node* bit_field2 = __ LoadField(AccessBuilder::ForMapBitField2(), map);
5942 Node* mask = __ Int32Constant(Map::Bits2::ElementsKindBits::kMask);
5943 Node* andit = __ Word32And(bit_field2, mask);
5944 Node* shift = __ Int32Constant(Map::Bits2::ElementsKindBits::kShift);
5945 kind = __ Word32Shr(andit, shift);
5948 auto do_store = __ MakeLabel();
5950 auto transition_smi_array = __ MakeDeferredLabel();
5951 auto transition_double_to_fast = __ MakeDeferredLabel();
5953 __ GotoIfNot(IsElementsKindGreaterThan(kind, HOLEY_SMI_ELEMENTS),
5955 __ GotoIf(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS),
5957 __ Goto(&do_store);
5960 __ Bind(&transition_smi_array); // deferred code.
5964 __ Goto(&do_store);
5967 __ Bind(&transition_double_to_fast); // deferred code.
5970 __ Goto(&do_store);
5973 __ Bind(&do_store);
5975 Node* elements = __ LoadField(AccessBuilder::ForJSObjectElements(), array);
5983 __ StoreElement(access, elements, index, value);
6005 Node* map = __ LoadField(AccessBuilder::ForMap(), array);
6008 Node* bit_field2 = __ LoadField(AccessBuilder::ForMapBitField2(), map);
6009 Node* mask = __ Int32Constant(Map::Bits2::ElementsKindBits::kMask);
6010 Node* andit = __ Word32And(bit_field2, mask);
6011 Node* shift = __ Int32Constant(Map::Bits2::ElementsKindBits::kShift);
6012 kind = __ Word32Shr(andit, shift);
6015 Node* elements = __ LoadField(AccessBuilder::ForJSObjectElements(), array);
6016 auto if_kind_is_double = __ MakeLabel();
6017 auto done = __ MakeLabel();
6018 __ GotoIf(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS),
6029 __ StoreElement(access, elements, index, smi_value);
6030 __ Goto(&done);
6032 __ Bind(&if_kind_is_double);
6035 Node* float_value = __ ChangeInt32ToFloat64(value);
6036 __ StoreElement(AccessBuilder::ForFixedDoubleArrayElement(), elements,
6038 __ Goto(&done);
6041 __ Bind(&done);
6050 __ Call(call_descriptor, __ CEntryStubConstant(1),
6051 __ SmiConstant(static_cast<int>(reason)),
6052 __ ExternalConstant(ExternalReference::Create(id)),
6053 __ Int32Constant(1), __ NoContextConstant());
6065 return __ Call(call_descriptor, __ HeapConstant(callable.code()), args...,
6066 __ NoContextConstant());
6081 allocated_type = __ HeapConstant(type.AllocateOnHeap(factory()));
6084 allocated_type, __ SmiConstant(node->id()));
6107 auto convert_to_object = __ MakeDeferredLabel();
6108 auto done_convert = __ MakeLabel(MachineRepresentation::kTagged);
6111 __ GotoIf(ObjectIsSmi(value), &convert_to_object);
6113 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
6115 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
6116 Node* check = __ Uint32LessThan(
6117 value_instance_type, __ Uint32Constant(FIRST_JS_RECEIVER_TYPE));
6118 __ GotoIf(check, &convert_to_object);
6119 __ Goto(&done_convert, value);
6122 __ Bind(&convert_to_object);
6129 Node* native_context = __ LoadField(
6131 Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
6133 __ Goto(&done_convert, result);
6135 __ Bind(&done_convert);
6139 auto convert_to_object = __ MakeDeferredLabel();
6140 auto convert_global_proxy = __ MakeDeferredLabel();
6141 auto done_convert = __ MakeLabel(MachineRepresentation::kTagged);
6144 __ GotoIf(ObjectIsSmi(value), &convert_to_object);
6146 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
6148 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
6149 Node* check = __ Uint32LessThan(
6150 value_instance_type, __ Uint32Constant(FIRST_JS_RECEIVER_TYPE));
6151 __ GotoIf(check, &convert_to_object);
6152 __ Goto(&done_convert, value);
6155 __ Bind(&convert_to_object);
6156 __ GotoIf(__ TaggedEqual(value, __ UndefinedConstant()),
6158 __ GotoIf(__ TaggedEqual(value, __ NullConstant()),
6166 Node* native_context = __ LoadField(
6168 Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
6170 __ Goto(&done_convert, result);
6173 __ Bind(&convert_global_proxy);
6174 __ Goto(&done_convert, global_proxy);
6176 __ Bind(&done_convert);
6215 auto if_not_positive = __ MakeDeferredLabel();
6216 auto if_greater_than_two_52 = __ MakeDeferredLabel();
6217 auto if_less_than_minus_two_52 = __ MakeDeferredLabel();
6218 auto if_zero = __ MakeDeferredLabel();
6219 auto done_temp3 = __ MakeLabel(MachineRepresentation::kFloat64);
6220 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
6222 Node* const zero = __ Float64Constant(0.0);
6223 Node* const two_52 = __ Float64Constant(4503599627370496.0E0);
6224 Node* const one = __ Float64Constant(1.0);
6226 Node* check0 = __ Float64LessThan(zero, input);
6227 __ GotoIfNot(check0, &if_not_positive);
6229 Node* check1 = __ Float64LessThanOrEqual(two_52, input);
6230 __ GotoIf(check1, &if_greater_than_two_52);
6232 Node* temp1 = __ Float64Sub(__ Float64Add(two_52, input), two_52);
6233 __ GotoIfNot(__ Float64LessThan(temp1, input), &done, temp1);
6234 __ Goto(&done, __ Float64Add(temp1, one));
6237 __ Bind(&if_greater_than_two_52);
6238 __ Goto(&done, input);
6241 __ Bind(&if_not_positive);
6243 Node* check1 = __ Float64Equal(input, zero);
6244 __ GotoIf(check1, &if_zero);
6246 Node* const minus_two_52 = __ Float64Constant(-4503599627370496.0E0);
6247 Node* check2 = __ Float64LessThanOrEqual(input, minus_two_52);
6248 __ GotoIf(check2, &if_less_than_minus_two_52);
6251 Node* const minus_zero = __ Float64Constant(-0.0);
6252 Node* temp1 = __ Float64Sub(minus_zero, input);
6253 Node* temp2 = __ Float64Sub(__ Float64Add(two_52, temp1), two_52);
6254 Node* check3 = __ Float64LessThan(temp1, temp2);
6255 __ GotoIfNot(check3, &done_temp3, temp2);
6256 __ Goto(&done_temp3, __ Float64Sub(temp2, one));
6258 __ Bind(&done_temp3);
6260 __ Goto(&done, __ Float64Sub(minus_zero, temp3));
6262 __ Bind(&if_less_than_minus_two_52);
6263 __ Goto(&done, input);
6265 __ Bind(&if_zero);
6266 __ Goto(&done, input);
6268 __ Bind(&done);
6274 return __ Float64RoundDown(value);
6304 auto if_not_positive = __ MakeDeferredLabel();
6305 auto if_greater_than_two_52 = __ MakeDeferredLabel();
6306 auto if_less_than_minus_two_52 = __ MakeDeferredLabel();
6307 auto if_temp2_lt_temp1 = __ MakeLabel();
6308 auto if_zero = __ MakeDeferredLabel();
6309 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
6311 Node* const zero = __ Float64Constant(0.0);
6312 Node* const two_52 = __ Float64Constant(4503599627370496.0E0);
6314 Node* check0 = __ Float64LessThan(zero, input);
6315 __ GotoIfNot(check0, &if_not_positive);
6317 Node* check1 = __ Float64LessThanOrEqual(two_52, input);
6318 __ GotoIf(check1, &if_greater_than_two_52);
6320 Node* const one = __ Float64Constant(1.0);
6321 Node* temp1 = __ Float64Sub(__ Float64Add(two_52, input), two_52);
6322 __ GotoIfNot(__ Float64LessThan(input, temp1), &done, temp1);
6323 __ Goto(&done, __ Float64Sub(temp1, one));
6326 __ Bind(&if_greater_than_two_52);
6327 __ Goto(&done, input);
6330 __ Bind(&if_not_positive);
6332 Node* check1 = __ Float64Equal(input, zero);
6333 __ GotoIf(check1, &if_zero);
6335 Node* const minus_two_52 = __ Float64Constant(-4503599627370496.0E0);
6336 Node* check2 = __ Float64LessThanOrEqual(input, minus_two_52);
6337 __ GotoIf(check2, &if_less_than_minus_two_52);
6340 Node* const minus_zero = __ Float64Constant(-0.0);
6341 Node* temp1 = __ Float64Sub(minus_zero, input);
6342 Node* temp2 = __ Float64Sub(__ Float64Add(two_52, temp1), two_52);
6343 Node* check3 = __ Float64LessThan(temp2, temp1);
6344 __ GotoIf(check3, &if_temp2_lt_temp1);
6345 __ Goto(&done, __ Float64Sub(minus_zero, temp2));
6347 __ Bind(&if_temp2_lt_temp1);
6348 __ Goto(&done, __ Float64Sub(__ Float64Constant(-1.0), temp2));
6350 __ Bind(&if_less_than_minus_two_52);
6351 __ Goto(&done, input);
6353 __ Bind(&if_zero);
6354 __ Goto(&done, input);
6356 __ Bind(&done);
6393 auto if_is_half = __ MakeLabel();
6394 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
6397 Node* temp1 = __ Float64Sub(input, value);
6399 Node* const half = __ Float64Constant(0.5);
6400 Node* check0 = __ Float64LessThan(temp1, half);
6401 __ GotoIf(check0, &done, value);
6403 Node* const one = __ Float64Constant(1.0);
6404 Node* check1 = __ Float64LessThan(half, temp1);
6405 __ GotoIfNot(check1, &if_is_half);
6406 __ Goto(&done, __ Float64Add(value, one));
6408 __ Bind(&if_is_half);
6409 Node* temp2 = __ Float64Mod(value, __ Float64Constant(2.0));
6410 Node* check2 = __ Float64Equal(temp2, __ Float64Constant(0.0));
6411 __ GotoIf(check2, &done, value);
6412 __ Goto(&done, __ Float64Add(value, one));
6414 __ Bind(&done);
6420 return __ Float64RoundTruncate(input);
6448 auto if_not_positive = __ MakeDeferredLabel();
6449 auto if_greater_than_two_52 = __ MakeDeferredLabel();
6450 auto if_less_than_minus_two_52 = __ MakeDeferredLabel();
6451 auto if_zero = __ MakeDeferredLabel();
6452 auto done_temp3 = __ MakeLabel(MachineRepresentation::kFloat64);
6453 auto done = __ MakeLabel(MachineRepresentation::kFloat64);
6455 Node* const zero = __ Float64Constant(0.0);
6456 Node* const two_52 = __ Float64Constant(4503599627370496.0E0);
6457 Node* const one = __ Float64Constant(1.0);
6459 Node* check0 = __ Float64LessThan(zero, input);
6460 __ GotoIfNot(check0, &if_not_positive);
6462 Node* check1 = __ Float64LessThanOrEqual(two_52, input);
6463 __ GotoIf(check1, &if_greater_than_two_52);
6465 Node* temp1 = __ Float64Sub(__ Float64Add(two_52, input), two_52);
6466 __ GotoIfNot(__ Float64LessThan(input, temp1), &done, temp1);
6467 __ Goto(&done, __ Float64Sub(temp1, one));
6470 __ Bind(&if_greater_than_two_52);
6471 __ Goto(&done, input);
6474 __ Bind(&if_not_positive);
6476 Node* check1 = __ Float64Equal(input, zero);
6477 __ GotoIf(check1, &if_zero);
6479 Node* const minus_two_52 = __ Float64Constant(-4503599627370496.0E0);
6480 Node* check2 = __ Float64LessThanOrEqual(input, minus_two_52);
6481 __ GotoIf(check2, &if_less_than_minus_two_52);
6484 Node* const minus_zero = __ Float64Constant(-0.0);
6485 Node* temp1 = __ Float64Sub(minus_zero, input);
6486 Node* temp2 = __ Float64Sub(__ Float64Add(two_52, temp1), two_52);
6487 Node* check3 = __ Float64LessThan(temp1, temp2);
6488 __ GotoIfNot(check3, &done_temp3, temp2);
6489 __ Goto(&done_temp3, __ Float64Sub(temp2, one));
6491 __ Bind(&done_temp3);
6493 __ Goto(&done, __ Float64Sub(minus_zero, temp3));
6495 __ Bind(&if_less_than_minus_two_52);
6496 __ Goto(&done, input);
6498 __ Bind(&if_zero);
6499 __ Goto(&done, input);
6501 __ Bind(&done);
6527 return __ Call(call_descriptor, __ HeapConstant(callable.code()), table,
6528 key, __ NoContextConstant());
6534 value = __ Int32Add(__ Word32Xor(value, __ Int32Constant(0xFFFFFFFF)),
6535 __ Word32Shl(value, __ Int32Constant(15)));
6536 value = __ Word32Xor(value, __ Word32Shr(value, __ Int32Constant(12)));
6537 value = __ Int32Add(value, __ Word32Shl(value, __ Int32Constant(2)));
6538 value = __ Word32Xor(value, __ Word32Shr(value, __ Int32Constant(4)));
6539 value = __ Int32Mul(value, __ Int32Constant(2057));
6540 value = __ Word32Xor(value, __ Word32Shr(value, __ Int32Constant(16)));
6541 value = __ Word32And(value, __ Int32Constant(0x3FFFFFFF));
6553 Node* number_of_buckets = ChangeSmiToIntPtr(__ LoadField(
6555 hash = __ WordAnd(hash, __ IntSub(number_of_buckets, __ IntPtrConstant(1)));
6556 Node* first_entry = ChangeSmiToIntPtr(__ Load(
6558 __ IntAdd(__ WordShl(hash, __ IntPtrConstant(kTaggedSizeLog2)),
6559 __ IntPtrConstant(OrderedHashMap::HashTableStartOffset() -
6562 auto loop = __ MakeLoopLabel(MachineType::PointerRepresentation());
6563 auto done = __ MakeLabel(MachineType::PointerRepresentation());
6564 __ Goto(&loop, first_entry);
6565 __ Bind(&loop);
6569 __ IntPtrEqual(entry, __ IntPtrConstant(OrderedHashMap::kNotFound));
6570 __ GotoIf(check, &done, entry);
6571 entry = __ IntAdd(
6572 __ IntMul(entry, __ IntPtrConstant(OrderedHashMap::kEntrySize)),
6575 Node* candidate_key = __ Load(
6577 __ IntAdd(__ WordShl(entry, __ IntPtrConstant(kTaggedSizeLog2)),
6578 __ IntPtrConstant(OrderedHashMap::HashTableStartOffset() -
6581 auto if_match = __ MakeLabel();
6582 auto if_notmatch = __ MakeLabel();
6583 auto if_notsmi = __ MakeDeferredLabel();
6584 __ GotoIfNot(ObjectIsSmi(candidate_key), &if_notsmi);
6585 __ Branch(__ Word32Equal(ChangeSmiToInt32(candidate_key), key), &if_match,
6588 __ Bind(&if_notsmi);
6589 __ GotoIfNot(
6590 __ TaggedEqual(__ LoadField(AccessBuilder::ForMap(), candidate_key),
6591 __ HeapNumberMapConstant()),
6593 __ Branch(__ Float64Equal(__ LoadField(AccessBuilder::ForHeapNumberValue(),
6595 __ ChangeInt32ToFloat64(key)),
6598 __ Bind(&if_match);
6599 __ Goto(&done, entry);
6601 __ Bind(&if_notmatch);
6603 Node* next_entry = ChangeSmiToIntPtr(__ Load(
6605 __ IntAdd(
6606 __ WordShl(entry, __ IntPtrConstant(kTaggedSizeLog2)),
6607 __ IntPtrConstant(OrderedHashMap::HashTableStartOffset() +
6610 __ Goto(&loop, next_entry);
6614 __ Bind(&done);
6623 return __ Call(call_descriptor, __ CEntryStubConstant(1),
6624 __ ExternalConstant(ExternalReference::Create(id)),
6625 __ Int32Constant(0), __ NoContextConstant());
6630 return __ TruncateInt64ToInt32(value);
6636 return __ Word32Equal(
6637 __ Word32And(
6638 TruncateWordToInt32(__ BitcastTaggedToWordForTagAndSmiBits(value)),
6639 __ Int32Constant(kHeapObjectTagMask)),
6640 __ Int32Constant(kHeapObjectTag));
6645 return __ BitcastWordToTagged(
6646 __ WordOr(__ BitcastTaggedToWord(heap_object),
6647 __ IntPtrConstant(kWeakHeapObjectTag)));
6652 return __ BitcastWordToTagged(
6653 __ WordAnd(__ BitcastMaybeObjectToWord(maybe_object),
6654 __ IntPtrConstant(~kWeakHeapObjectMask)));
6660 return __ Word32Equal(
6661 __ Word32And(
6662 TruncateWordToInt32(__ BitcastMaybeObjectToWord(maybe_object)),
6663 __ Uint32Constant(~static_cast<uint32_t>(kWeakHeapObjectMask))),
6664 TruncateWordToInt32(__ BitcastTaggedToWord(value)));
6666 return __ WordEqual(__ WordAnd(__ BitcastMaybeObjectToWord(maybe_object),
6667 __ IntPtrConstant(~kWeakHeapObjectMask)),
6668 __ BitcastTaggedToWord(value));
6673 return __ Word32Equal(
6674 TruncateWordToInt32(__ BitcastMaybeObjectToWord(maybe_object)),
6675 __ Int32Constant(kClearedWeakHeapObjectLower32));
6686 Node* map = __ HeapConstant(factory()->bigint_map());
6688 Node* result = __ Allocate(AllocationType::kYoung,
6689 __ IntPtrConstant(BigInt::SizeFor(digit ? 1 : 0)));
6690 __ StoreField(AccessBuilder::ForMap(), result, map);
6691 __ StoreField(AccessBuilder::ForBigIntBitfield(), result,
6692 bitfield ? bitfield : __ Int32Constant(zero_bitfield));
6696 __ StoreField(AccessBuilder::ForBigIntOptionalPadding(), result,
6697 __ IntPtrConstant(0));
6700 __ StoreField(AccessBuilder::ForBigIntLeastSignificantDigit64(), result,
6706 #undef __