Lines Matching refs:Node
12 using compiler::Node;
22 // FLAG_csa_trap_on_node should be in a form "STUB,NODE" where STUB is a
23 // string specifying the name of a stub and NODE is number specifying node id.
40 // Bad node id.
58 Node* condition = codition_body();
83 Node* CodeStubAssembler::Select(Node* condition, const NodeGenerator& true_body,
105 Node* CodeStubAssembler::SelectConstant(Node* condition, Node* true_value,
106 Node* false_value,
112 Node* CodeStubAssembler::SelectInt32Constant(Node* condition, int true_value,
119 Node* CodeStubAssembler::SelectIntPtrConstant(Node* condition, int true_value,
126 Node* CodeStubAssembler::SelectBooleanConstant(Node* condition) {
131 Node* CodeStubAssembler::SelectTaggedConstant(Node* condition, Node* true_value,
132 Node* false_value) {
137 Node* CodeStubAssembler::SelectSmiConstant(Node* condition, Smi* true_value,
144 Node* CodeStubAssembler::NoContextConstant() { return NumberConstant(0); }
147 Node* CodeStubAssembler::name##Constant() { \
154 Node* CodeStubAssembler::Is##name(Node* value) { \
160 Node* CodeStubAssembler::HashSeed() {
164 Node* CodeStubAssembler::StaleRegisterConstant() {
168 Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) {
177 bool CodeStubAssembler::IsIntPtrOrSmiConstantZero(Node* test) {
187 Node* CodeStubAssembler::IntPtrRoundUpToPowerOfTwo32(Node* value) {
197 Node* CodeStubAssembler::WordIsPowerOfTwo(Node* value) {
208 Node* CodeStubAssembler::Float64Round(Node* x) {
209 Node* one = Float64Constant(1.0);
210 Node* one_half = Float64Constant(0.5);
226 Node* CodeStubAssembler::Float64Ceil(Node* x) {
231 Node* one = Float64Constant(1.0);
232 Node* zero = Float64Constant(0.0);
233 Node* two_52 = Float64Constant(4503599627370496.0E0);
234 Node* minus_two_52 = Float64Constant(-4503599627370496.0E0);
263 Node* minus_x = Float64Neg(x);
278 Node* CodeStubAssembler::Float64Floor(Node* x) {
283 Node* one = Float64Constant(1.0);
284 Node* zero = Float64Constant(0.0);
285 Node* two_52 = Float64Constant(4503599627370496.0E0);
286 Node* minus_two_52 = Float64Constant(-4503599627370496.0E0);
315 Node* minus_x = Float64Neg(x);
330 Node* CodeStubAssembler::Float64RoundToEven(Node* x) {
335 Node* f = Float64Floor(x);
336 Node* f_and_half = Float64Add(f, Float64Constant(0.5));
344 Node* f_mod_2 = Float64Mod(f, Float64Constant(2.0));
361 Node* CodeStubAssembler::Float64Trunc(Node* x) {
366 Node* one = Float64Constant(1.0);
367 Node* zero = Float64Constant(0.0);
368 Node* two_52 = Float64Constant(4503599627370496.0E0);
369 Node* minus_two_52 = Float64Constant(-4503599627370496.0E0);
406 Node* minus_x = Float64Neg(x);
422 Node* CodeStubAssembler::SmiShiftBitsConstant() {
426 Node* CodeStubAssembler::SmiFromWord32(Node* value) {
431 Node* CodeStubAssembler::SmiTag(Node* value) {
439 Node* CodeStubAssembler::SmiUntag(Node* value) {
443 Node* CodeStubAssembler::SmiToWord32(Node* value) {
444 Node* result = SmiUntag(value);
448 Node* CodeStubAssembler::SmiToFloat64(Node* value) {
452 Node* CodeStubAssembler::SmiMax(Node* a, Node* b) {
456 Node* CodeStubAssembler::SmiMin(Node* a, Node* b) {
460 Node* CodeStubAssembler::SmiMod(Node* a, Node* b) {
481 Node* r = Int32Mod(a, b);
499 Node* r = Int32Mod(a, b);
523 Node* CodeStubAssembler::SmiMul(Node* a, Node* b) {
530 Node* lhs32 = SmiToWord32(a);
531 Node* rhs32 = SmiToWord32(b);
532 Node* pair = Int32MulWithOverflow(lhs32, rhs32);
534 Node* overflow = Projection(1, pair);
544 Node* answer = Projection(0, pair);
545 Node* zero = Int32Constant(0);
554 Node* or_result = Word32Or(lhs32, rhs32);
574 Node* value = Float64Mul(var_lhs_float64.value(), var_rhs_float64.value());
575 Node* result = AllocateHeapNumberWithValue(value);
584 Node* CodeStubAssembler::TruncateWordToWord32(Node* value) {
591 Node* CodeStubAssembler::TaggedIsSmi(Node* a) {
596 Node* CodeStubAssembler::TaggedIsNotSmi(Node* a) {
602 Node* CodeStubAssembler::TaggedIsPositiveSmi(Node* a) {
608 Node* CodeStubAssembler::WordIsWordAligned(Node* word) {
614 Node* receiver_map, Label* definitely_no_elements,
618 Node* empty_elements = LoadRoot(Heap::kEmptyFixedArrayRootIndex);
623 Node* map = var_map.value();
624 Node* prototype = LoadMapPrototype(map);
626 Node* prototype_map = LoadMap(prototype);
641 void CodeStubAssembler::BranchIfJSReceiver(Node* object, Label* if_true,
650 void CodeStubAssembler::BranchIfJSObject(Node* object, Label* if_true,
660 Node* object, Node* context, CodeStubAssembler::FastJSArrayAccessMode mode,
665 Node* map = LoadMap(object);
671 Node* elements_kind = LoadMapElementsKind(map);
683 Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes,
685 Node* top_address,
686 Node* limit_address) {
687 Node* top = Load(MachineType::Pointer(), top_address);
688 Node* limit = Load(MachineType::Pointer(), limit_address);
699 Node* runtime_flags = SmiConstant(
702 Node* const runtime_result =
711 Node* new_top = IntPtrAdd(top, size_in_bytes);
716 Node* runtime_result;
718 Node* runtime_flags = SmiConstant(
733 Node* no_runtime_result = top;
745 Node* CodeStubAssembler::AllocateRawAligned(Node* size_in_bytes,
747 Node* top_address,
748 Node* limit_address) {
749 Node* top = Load(MachineType::Pointer(), top_address);
750 Node* limit = Load(MachineType::Pointer(), limit_address);
759 Node* not_aligned_size =
797 Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) {
800 Node* top_address = ExternalConstant(
814 Node* limit_address = IntPtrAdd(top_address, IntPtrConstant(kPointerSize));
825 Node* CodeStubAssembler::Allocate(int size_in_bytes, AllocationFlags flags) {
829 Node* CodeStubAssembler::InnerAllocate(Node* previous, Node* offset) {
833 Node* CodeStubAssembler::InnerAllocate(Node* previous, int offset) {
837 Node* CodeStubAssembler::IsRegularHeapObjectSize(Node* size) {
842 void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
865 Node* value_map = LoadMap(value);
869 Node* value_map_bitfield = LoadMapBitField(value_map);
870 Node* value_map_undetectable =
883 Node* value_value = LoadObjectField(value, HeapNumber::kValueOffset,
893 Node* CodeStubAssembler::LoadFromFrame(int offset, MachineType rep) {
894 Node* frame_pointer = LoadFramePointer();
898 Node* CodeStubAssembler::LoadFromParentFrame(int offset, MachineType rep) {
899 Node* frame_pointer = LoadParentFramePointer();
903 Node* CodeStubAssembler::LoadBufferObject(Node* buffer, int offset,
908 Node* CodeStubAssembler::LoadObjectField(Node* object, int offset,
913 Node* CodeStubAssembler::LoadObjectField(Node* object, Node* offset,
918 Node* CodeStubAssembler::LoadAndUntagObjectField(Node* object, int offset) {
930 Node* CodeStubAssembler::LoadAndUntagToWord32ObjectField(Node* object,
943 Node* CodeStubAssembler::LoadAndUntagSmi(Node* base, int index) {
956 Node* CodeStubAssembler::LoadAndUntagToWord32Root(
958 Node* roots_array_start =
972 Node* CodeStubAssembler::StoreAndTagSmi(Node* base, int offset, Node* value) {
990 Node* CodeStubAssembler::LoadHeapNumberValue(Node* object) {
995 Node* CodeStubAssembler::LoadMap(Node* object) {
999 Node* CodeStubAssembler::LoadInstanceType(Node* object) {
1003 Node* CodeStubAssembler::HasInstanceType(Node* object,
1008 Node* CodeStubAssembler::DoesntHaveInstanceType(Node* object,
1013 Node* CodeStubAssembler::LoadProperties(Node* object) {
1017 Node* CodeStubAssembler::LoadElements(Node* object) {
1021 Node* CodeStubAssembler::LoadJSArrayLength(Node* array) {
1026 Node* CodeStubAssembler::LoadFixedArrayBaseLength(Node* array) {
1030 Node* CodeStubAssembler::LoadAndUntagFixedArrayBaseLength(Node* array) {
1034 Node* CodeStubAssembler::LoadMapBitField(Node* map) {
1039 Node* CodeStubAssembler::LoadMapBitField2(Node* map) {
1044 Node* CodeStubAssembler::LoadMapBitField3(Node* map) {
1049 Node* CodeStubAssembler::LoadMapInstanceType(Node* map) {
1053 Node* CodeStubAssembler::LoadMapElementsKind(Node* map) {
1055 Node* bit_field2 = LoadMapBitField2(map);
1059 Node* CodeStubAssembler::LoadMapDescriptors(Node* map) {
1064 Node* CodeStubAssembler::LoadMapPrototype(Node* map) {
1069 Node* CodeStubAssembler::LoadMapPrototypeInfo(Node* map,
1072 Node* prototype_info =
1081 Node* CodeStubAssembler::LoadMapInstanceSize(Node* map) {
1087 Node* CodeStubAssembler::LoadMapInobjectProperties(Node* map) {
1099 Node* CodeStubAssembler::LoadMapConstructorFunctionIndex(Node* map) {
1110 Node* CodeStubAssembler::LoadMapConstructor(Node* map) {
1120 Node* is_map_type =
1131 Node* CodeStubAssembler::LoadSharedFunctionInfoSpecialField(
1132 Node* shared, int offset, ParameterMode mode) {
1134 Node* result = LoadObjectField(shared, offset, MachineType::Int32());
1142 Node* result = LoadObjectField(shared, offset);
1150 Node* CodeStubAssembler::LoadNameHashField(Node* name) {
1155 Node* CodeStubAssembler::LoadNameHash(Node* name, Label* if_hash_not_computed) {
1156 Node* hash_field = LoadNameHashField(name);
1166 Node* CodeStubAssembler::LoadStringLength(Node* object) {
1171 Node* CodeStubAssembler::LoadJSValueValue(Node* object) {
1176 Node* CodeStubAssembler::LoadWeakCellValueUnchecked(Node* weak_cell) {
1181 Node* CodeStubAssembler::LoadWeakCellValue(Node* weak_cell, Label* if_cleared) {
1183 Node* value = LoadWeakCellValueUnchecked(weak_cell);
1190 Node* CodeStubAssembler::LoadFixedArrayElement(Node* object, Node* index_node,
1195 Node* offset = ElementOffsetFromIndex(index_node, FAST_HOLEY_ELEMENTS,
1200 Node* CodeStubAssembler::LoadFixedTypedArrayElement(
1201 Node* data_pointer, Node* index_node, ElementsKind elements_kind,
1203 Node* offset =
1238 Node* CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement(
1239 Node* object, Node* index_node, int additional_offset,
1248 Node* offset = ElementOffsetFromIndex(index_node, FAST_HOLEY_ELEMENTS,
1257 Node* CodeStubAssembler::LoadFixedDoubleArrayElement(
1258 Node* object, Node* index_node, MachineType machine_type,
1263 Node* offset = ElementOffsetFromIndex(index_node, FAST_HOLEY_DOUBLE_ELEMENTS,
1268 Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset,
1276 Node* element = Load(MachineType::Uint64(), base, offset);
1279 Node* element_upper = Load(
1293 Node* CodeStubAssembler::LoadContextElement(Node* context, int slot_index) {
1298 Node* CodeStubAssembler::LoadContextElement(Node* context, Node* slot_index) {
1299 Node* offset =
1305 Node* CodeStubAssembler::StoreContextElement(Node* context, int slot_index,
1306 Node* value) {
1311 Node* CodeStubAssembler::StoreContextElement(Node* context, Node* slot_index,
1312 Node* value) {
1313 Node* offset =
1319 Node* CodeStubAssembler::StoreContextElementNoWriteBarrier(Node* context,
1321 Node* value) {
1327 Node* CodeStubAssembler::LoadNativeContext(Node* context) {
1331 Node* CodeStubAssembler::LoadJSArrayElementsMap(ElementsKind kind,
1332 Node* native_context) {
1337 Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) {
1342 Node* CodeStubAssembler::StoreObjectField(
1343 Node* object, int offset, Node* value) {
1348 Node* CodeStubAssembler::StoreObjectField(Node* object, Node* offset,
1349 Node* value) {
1358 Node* CodeStubAssembler::StoreObjectFieldNoWriteBarrier(
1359 Node* object, int offset, Node* value, MachineRepresentation rep) {
1364 Node* CodeStubAssembler::StoreObjectFieldNoWriteBarrier(
1365 Node* object, Node* offset, Node* value, MachineRepresentation rep) {
1374 Node* CodeStubAssembler::StoreMap(Node* object, Node* map) {
1380 Node* CodeStubAssembler::StoreMapNoWriteBarrier(
1381 Node* object, Heap::RootListIndex map_root_index) {
1385 Node* CodeStubAssembler::StoreMapNoWriteBarrier(Node* object, Node* map) {
1392 Node* CodeStubAssembler::StoreObjectFieldRoot(Node* object, int offset,
1401 Node* CodeStubAssembler::StoreFixedArrayElement(Node* object, Node* index_node,
1402 Node* value,
1410 Node* offset = ElementOffsetFromIndex(index_node, FAST_HOLEY_ELEMENTS,
1420 Node* CodeStubAssembler::StoreFixedDoubleArrayElement(
1421 Node* object, Node* index_node, Node* value, ParameterMode parameter_mode) {
1423 Node* offset =
1430 Node* CodeStubAssembler::BuildAppendJSArray(ElementsKind kind, Node* context,
1431 Node* array,
1444 Node* capacity =
1449 Node* first = arg_index.value();
1450 Node* growth = IntPtrSub(args.GetLength(), first);
1451 Node* new_length =
1454 Node* new_capacity = CalculateNewElementsCapacity(new_length, mode);
1460 Node* elements = var_elements.value();
1467 [this, kind, mode, elements, &var_length, &pre_bailout](Node* arg) {
1474 Node* double_value = ChangeNumberToFloat64(arg);
1488 Node* length = ParameterToTagged(var_length.value(), mode);
1496 Node* length = ParameterToTagged(var_length.value(), mode);
1498 Node* diff = SmiSub(length, LoadJSArrayLength(array));
1508 Node* CodeStubAssembler::AllocateHeapNumber(MutableMode mode) {
1509 Node* result = Allocate(HeapNumber::kSize, kNone);
1517 Node* CodeStubAssembler::AllocateHeapNumberWithValue(Node* value,
1519 Node* result = AllocateHeapNumber(mode);
1524 Node* CodeStubAssembler::AllocateSeqOneByteString(int length,
1530 Node* result = Allocate(SeqOneByteString::SizeFor(length), flags);
1542 Node* CodeStubAssembler::AllocateSeqOneByteString(Node* context, Node* length,
1553 Node* raw_size = GetArrayAllocationSize(
1556 Node* size = WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask));
1563 Node* result = Allocate(size, flags);
1579 Node* result = CallRuntime(Runtime::kAllocateSeqOneByteString, context,
1595 Node* CodeStubAssembler::AllocateSeqTwoByteString(int length,
1601 Node* result = Allocate(SeqTwoByteString::SizeFor(length), flags);
1613 Node* CodeStubAssembler::AllocateSeqTwoByteString(Node* context, Node* length,
1624 Node* raw_size = GetArrayAllocationSize(
1627 Node* size = WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask));
1634 Node* result = Allocate(size, flags);
1651 Node* result =
1668 Node* CodeStubAssembler::AllocateSlicedString(
1669 Heap::RootListIndex map_root_index, Node* length, Node* parent,
1670 Node* offset) {
1672 Node* result = Allocate(SlicedString::kSize);
1688 Node* CodeStubAssembler::AllocateSlicedOneByteString(Node* length, Node* parent,
1689 Node* offset) {
1694 Node* CodeStubAssembler::AllocateSlicedTwoByteString(Node* length, Node* parent,
1695 Node* offset) {
1700 Node* CodeStubAssembler::AllocateConsString(Heap::RootListIndex map_root_index,
1701 Node* length, Node* first,
1702 Node* second,
1705 Node* result = Allocate(ConsString::kSize, flags);
1727 Node* CodeStubAssembler::AllocateOneByteConsString(Node* length, Node* first,
1728 Node* second,
1734 Node* CodeStubAssembler::AllocateTwoByteConsString(Node* length, Node* first,
1735 Node* second,
1741 Node* CodeStubAssembler::NewConsString(Node* context, Node* length, Node* left,
1742 Node* right, AllocationFlags flags) {
1746 Node* left_instance_type = LoadInstanceType(left);
1747 Node* right_instance_type = LoadInstanceType(right);
1750 Node* anded_instance_types =
1752 Node* xored_instance_types =
1796 Node* CodeStubAssembler::AllocateRegExpResult(Node* context, Node* length,
1797 Node* index, Node* input) {
1798 Node* const max_length =
1806 Node* const result = Allocate(JSRegExpResult::kSize);
1809 Node* const native_context = LoadNativeContext(context);
1810 Node* const map =
1815 Node* const empty_array = EmptyFixedArrayConstant();
1825 Node* const zero = IntPtrConstant(0);
1826 Node* const length_intptr = SmiUntag(length);
1829 Node* const elements = AllocateFixedArray(elements_kind, length_intptr);
1839 Node* CodeStubAssembler::AllocateNameDictionary(int at_least_space_for) {
1843 Node* CodeStubAssembler::AllocateNameDictionary(Node* at_least_space_for) {
1848 Node* capacity = HashTableComputeCapacity(at_least_space_for);
1851 Node* length = EntryToIndex<NameDictionary>(capacity);
1852 Node* store_size =
1856 Node* result = Allocate(store_size);
1864 Node* zero = SmiConstant(0);
1872 Node* filler = LoadRoot(Heap::kUndefinedValueRootIndex);
1880 Node* result_word = BitcastTaggedToWord(result);
1881 Node* start_address = IntPtrAdd(
1885 Node* end_address = IntPtrAdd(
1891 Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties,
1892 Node* elements,
1895 Node* size =
1898 Node* object = Allocate(size, flags);
1904 void CodeStubAssembler::InitializeJSObjectFromMap(Node* object, Node* map,
1905 Node* size, Node* properties,
1906 Node* elements) {
1926 void CodeStubAssembler::InitializeJSObjectBody(Node* object, Node* map,
1927 Node* size, int start_offset) {
1930 Node* filler = LoadRoot(Heap::kUndefinedValueRootIndex);
1933 Node* start_address =
1935 Node* end_address =
1940 void CodeStubAssembler::StoreFieldsNoWriteBarrier(Node* start_address,
1941 Node* end_address,
1942 Node* value) {
1947 [this, value](Node* current) {
1954 Node* CodeStubAssembler::AllocateUninitializedJSArrayWithoutElements(
1955 ElementsKind kind, Node* array_map, Node* length, Node* allocation_site) {
1962 Node* size = IntPtrConstant(base_size);
1963 Node* array = AllocateUninitializedJSArray(kind, array_map, length,
1968 std::pair<Node*, Node*>
1970 ElementsKind kind, Node* array_map, Node* length, Node* allocation_site,
1971 Node* capacity, ParameterMode capacity_mode) {
1983 Node* size = ElementOffsetFromIndex(capacity, kind, capacity_mode, base_size);
1985 Node* array = AllocateUninitializedJSArray(kind, array_map, length,
1988 Node* elements = InnerAllocate(array, elements_offset);
1994 Node* CodeStubAssembler::AllocateUninitializedJSArray(ElementsKind kind,
1995 Node* array_map,
1996 Node* length,
1997 Node* allocation_site,
1998 Node* size_in_bytes) {
1999 Node* array = Allocate(size_in_bytes);
2016 Node* CodeStubAssembler::AllocateJSArray(ElementsKind kind, Node* array_map,
2017 Node* capacity, Node* length,
2018 Node* allocation_site,
2020 Node *array = nullptr, *elements = nullptr;
2049 Node* CodeStubAssembler::AllocateFixedArray(ElementsKind kind,
2050 Node* capacity_node,
2055 Node* total_size = GetFixedArrayAllocationSize(capacity_node, kind, mode);
2058 Node* array = Allocate(total_size, flags);
2070 ElementsKind kind, Node* array, Node* from_node, Node* to_node,
2077 Node* double_hole =
2079 Node* value = LoadRoot(value_root_index);
2083 [this, value, is_double, double_hole](Node* array, Node* offset) {
2112 ElementsKind from_kind, Node* from_array, ElementsKind to_kind,
2113 Node* to_array, Node* element_count, Node* capacity,
2134 Node* double_hole =
2148 Node
2170 Node* from_offset = IntPtrSub(
2175 Node* to_offset;
2198 Node* value = LoadElementAndPrepareForStore(
2236 Node* compare = WordNotEqual(from_offset, limit_offset);
2245 void CodeStubAssembler::CopyStringCharacters(Node* from_string, Node* to_string,
2246 Node* from_index, Node* to_index,
2247 Node* character_count,
2262 Node* from_offset =
2264 Node* to_offset =
2266 Node* byte_count = ElementOffsetFromIndex(character_count, from_kind, mode);
2267 Node* limit_offset = IntPtrAdd(from_offset, byte_count);
2293 type, rep, index_same](Node* offset) {
2294 Node* value = Load(type, from_string, offset);
2305 Node* CodeStubAssembler::LoadElementAndPrepareForStore(Node* array,
2306 Node* offset,
2311 Node* value =
2319 Node* value = Load(MachineType::AnyTagged(), array, offset);
2334 Node* CodeStubAssembler::CalculateNewElementsCapacity(Node* old_capacity,
2336 Node* half_old_capacity = WordOrSmiShr(old_capacity, 1, mode);
2337 Node* new_capacity = IntPtrOrSmiAdd(half_old_capacity, old_capacity, mode);
2338 Node* padding = IntPtrOrSmiConstant(16, mode);
2342 Node* CodeStubAssembler::TryGrowElementsCapacity(Node* object, Node* elements,
2343 ElementsKind kind, Node* key,
2345 Node* capacity = LoadFixedArrayBaseLength(elements);
2355 Node* CodeStubAssembler::TryGrowElementsCapacity(Node* object, Node* elements,
2356 ElementsKind kind, Node* key,
2357 Node* capacity,
2363 Node* max_gap = IntPtrOrSmiConstant(JSObject::kMaxGap, mode);
2364 Node* max_capacity = IntPtrOrSmiAdd(capacity, max_gap, mode);
2368 Node* new_capacity = CalculateNewElementsCapacity(
2374 Node* CodeStubAssembler::GrowElementsCapacity(
2375 Node* object, Node* elements, ElementsKind from_kind, ElementsKind to_kind,
2376 Node* capacity, Node* new_capacity, ParameterMode mode, Label* bailout) {
2386 Node* new_elements = AllocateFixedArray(to_kind, new_capacity, mode);
2399 void CodeStubAssembler::InitializeAllocationMemento(Node* base_allocation,
2401 Node* allocation_site) {
2410 Node* count = LoadObjectField(allocation_site,
2412 Node* incremented_count = SmiAdd(count, SmiConstant(Smi::FromInt(1)));
2419 Node* CodeStubAssembler::TryTaggedToFloat64(Node* value,
2453 Node* CodeStubAssembler::TruncateTaggedToFloat64(Node* context, Node* value) {
2469 Node* const result = TryTaggedToFloat64(value, &if_valueisnotnumber);
2485 Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) {
2535 Node* CodeStubAssembler::TruncateHeapNumberValueToWord32(Node* object) {
2536 Node* value = LoadHeapNumberValue(object);
2540 Node* CodeStubAssembler::ChangeFloat64ToTagged(Node* value) {
2541 Node* value32 = RoundFloat64ToInt32(value);
2542 Node* value64 = ChangeInt32ToFloat64(value32);
2561 Node* result = SmiTag(ChangeInt32ToInt64(value32));
2565 Node* pair = Int32AddWithOverflow(value32, value32);
2566 Node* overflow = Projection(1, pair);
2573 Node* result = BitcastWordToTaggedSigned(Projection(0, pair));
2581 Node* result = AllocateHeapNumberWithValue(value);
2589 Node* CodeStubAssembler::ChangeInt32ToTagged(Node* value) {
2594 Node* pair = Int32AddWithOverflow(value, value);
2595 Node* overflow = Projection(1, pair);
2601 Node* value64 = ChangeInt32ToFloat64(value);
2602 Node* result = AllocateHeapNumberWithValue(value64);
2608 Node* result = BitcastWordToTaggedSigned(Projection(0, pair));
2616 Node* CodeStubAssembler::ChangeUint32ToTagged(Node* value) {
2631 Node* pair = Int32AddWithOverflow(value, value);
2632 Node* overflow = Projection(1, pair);
2635 Node* result = BitcastWordToTaggedSigned(Projection(0, pair));
2643 Node* float64_value = ChangeUint32ToFloat64(value);
2652 Node* CodeStubAssembler::ToThisString(Node* context, Node* value,
2663 Node* value_instance_type = LoadInstanceType(value);
2712 Node* CodeStubAssembler::ChangeNumberToFloat64(compiler::Node* value) {
2731 Node* CodeStubAssembler::ToThisValue(Node* context, Node* value,
2750 Node* value_map = LoadMap(value);
2753 Node* value_instance_type = LoadMapInstanceType(value_map);
2803 Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value,
2813 Node* const value_instance_type = LoadMapInstanceType(var_value_map.value());
2830 Node* CodeStubAssembler::InstanceTypeEqual(Node* instance_type, int type) {
2834 Node* CodeStubAssembler::IsSpecialReceiverMap(Node* map) {
2835 Node* is_special = IsSpecialReceiverInstanceType(LoadMapInstanceType(map));
2846 Node* CodeStubAssembler::IsDictionaryMap(Node* map) {
2848 Node* bit_field3 = LoadMapBitField3(map);
2853 Node* CodeStubAssembler::IsCallableMap(Node* map) {
2860 Node* CodeStubAssembler::IsCallable(Node* object) {
2864 Node* CodeStubAssembler::IsConstructorMap(Node* map) {
2871 Node* CodeStubAssembler::IsSpecialReceiverInstanceType(Node* instance_type) {
2877 Node* CodeStubAssembler::IsStringInstanceType(Node* instance_type) {
2882 Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) {
2888 Node* CodeStubAssembler::IsJSReceiver(Node* object) {
2893 Node* CodeStubAssembler::IsJSReceiverMap(Node* map) {
2898 Node* CodeStubAssembler::IsJSObject(Node* object) {
2904 Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) {
2909 Node* CodeStubAssembler::IsMap(Node* map) {
2913 Node* CodeStubAssembler::IsJSValue(Node* map) {
2917 Node* CodeStubAssembler::IsJSArray(Node* object) {
2921 Node* CodeStubAssembler::IsWeakCell(Node* object) {
2925 Node* CodeStubAssembler::IsBoolean(Node* object) {
2929 Node* CodeStubAssembler::IsHeapNumber(Node* object) {
2933 Node* CodeStubAssembler::IsName(Node* object) {
2938 Node* CodeStubAssembler::IsString(Node* object) {
2943 Node* CodeStubAssembler::IsSymbol(Node* object) {
2947 Node* CodeStubAssembler::IsPrivateSymbol(Node* object) {
2951 Node* const flags =
2959 Node* CodeStubAssembler::IsNativeContext(Node* object) {
2963 Node* CodeStubAssembler::IsFixedDoubleArray(Node* object) {
2967 Node* CodeStubAssembler::IsHashTable(Node* object) {
2971 Node* CodeStubAssembler::IsDictionary(Node* object) {
2975 Node* CodeStubAssembler::IsUnseededNumberDictionary(Node* object) {
2980 Node* CodeStubAssembler::IsJSFunction(Node* object) {
2984 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index,
3006 Node* string_instance_type = LoadInstanceType(string);
3059 Node* rhs = LoadObjectField(string, ConsString::kSecondOffset);
3101 Node* string_resource_data =
3149 Node* string_offset =
3151 Node* string_parent =
3172 Node* CodeStubAssembler::StringFromCharCode(Node* code) {
3183 Node* cache = LoadRoot(Heap::kSingleCharacterStringCacheRootIndex);
3184 Node* code_index = ChangeUint32ToWord(code);
3190 Node* entry = LoadFixedArrayElement(cache, code_index);
3197 Node* result = AllocateSeqOneByteString(1);
3217 Node* result = AllocateSeqTwoByteString(1);
3237 Node* AllocAndCopyStringCharacters(CodeStubAssembler* a, Node* context,
3238 Node* from, Node* from_instance_type,
3239 Node* from_index, Node* character_count) {
3246 Node* const smi_zero = a->SmiConstant(Smi::kZero);
3256 Node* result =
3270 Node* result =
3287 Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
3288 Node* to) {
3292 Node* const int_zero = Int32Constant(0);
3307 Node* const instance_type = LoadInstanceType(string);
3315 Node* const substr_length = SmiSub(to, from);
3316 Node* const string_length = LoadStringLength(string);
3360 Node* first_string_part = LoadObjectField(string, ConsString::kFirstOffset);
3380 Node* sliced_offset =
3384 Node* slice_parent = LoadObjectField(string, SlicedString::kParentOffset);
3387 Node* slice_parent_instance_type = LoadInstanceType(slice_parent);
3399 Node* actual_string =
3468 Node* const fake_sequential_string = TryDerefExternalString(
3484 Node* char_code = StringCharCodeAt(var_string.value(), var_from.value());
3520 Node* IsExternalStringInstanceType(CodeStubAssembler* a,
3521 Node* const instance_type) {
3528 Node* IsShortExternalStringInstanceType(CodeStubAssembler* a,
3529 Node* const instance_type) {
3539 Node* CodeStubAssembler::TryDerefExternalString(Node* const string,
3540 Node* const instance_type,
3551 Node* resource_data = LoadObjectField(
3553 Node* const fake_sequential_string =
3561 Node* instance_type,
3564 Node* representation =
3569 Node* rhs = LoadObjectField(var_string->value(), ConsString::kSecondOffset);
3584 Node* left_instance_type,
3586 Node* right_instance_type,
3598 Node* CodeStubAssembler::StringAdd(Node* context, Node* left, Node* right,
3608 Node* left_length = LoadStringLength(left);
3614 Node* right_length = LoadStringLength(right);
3623 Node* new_length = SmiAdd(left_length, right_length);
3642 Node* left_instance_type = LoadInstanceType(var_left.value());
3643 Node* right_instance_type = LoadInstanceType(var_right.value());
3646 Node* ored_instance_types =
3648 Node* xored_instance_types =
3667 Node* new_string =
3720 Node* CodeStubAssembler::StringFromCodePoint(Node* codepoint,
3743 Node* lead_offset = Int32Constant(0xD800 - (0x10000 >> 10));
3746 Node* lead =
3750 Node* trail = Int32Add(Word32And(codepoint, Int32Constant(0x3FF)),
3759 Node* value = AllocateSeqTwoByteString(2);
3772 Node* CodeStubAssembler::StringToNumber(Node* context, Node* input) {
3779 Node* hash = LoadNameHashField(input);
3780 Node* bit =
3798 Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) {
3805 Node* number_string_cache = LoadRoot(Heap::kNumberStringCacheRootIndex);
3810 Node* mask =
3812 Node* one = IntPtrConstant(1);
3818 Node* map = LoadMap(argument);
3822 Node* low =
3824 Node* high = LoadObjectField(argument, HeapNumber::kValueOffset + kIntSize,
3826 Node* hash = Word32Xor(low, high);
3829 Node* index = WordAnd(hash, SmiUntag(BitcastWordToTagged(mask)));
3832 Node* number_key = LoadFixedArrayElement(number_string_cache, index);
3838 Node* low_compare = LoadObjectField(number_key, HeapNumber::kValueOffset,
3840 Node* high_compare = LoadObjectField(
3860 Node* smi_index = BitcastWordToTagged(
3862 Node* smi_key = LoadFixedArrayElement(number_string_cache, smi_index, 0,
3877 Node* CodeStubAssembler::ToName(Node* context, Node* value) {
3885 Node* value_instance_type = LoadInstanceType(value);
3923 Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
3937 Node* input = var_input.value();
3940 Node* input_instance_type = LoadInstanceType(input);
3970 Node* result = CallStub(callable, context, input);
3975 Node* result_map = LoadMap(result);
4011 Node* CodeStubAssembler::ToNumber(Node* context, Node* input) {
4023 Node* input_map = LoadMap(input);
4040 Node* CodeStubAssembler::ToUint32(Node* context, Node* input) {
4041 Node* const float_zero = Float64Constant(0.0);
4042 Node* const float_two_32 = Float64Constant(static_cast<double>(1ULL << 32));
4057 Node* const number = ToNumber(context, input);
4073 Node* const float_number = SmiToFloat64(number);
4074 Node* const float_result = Float64Add(float_number, float_two_32);
4075 Node* const result = ChangeFloat64ToTagged(float_result);
4083 Node* const value = LoadHeapNumberValue(number);
4102 Node* const positive_infinity =
4111 Node* const negative_infinity =
4120 Node* x = Float64Floor(value);
4125 Node* const result = ChangeFloat64ToTagged(x);
4141 Node* CodeStubAssembler::ToString(Node* context, Node* input) {
4149 Node* input_map = LoadMap(input);
4150 Node* input_instance_type = LoadMapInstanceType(input_map);
4180 Node* CodeStubAssembler::JSReceiverToPrimitive(Node* context, Node* input) {
4205 Node* CodeStubAssembler::ToInteger(Node* context, Node* input,
4217 Node* arg = var_arg.value();
4231 Node* arg_value = LoadHeapNumberValue(arg);
4237 Node* value = Float64Trunc(arg_value);
4265 Node* CodeStubAssembler::DecodeWord32(Node* word32, uint32_t shift,
4271 Node* CodeStubAssembler::DecodeWord(Node* word, uint32_t shift, uint32_t mask) {
4277 Node* counter_address = ExternalConstant(ExternalReference(counter));
4286 Node* counter_address = ExternalConstant(ExternalReference(counter));
4287 Node* value = Load(MachineType::Int32(), counter_address);
4296 Node* counter_address = ExternalConstant(ExternalReference(counter));
4297 Node* value = Load(MachineType::Int32(), counter_address);
4318 void CodeStubAssembler::TryToName(Node* key, Label* if_keyisindex,
4331 Node* key_map = LoadMap(key);
4335 Node* key_instance_type = LoadMapInstanceType(key_map);
4340 Node* hash = LoadNameHashField(key);
4341 Node* contains_index =
4346 Node* not_an_index =
4357 Node* not_internalized =
4372 Node* CodeStubAssembler::EntryToIndex(Node* entry, int field_index) {
4373 Node* entry_index = IntPtrMul(entry, IntPtrConstant(Dictionary::kEntrySize));
4378 template Node* CodeStubAssembler::EntryToIndex<NameDictionary>(Node*, int);
4379 template Node* CodeStubAssembler::EntryToIndex<GlobalDictionary>(Node*, int);
4380 template Node* CodeStubAssembler::EntryToIndex<SeededNumberDictionary>(Node*,
4383 Node* CodeStubAssembler::HashTableComputeCapacity(Node* at_least_space_for) {
4384 Node* capacity = IntPtrRoundUpToPowerOfTwo32(
4389 Node* CodeStubAssembler::IntPtrMax(Node* left, Node* right) {
4394 Node* CodeStubAssembler::IntPtrMin(Node* left, Node* right) {
4400 Node* CodeStubAssembler::GetNumberOfElements(Node* dictionary) {
4405 void CodeStubAssembler::SetNumberOfElements(Node* dictionary,
4406 Node* num_elements_smi) {
4412 Node* CodeStubAssembler::GetNumberOfDeletedElements(Node* dictionary) {
4418 Node* CodeStubAssembler::GetCapacity(Node* dictionary) {
4423 Node* CodeStubAssembler::GetNextEnumerationIndex(Node* dictionary) {
4429 void CodeStubAssembler::SetNextEnumerationIndex(Node* dictionary,
4430 Node* next_enum_index_smi) {
4436 void CodeStubAssembler::NameDictionaryLookup(Node* dictionary,
4437 Node* unique_name, Label* if_found,
4448 Node* capacity = SmiUntag(GetCapacity<Dictionary>(dictionary));
4449 Node* mask = IntPtrSub(capacity, IntPtrConstant(1));
4450 Node* hash = ChangeUint32ToWord(LoadNameHash(unique_name));
4453 Node* count = IntPtrConstant(0);
4454 Node* entry = WordAnd(hash, mask);
4457 Node* index = EntryToIndex<Dictionary>(entry);
4460 Node* current = LoadFixedArrayElement(dictionary, index);
4472 Node* undefined = UndefinedConstant();
4473 Node* the_hole = mode == kFindExisting ? nullptr : TheHoleConstant();
4482 Node* entry = var_entry.value();
4484 Node* index = EntryToIndex<Dictionary>(entry);
4487 Node* current = LoadFixedArrayElement(dictionary, index);
4507 Node*, Node*, Label*, Variable*, Label*, int, LookupMode);
4509 Node*, Node*, Label*, Variable*, Label*, int, LookupMode);
4511 Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
4513 Node* hash = TruncateWordToWord32(key);
4526 void CodeStubAssembler::NumberDictionaryLookup(Node* dictionary,
4527 Node* intptr_index,
4535 Node* capacity = SmiUntag(GetCapacity<Dictionary>(dictionary));
4536 Node* mask = IntPtrSub(capacity, IntPtrConstant(1));
4538 Node* int32_seed;
4544 Node* hash = ChangeUint32ToWord(ComputeIntegerHash(intptr_index, int32_seed));
4545 Node* key_as_float64 = RoundIntPtrToFloat64(intptr_index);
4548 Node* count = IntPtrConstant(0);
4549 Node* entry = WordAnd(hash, mask);
4551 Node* undefined = UndefinedConstant();
4552 Node* the_hole = TheHoleConstant();
4561 Node* entry = var_entry->value();
4563 Node* index = EntryToIndex<Dictionary>(entry);
4564 Node* current = LoadFixedArrayElement(dictionary, index);
4572 Node* current_value = SmiUntag(current);
4579 Node* current_value = LoadHeapNumberValue(current);
4596 void CodeStubAssembler::FindInsertionEntry(Node* dictionary, Node* key,
4603 Node* dictionary, Node* key, Variable* var_key_index) {
4611 void CodeStubAssembler::InsertEntry(Node* dictionary, Node* key, Node* value,
4612 Node* index, Node* enum_index) {
4617 void CodeStubAssembler::InsertEntry<NameDictionary>(Node* dictionary,
4618 Node* name, Node* value,
4619 Node* index,
4620 Node* enum_index) {
4637 Node* flags = SmiToWord32(LoadObjectField(name, Symbol::kFlagsOffset));
4640 Node* dont_enum =
4652 void CodeStubAssembler::InsertEntry<GlobalDictionary>(Node* dictionary,
4653 Node* key, Node* value,
4654 Node* index,
4655 Node* enum_index) {
4660 void CodeStubAssembler::Add(Node* dictionary, Node* key, Node* value,
4662 Node* capacity = GetCapacity<Dictionary>(dictionary);
4663 Node* nof = GetNumberOfElements<Dictionary>(dictionary);
4664 Node* new_nof = SmiAdd(nof, SmiConstant(1));
4668 Node* required_capacity_pseudo_smi = SmiAdd(new_nof, SmiShr(new_nof, 1));
4671 Node* deleted = GetNumberOfDeletedElements<Dictionary>(dictionary);
4673 Node* half_of_free_elements = SmiShr(SmiSub(capacity, new_nof), 1);
4675 Node* enum_index = nullptr;
4678 Node* new_enum_index = SmiAdd(enum_index, SmiConstant(1));
4679 Node* max_enum_index =
4698 template void CodeStubAssembler::Add<NameDictionary>(Node*, Node*, Node*,
4701 void CodeStubAssembler::DescriptorLookupLinear(Node* unique_name,
4702 Node* descriptors, Node* nof,
4707 Node* first_inclusive = IntPtrConstant(DescriptorArray::ToKeyIndex(0));
4708 Node* factor = IntPtrConstant(DescriptorArray::kEntrySize);
4709 Node* last_exclusive = IntPtrAdd(first_inclusive, IntPtrMul(nof, factor));
4713 var_name_index](Node* name_index) {
4714 Node* candidate_name =
4724 Node* CodeStubAssembler::DescriptorArrayNumberOfEntries(Node* descriptors) {
4731 Node* DescriptorNumberToIndex(CodeStubAssembler* a, Node* descriptor_number) {
4732 Node* descriptor_size = a->Int32Constant(DescriptorArray::kEntrySize);
4733 Node* index = a->Int32Mul(descriptor_number, descriptor_size);
4739 Node* CodeStubAssembler::DescriptorArrayToKeyIndex(Node* descriptor_number) {
4744 Node* CodeStubAssembler::DescriptorArrayGetSortedKeyIndex(
4745 Node* descriptors, Node* descriptor_number) {
4747 Node* details = LoadAndUntagToWord32FixedArrayElement(
4753 Node* CodeStubAssembler::DescriptorArrayGetKey(Node* descriptors,
4754 Node* descriptor_number) {
4761 void CodeStubAssembler::DescriptorLookupBinary(Node* unique_name,
4762 Node* descriptors, Node* nof,
4768 Node* limit =
4771 Node* hash = LoadNameHashField(unique_name);
4783 Node* mid =
4787 Node* sorted_key_index = DescriptorArrayGetSortedKeyIndex(descriptors, mid);
4788 Node* mid_name = DescriptorArrayGetKey(descriptors, sorted_key_index);
4790 Node* mid_hash = LoadNameHashField(mid_name);
4814 Node* sort_index =
4816 Node* current_name = DescriptorArrayGetKey(descriptors, sort_index);
4817 Node* current_hash = LoadNameHashField(current_name);
4831 void CodeStubAssembler::DescriptorLookup(Node* unique_name, Node* descriptors,
4832 Node* bitfield3, Label* if_found,
4836 Node* nof = DecodeWord32<Map::NumberOfOwnDescriptorsBits>(bitfield3);
4855 Node* object, Node* map, Node* instance_type, Node* unique_name,
4873 Node* bit_field3 = LoadMapBitField3(map);
4879 Node* descriptors = LoadMapDescriptors(map);
4887 Node* dictionary = LoadProperties(object);
4900 Node* bit_field = LoadMapBitField(map);
4901 Node* mask = Int32Constant(1 << Map::kHasNamedInterceptor |
4906 Node* dictionary = LoadProperties(object);
4914 void CodeStubAssembler::TryHasOwnProperty(Node* object, Node* map,
4915 Node* instance_type,
4916 Node* unique_name, Label* if_found,
4939 void CodeStubAssembler::LoadPropertyFromFastObject(Node* object, Node* map,
4940 Node* descriptors,
4941 Node* name_index,
4948 Node* details =
4952 Node* location = DecodeWord32<PropertyDetails::LocationField>(details);
4959 Node* field_index =
4961 Node* representation =
4964 Node* inobject_properties = LoadMapInobjectProperties(map);
4974 Node* field_offset =
4994 Node* mutable_heap_number = LoadObjectField(object, field_offset);
5003 Node* properties = LoadProperties(object);
5005 Node* value = LoadFixedArrayElement(properties, field_index);
5025 Node* heap_number = AllocateHeapNumberWithValue(var_double_value.value());
5041 void CodeStubAssembler::LoadPropertyFromNameDictionary(Node* dictionary,
5042 Node* name_index,
5055 void CodeStubAssembler::LoadPropertyFromGlobalDictionary(Node* dictionary,
5056 Node* name_index,
5063 Node* property_cell =
5066 Node* value = LoadObjectField(property_cell, PropertyCell::kValueOffset);
5071 Node* details = LoadAndUntagToWord32ObjectField(property_cell,
5081 Node* CodeStubAssembler::CallGetterIfAccessor(Node* value, Node* details,
5082 Node* context, Node* receiver,
5087 Node* kind = DecodeWord32<PropertyDetails::KindField>(details);
5092 Node* accessor_pair = value;
5097 Node* getter = LoadObjectField(accessor_pair, AccessorPair::kGetterOffset);
5098 Node* getter_map = LoadMap(getter);
5099 Node* instance_type = LoadMapInstanceType(getter_map);
5111 Node* result = CallJS(callable, context, getter, receiver);
5121 Node* context, Node* receiver, Node* object, Node* map, Node* instance_type,
5122 Node* unique_name, Label* if_found_value, Variable* var_value,
5141 Node* descriptors = var_meta_storage.value();
5142 Node* name_index = var_entry.value();
5150 Node* dictionary = var_meta_storage.value();
5151 Node* entry = var_entry.value();
5157 Node* dictionary = var_meta_storage.value();
5158 Node* entry = var_entry.value();
5167 Node* value = CallGetterIfAccessor(var_value->value(), var_details.value(),
5174 void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
5175 Node* instance_type,
5176 Node* intptr_index, Label* if_found,
5184 Node* elements_kind = LoadMapElementsKind(map);
5220 Node* elements = LoadElements(object);
5221 Node* length = LoadAndUntagFixedArrayBaseLength(elements);
5225 Node* element = LoadFixedArrayElement(elements, intptr_index);
5226 Node* the_hole = TheHoleConstant();
5231 Node* elements = LoadElements(object);
5232 Node* length = LoadAndUntagFixedArrayBaseLength(elements);
5247 Node* elements = LoadElements(object);
5254 Node* string = LoadJSValueValue(object);
5256 Node* length = LoadStringLength(string);
5263 Node* string = LoadJSValueValue(object);
5265 Node* length = LoadStringLength(string);
5280 Node*, Node*, Label*, Variable*, Label*);
5282 UnseededNumberDictionary>(Node*, Node*, Label*, Variable*, Label*);
5285 Node* receiver, Node* key, const LookupInHolder& lookup_property_in_holder,
5293 Node* map = LoadMap(receiver);
5294 Node* instance_type = LoadMapInstanceType(map);
5325 Node* holder_map = var_holder_map.value();
5326 Node* holder_instance_type = var_holder_instance_type.value();
5339 Node* proto = LoadMapPrototype(holder_map);
5345 Node* map = LoadMap(proto);
5346 Node* instance_type = LoadMapInstanceType(map);
5374 Node* proto = LoadMapPrototype(var_holder_map.value());
5380 Node* map = LoadMap(proto);
5381 Node* instance_type = LoadMapInstanceType(map);
5391 Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
5392 Node* object) {
5401 Node* object_map = LoadMap(object);
5406 Node* instanceof_cache_function =
5408 Node* instanceof_cache_map = LoadRoot(Heap::kInstanceofCacheMapRootIndex);
5424 Node* callable_map = LoadMap(callable);
5427 Node* callable_instance_type = LoadMapInstanceType(callable_map);
5434 Node* callable_bitfield = LoadMapBitField(callable_map);
5443 Node* callable_prototype =
5454 Node* callable_prototype_instance_type =
5477 Node* object_map = var_object_map.value();
5480 Node* object_bitfield = LoadMapBitField(object_map);
5488 Node* object_instance_type = LoadMapInstanceType(object_map);
5493 Node* object_prototype = LoadMapPrototype(object_map);
5526 Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
5549 Node* shifted_index =
5558 Node* CodeStubAssembler::LoadFeedbackVectorForStub() {
5559 Node* function =
5561 Node* cell = LoadObjectField(function, JSFunction::kFeedbackVectorOffset);
5565 void CodeStubAssembler::UpdateFeedback(Node* feedback, Node* feedback_vector,
5566 Node* slot_id) {
5570 Node* previous_feedback = LoadFixedArrayElement(feedback_vector, slot_id);
5571 Node* combined_feedback = SmiOr(previous_feedback, feedback);
5576 Node* CodeStubAssembler::LoadReceiverMap(Node* receiver) {
5596 Node* CodeStubAssembler::TryToIntptr(Node* key, Label* miss) {
5603 Node* value = LoadHeapNumberValue(key);
5604 Node* int_value = RoundFloat64ToInt32(value);
5620 Node* CodeStubAssembler::EmitKeyedSloppyArguments(Node* receiver, Node* key,
5621 Node* value, Label* bailout) {
5654 Node* elements = LoadElements(receiver);
5655 Node* elements_length = LoadAndUntagFixedArrayBaseLength(elements);
5662 Node* intptr_two = IntPtrConstant(2);
5663 Node* adjusted_length = IntPtrSub(elements_length, intptr_two);
5667 Node* mapped_index =
5675 Node* the_context = LoadFixedArrayElement(elements, 0);
5682 Node* result = LoadFixedArrayElement(the_context, mapped_index);
5693 Node* backing_store = LoadFixedArrayElement(elements, 1);
5697 Node* backing_store_length =
5703 Node* result = LoadFixedArrayElement(backing_store, key);
5716 Node* CodeStubAssembler::LoadScriptContext(Node* context, int context_index) {
5717 Node* native_context = LoadNativeContext(context);
5718 Node* script_context_table =
5754 void CodeStubAssembler::StoreElement(Node* elements, ElementsKind kind,
5755 Node* index, Node* value,
5762 Node* offset = ElementOffsetFromIndex(index, kind, mode, 0);
5779 Node* CodeStubAssembler::Int32ToUint8Clamped(Node* int32_value) {
5781 Node* int32_zero = Int32Constant(0);
5782 Node* int32_255 = Int32Constant(255);
5793 Node* CodeStubAssembler::Float64ToUint8Clamped(Node* float64_value) {
5800 Node* rounded_value = Float64RoundToEven(float64_value);
5808 Node* CodeStubAssembler::PrepareValueForWriteToTypedArray(
5809 Node* input, ElementsKind elements_kind, Label* bailout) {
5840 Node* value = LoadHeapNumberValue(input);
5858 Node* value = SmiToWord32(input);
5877 void CodeStubAssembler::EmitElementStore(Node* object, Node* key, Node* value,
5882 Node* elements = LoadElements(object);
5907 Node* buffer = LoadObjectField(object, JSArrayBufferView::kBufferOffset);
5911 Node* length = TaggedToParameter(
5924 Node* external_pointer =
5927 Node* base_pointer =
5929 Node* backing_store =
5940 Node* length = is_jsarray ? LoadObjectField(object, JSArray::kLengthOffset)
5968 Node* CodeStubAssembler::CheckForCapacityGrow(Node* object, Node* elements,
5969 ElementsKind kind, Node* length,
5970 Node* key, ParameterMode mode,
5976 Node* condition;
5986 Node* current_capacity =
5994 Node* new_elements = TryGrowElementsCapacity(
6003 Node* new_length = IntPtrAdd(key, IntPtrOrSmiConstant(1, mode));
6021 Node* CodeStubAssembler::CopyElementsOnWrite(Node* object, Node* elements,
6022 ElementsKind kind, Node* length,
6032 Node* capacity =
6034 Node* new_elements = GrowElementsCapacity(object, elements, kind, kind,
6045 void CodeStubAssembler::TransitionElementsKind(Node* object, Node* map,
6058 Node* elements = LoadElements(object);
6060 Node* empty_fixed_array =
6068 Node* elements_length = SmiUntag(LoadFixedArrayBaseLength(elements));
6069 Node* array_length =
6082 void CodeStubAssembler::TrapAllocationMemento(Node* object,
6088 Node* new_space_top_address = ExternalConstant(
6095 Node* object_word = BitcastTaggedToWord(object);
6096 Node* object_page = PageFromAddress(object_word);
6098 Node* page_flags = Load(MachineType::IntPtr(), object_page,
6106 Node* memento_last_word = IntPtrAdd(
6108 Node* memento_last_word_page = PageFromAddress(memento_last_word);
6110 Node* new_space_top = Load(MachineType::Pointer(), new_space_top_address);
6111 Node* new_space_top_page = PageFromAddress(new_space_top);
6134 Node* memento_map = LoadObjectField(object, kMementoMapOffset);
6143 Node* CodeStubAssembler::PageFromAddress(Node* address) {
6147 Node* CodeStubAssembler::EnumLength(Node* map) {
6149 Node* bitfield_3 = LoadMapBitField3(map);
6150 Node* enum_length = DecodeWordFromWord32<Map::EnumLengthBits>(bitfield_3);
6154 void CodeStubAssembler::CheckEnumCache(Node* receiver, Label* use_cache,
6168 Node* invalid_enum_cache_sentinel =
6170 Node* enum_length = EnumLength(current_map.value());
6180 Node* elements = LoadElements(current_js_object.value());
6181 Node* empty_fixed_array = LoadRoot(Heap::kEmptyFixedArrayRootIndex);
6189 Node* slow_empty_dictionary =
6208 Node* enum_length = EnumLength(current_map.value());
6209 Node* zero_constant = SmiConstant(Smi::kZero);
6214 Node* CodeStubAssembler::CreateAllocationSiteInFeedbackVector(
6215 Node* feedback_vector, Node* slot) {
6216 Node* size = IntPtrConstant(AllocationSite::kSize);
6217 Node* site = Allocate(size, CodeStubAssembler::kPretenured);
6220 Node* kind = SmiConstant(GetInitialFastElementsKind());
6225 Node* zero = SmiConstant(0);
6241 Node* site_list = ExternalConstant(
6243 Node* next_site = LoadBufferObject(site_list, 0);
6258 Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector,
6259 Node* slot,
6260 Node* value) {
6261 Node* size = IntPtrConstant(WeakCell::kSize);
6262 Node* cell = Allocate(size, CodeStubAssembler::kPretenured);
6277 Node* CodeStubAssembler::BuildFastLoop(
6278 const CodeStubAssembler::VariableList& vars, Node* start_index,
6279 Node* end_index, const FastLoopBody& body, int increment,
6313 const CodeStubAssembler::VariableList& vars, Node* fixed_array,
6314 ElementsKind kind, Node* first_element_inclusive,
6315 Node* last_element_exclusive, const FastFixedArrayForEachBody& body,
6328 Node* index = IntPtrConstant(i);
6329 Node* offset =
6336 Node* index = IntPtrConstant(i);
6337 Node* offset =
6347 Node* start =
6350 Node* limit =
6358 [fixed_array, &body](Node* offset) { body(fixed_array, offset); },
6366 Node* element_count, Label* doesnt_fit, int base_size, ParameterMode mode) {
6376 Node* object, Node* start_offset, Node* end_offset,
6380 Node* root_value = LoadRoot(root_index);
6382 [this, object, root_value](Node* current) {
6391 RelationalComparisonMode mode, Node* lhs, Node* rhs, Label* if_true,
6473 Node* lhs = var_fcmp_lhs.value();
6474 Node* rhs = var_fcmp_rhs.value();
6494 void CodeStubAssembler::GotoUnlessNumberLessThan(Node* lhs, Node* rhs,
6501 Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
6502 Node* lhs, Node* rhs,
6503 Node* context) {
6557 Node* rhs_map = LoadMap(rhs);
6588 Node* lhs_map = LoadMap(lhs);
6624 Node* rhs_map = LoadMap(rhs);
6661 Node* lhs_instance_type = LoadMapInstanceType(lhs_map);
6671 Node* rhs_instance_type = LoadMapInstanceType(rhs_map);
6778 Node* lhs = var_fcmp_lhs.value();
6779 Node* rhs = var_fcmp_rhs.value();
6817 void GenerateEqual_Same(CodeStubAssembler* assembler, Node* value,
6834 Node* value_map = assembler->LoadMap(value);
6844 Node* value_value = assembler->LoadHeapNumberValue(value);
6860 Node* CodeStubAssembler::Equal(ResultMode mode, Node* lhs, Node* rhs,
6861 Node* context) {
6920 Node* rhs_map = LoadMap(rhs);
6938 Node* rhs_instance_type = LoadMapInstanceType(rhs_map);
7019 Node* lhs_map = LoadMap(lhs);
7020 Node* rhs_map = LoadMap(rhs);
7023 Node* lhs_instance_type = LoadMapInstanceType(lhs_map);
7024 Node* rhs_instance_type = LoadMapInstanceType(rhs_map);
7157 Node* boolean_map = BooleanMapConstant();
7187 Node* rhs_bitfield = LoadMapBitField(rhs_map);
7245 Node* rhs_bitfield = LoadMapBitField(rhs_map);
7255 Node* lhs_bitfield = LoadMapBitField(lhs_map);
7289 Node* lhs = var_fcmp_lhs.value();
7290 Node* rhs = var_fcmp_rhs.value();
7312 Node* CodeStubAssembler::StrictEqual(ResultMode mode, Node* lhs, Node* rhs,
7313 Node* context) {
7384 Node* lhs_map = LoadMap(lhs);
7399 Node* lhs_value = LoadHeapNumberValue(lhs);
7400 Node* rhs_value = SmiToFloat64(rhs);
7409 Node* rhs_map = LoadMap(rhs);
7418 Node* lhs_value = LoadHeapNumberValue(lhs);
7419 Node* rhs_value = LoadHeapNumberValue(rhs);
7442 Node* lhs_instance_type = LoadMapInstanceType(lhs_map);
7452 Node* rhs_instance_type = LoadInstanceType(rhs);
7495 Node* rhs_map = LoadMap(rhs);
7504 Node* lhs_value = SmiToFloat64(lhs);
7505 Node* rhs_value = LoadHeapNumberValue(rhs);
7536 Node* CodeStubAssembler::SameValue(Node* lhs, Node* rhs, Node* context) {
7540 Node* const int_false = Int32Constant(0);
7541 Node* const int_true = Int32Constant(1);
7560 Node* const lhs_float = TryTaggedToFloat64(lhs, &strict_equal);
7561 Node* const rhs_float = TryTaggedToFloat64(rhs, &strict_equal);
7570 Node* const result =
7589 Node* const lhs_hi_word = Float64ExtractHighWord32(lhs_float);
7590 Node* const rhs_hi_word = Float64ExtractHighWord32(rhs_float);
7595 Node* const result = Word32Equal(lhs_hi_word, rhs_hi_word);
7610 Node* const is_equal = StrictEqual(kDontNegateResult, lhs, rhs, context);
7611 Node* const result = WordEqual(is_equal, TrueConstant());
7620 Node* CodeStubAssembler::ForInFilter(Node* key, Node* object, Node* context) {
7626 Node* has_property =
7648 Node* CodeStubAssembler::HasProperty(
7649 Node* object, Node* key, Node* context,
7655 [this, &return_true](Node* receiver, Node* holder, Node* holder_map,
7656 Node* holder_instance_type, Node* unique_name,
7663 [this, &return_true](Node* receiver, Node* holder, Node* holder_map,
7664 Node* holder_instance_type, Node* index,
7698 Node* CodeStubAssembler::ClassOf(Node* value) {
7706 Node* value_map = LoadMap(value);
7707 Node* value_instance_type = LoadMapInstanceType(value_map);
7722 Node* constructor = LoadMapConstructor(value_map);
7726 Node* shared_info =
7728 Node* instance_class_name = LoadObjectField(
7749 Node* CodeStubAssembler::Typeof(Node* value, Node* context) {
7758 Node* map = LoadMap(value);
7762 Node* instance_type = LoadMapInstanceType(map);
7766 Node* callable_or_undetectable_mask = Word32And(
7793 Node* type = LoadObjectField(value, Oddball::kTypeOfOffset);
7826 Node* CodeStubAssembler::GetSuperConstructor(Node* active_function,
7827 Node* context) {
7833 Node* map = LoadMap(active_function);
7834 Node* prototype = LoadMapPrototype(map);
7835 Node* prototype_map = LoadMap(prototype);
7852 Node* CodeStubAssembler::InstanceOf(Node* object, Node* callable,
7853 Node* context) {
7865 Node* inst_of_handler = CallStub(CodeFactory::GetProperty(isolate()), context,
7871 Node* native_context = LoadNativeContext(context);
7872 Node* function_has_instance =
7880 Node* result = CallJS(builtin, context, inst_of_handler, callable, object);
7892 Node* result = CallJS(
7906 Node* result = CallStub(CodeFactory::OrdinaryHasInstance(isolate()),
7936 Node* CodeStubAssembler::NumberInc(Node* value) {
7945 Node* one = SmiConstant(Smi::FromInt(1));
7946 Node* pair = IntPtrAddWithOverflow(BitcastTaggedToWord(value),
7948 Node* overflow = Projection(1, pair);
7977 Node* finc_value = var_finc_value.value();
7978 Node* one = Float64Constant(1.0);
7979 Node* finc_result = Float64Add(finc_value, one);
7988 void CodeStubAssembler::GotoIfNotNumber(Node* input, Label* is_not_number) {
7991 Node* input_map = LoadMap(input);
7996 void CodeStubAssembler::GotoIfNumber(Node* input, Label* is_number) {
7998 Node* input_map = LoadMap(input);
8002 Node* CodeStubAssembler::CreateArrayIterator(Node* array, Node* array_map,
8003 Node* array_type, Node* context,
8099 Node* elements_kind = LoadMapElementsKind(array_map);
8110 Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex);
8118 Node* native_context = LoadNativeContext(context);
8120 Node* prototype = LoadMapPrototype(array_map);
8121 Node* array_prototype = LoadContextElement(
8125 Node* map = LoadMap(prototype);
8127 Node* object_prototype = LoadContextElement(
8137 Node* map_index =
8155 Node* map_index = IntPtrAdd(IntPtrConstant(kBaseMapIndex),
8165 Node* map_index =
8181 Node* map = LoadFixedArrayElement(LoadNativeContext(context),
8191 Node* CodeStubAssembler::AllocateJSArrayIterator(Node* array, Node* array_map,
8192 Node* map) {
8193 Node* iterator = Allocate(JSArrayIterator::kSize);
8208 Node* CodeStubAssembler::IsDetachedBuffer(Node* buffer) {
8211 Node* buffer_bit_field = LoadObjectField(
8216 CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc,
8217 Node* fp,
8224 Node* offset = assembler->ElementOffsetFromIndex(
8230 Node* CodeStubArguments::GetReceiver() const {
8235 Node* CodeStubArguments::AtIndexPtr(
8236 Node* index, CodeStubAssembler::ParameterMode mode) const {
8237 typedef compiler::Node Node;
8238 Node* negated_index = assembler_->IntPtrOrSmiSub(
8240 Node* offset =
8245 Node* CodeStubArguments::AtIndex(Node* index,
8253 Node* CodeStubArguments::AtIndex(int index) const {
8259 const CodeStubArguments::ForEachBodyFunction& body, Node* first, Node* last,
8269 Node* start = assembler_->IntPtrSub(
8272 Node* end = assembler_->IntPtrSub(
8276 [this, &body](Node* current) {
8277 Node* arg = assembler_->Load(
8285 void CodeStubArguments::PopAndReturn(Node* value) {
8290 Node* CodeStubAssembler::IsFastElementsKind(Node* elements_kind) {
8295 Node* CodeStubAssembler::IsHoleyFastElementsKind(Node* elements_kind) {
8303 Node* holey_elements = Word32And(elements_kind, Int32Constant(1));
8307 Node* CodeStubAssembler::IsDebugActive() {
8308 Node* is_debug_active = Load(
8314 Node* CodeStubAssembler::IsPromiseHookEnabledOrDebugIsActive() {
8315 Node* const promise_hook_or_debug_is_active =
8323 Node* CodeStubAssembler::AllocateFunctionWithMapAndContext(Node* map,
8324 Node* shared_info,
8325 Node* context) {
8326 Node* const code = BitcastTaggedToWord(
8328 Node* const code_entry =
8331 Node* const fun = Allocate(JSFunction::kSize);
8352 Node* CodeStubAssembler::AllocatePromiseReactionJobInfo(
8353 Node* value, Node* tasks, Node* deferred_promise, Node* deferred_on_resolve,
8354 Node* deferred_on_reject, Node* context) {
8355 Node* const result = Allocate(PromiseReactionJobInfo::kSize);
8374 Node* CodeStubAssembler::MarkerIsFrameType(Node* marker_or_function,
8381 Node* CodeStubAssembler::MarkerIsNotFrameType(Node* marker_or_function,
8398 void CodeStubAssembler::Print(const char* prefix, Node* tagged_value) {