Lines Matching refs:gasm_
87 gasm_->LoadFromObject( \
92 gasm_->LoadImmutable( \
97 gasm_->Load( \
107 : gasm_->LoadImmutable( \
524 : gasm_(std::make_unique<WasmGraphAssembler>(mcgraph, zone)),
558 instance_node_ = gasm_->LoadExportedFunctionInstance(
559 gasm_->LoadFunctionDataFromJSFunction(
591 gasm_->MergeControlToEnd(terminate);
614 gasm_->MergeControlToEnd(terminate);
679 return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmRefFunc,
681 gasm_->Uint32Constant(function_index));
708 return gasm_->Load(
738 Node* limit = gasm_->LoadFromObject(MachineType::Pointer(), limit_address, 0);
1101 return gasm_->TaggedEqual(left, right);
1132 return gasm_->Word32Equal(input, Int32Constant(0));
1336 return gasm_->Word64Equal(input, Int64Constant(0));
1392 return gasm_->Int32Sub(gasm_->Int32Constant(1), IsNull(input));
1428 return gasm_->Branch(cond, true_node, false_node, BranchHint::kNone);
1433 return gasm_->Branch(cond, true_node, false_node, BranchHint::kFalse);
1438 return gasm_->Branch(cond, true_node, false_node, BranchHint::kTrue);
1520 TrapIfTrue(reason, gasm_->Word32Equal(node, Int32Constant(val)), position);
1536 TrapIfTrue(reason, gasm_->Word64Equal(node, Int64Constant(val)), position);
1576 gasm_->MergeControlToEnd(ret);
1596 node = gasm_->Word32And(node, Int32Constant(kMask32));
1611 node = gasm_->Word64And(node, Int64Constant(kMask64));
1645 value = gasm_->BitcastFloat64ToInt64(node);
1652 value = gasm_->BitcastFloat32ToInt32(node);
1672 value = gasm_->TruncateInt64ToInt32(value);
1676 value = gasm_->Word32Shl(value, Int32Constant(16));
1680 value = gasm_->Word32Shl(value, Int32Constant(16));
1689 result = gasm_->Word32ReverseBytes(value);
1692 result = gasm_->Word64ReverseBytes(value);
1712 shiftLower = gasm_->Word64Shl(value, Int64Constant(shiftCount));
1713 shiftHigher = gasm_->Word64Shr(value, Int64Constant(shiftCount));
1714 lowerByte = gasm_->Word64And(
1717 higherByte = gasm_->Word64And(
1719 result = gasm_->Word64Or(result, lowerByte);
1720 result = gasm_->Word64Or(result, higherByte);
1722 shiftLower = gasm_->Word32Shl(value, Int32Constant(shiftCount));
1723 shiftHigher = gasm_->Word32Shr(value, Int32Constant(shiftCount));
1724 lowerByte = gasm_->Word32And(
1727 higherByte = gasm_->Word32And(
1729 result = gasm_->Word32Or(result, lowerByte);
1730 result = gasm_->Word32Or(result, higherByte);
1738 result = gasm_->BitcastInt64ToFloat64(result);
1741 result = gasm_->BitcastInt32ToFloat32(result);
1763 value = gasm_->BitcastFloat64ToInt64(node);
1770 value = gasm_->BitcastFloat32ToInt32(node);
1793 result = gasm_->Word32ReverseBytes(
1794 gasm_->Word32Shl(value, Int32Constant(16)));
1797 result = gasm_->Word32ReverseBytes(value);
1800 result = gasm_->Word64ReverseBytes(value);
1820 shiftLower = gasm_->Word64Shl(value, Int64Constant(shiftCount));
1821 shiftHigher = gasm_->Word64Shr(value, Int64Constant(shiftCount));
1822 lowerByte = gasm_->Word64And(
1825 higherByte = gasm_->Word64And(
1827 result = gasm_->Word64Or(result, lowerByte);
1828 result = gasm_->Word64Or(result, higherByte);
1830 shiftLower = gasm_->Word32Shl(value, Int32Constant(shiftCount));
1831 shiftHigher = gasm_->Word32Shr(value, Int32Constant(shiftCount));
1832 lowerByte = gasm_->Word32And(
1835 higherByte = gasm_->Word32And(
1837 result = gasm_->Word32Or(result, lowerByte);
1838 result = gasm_->Word32Or(result, higherByte);
1846 result = gasm_->BitcastInt64ToFloat64(result);
1849 result = gasm_->BitcastInt32ToFloat32(result);
1866 result = gasm_->Word64Sar(
1867 gasm_->Word64Shl(gasm_->ChangeInt32ToInt64(result), shiftBitCount),
1871 result = gasm_->Word32Sar(gasm_->Word32Shl(result, shiftBitCount),
1876 result = gasm_->ChangeUint32ToUint64(result);
1896 return gasm_->BitcastInt64ToFloat64(
1897 gasm_->Word64Or(gasm_->Word64And(gasm_->BitcastFloat64ToInt64(left),
1899 gasm_->Word64And(gasm_->BitcastFloat64ToInt64(right),
1905 Node* high_word_left = gasm_->Float64ExtractHighWord32(left);
1906 Node* high_word_right = gasm_->Float64ExtractHighWord32(right);
1908 Node* new_high_word = gasm_->Word32Or(
1909 gasm_->Word32And(high_word_left, Int32Constant(0x7FFFFFFF)),
1910 gasm_->Word32And(high_word_right, Int32Constant(0x80000000)));
1912 return gasm_->Float64InsertHighWord32(left, new_high_word);
2203 return gasm_->TruncateFloat64ToWord32(gasm_->ChangeFloat32ToFloat64(input));
2208 return gasm_->TruncateFloat64ToWord32(input);
2213 return gasm_->TruncateFloat64ToWord32(gasm_->ChangeFloat32ToFloat64(input));
2218 return gasm_->TruncateFloat64ToWord32(input);
2228 Node* function = gasm_->ExternalConstant(ref);
2348 Node* function = gasm_->ExternalConstant(ref);
2351 return gasm_->LoadFromObject(type, stack_slot, 0);
2388 gasm_->Store(store_rep, stack_slot, 0, input);
2391 Node* function = gasm_->ExternalConstant(ref);
2393 return gasm_->LoadFromObject(result_type, stack_slot, 0);
2431 gasm_->Store(store_rep, stack_slot, 0, input);
2434 Node* function = gasm_->ExternalConstant(call_ref);
2438 return gasm_->LoadFromObject(int_ty, stack_slot, 0);
2451 Node* load = gasm_->LoadFromObject(int_ty, stack_slot, 0);
2461 return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmMemoryGrow,
2469 gasm_->Uint64LessThanOrEqual(input, Int64Constant(kMaxInt)),
2475 Node* grow_result = gasm_->ChangeInt32ToInt64(gasm_->CallRuntimeStub(
2477 gasm_->TruncateInt64ToInt32(input)));
2480 grow_result, gasm_->Int64Constant(-1));
2491 Node* values_array = gasm_->CallRuntimeStub(
2493 gasm_->IntPtrConstant(encoded_size));
2503 value = gasm_->BitcastFloat32ToInt32(value);
2509 value = gasm_->BitcastFloat64ToInt64(value);
2512 Node* upper32 = gasm_->TruncateInt64ToInt32(
2515 Node* lower32 = gasm_->TruncateInt64ToInt32(value);
2536 gasm_->StoreFixedArrayElementAny(values_array, index, value);
2550 Node* throw_call = gasm_->CallRuntimeStub(wasm::WasmCode::kWasmThrow,
2561 BuildChangeUint31ToSmi(gasm_->Word32Shr(value, Int32Constant(16)));
2562 gasm_->StoreFixedArrayElementSmi(values_array, *index, upper_halfword_as_smi);
2565 BuildChangeUint31ToSmi(gasm_->Word32And(value, Int32Constant(0xFFFFu)));
2566 gasm_->StoreFixedArrayElementSmi(values_array, *index, lower_halfword_as_smi);
2573 gasm_->LoadFixedArrayElementSmi(values_array, *index));
2575 upper = gasm_->Word32Shl(upper, Int32Constant(16));
2577 gasm_->LoadFixedArrayElementSmi(values_array, *index));
2579 Node* value = gasm_->Word32Or(upper, lower);
2598 return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmRethrow,
2604 return gasm_->WordEqual(caught_tag, expected_tag);
2610 Node* tag = gasm_->LoadFixedArrayElementPtr(tags_table, tag_index);
2615 return gasm_->CallBuiltin(
2624 Node* values_array = gasm_->CallBuiltin(
2667 value = gasm_->LoadFixedArrayElementAny(values_array, index);
2688 BranchExpectFalse(gasm_->Word32Equal(right, Int32Constant(-1)), &denom_is_m1,
2697 return gasm_->Int32Div(left, right);
2707 gasm_->Word32Equal(right, Int32Constant(-1)), BranchHint::kFalse);
2717 return gasm_->Uint32Div(left, right);
2723 return gasm_->Uint32Mod(left, right);
2735 return gasm_->Int32Sub(Int32Constant(0), left);
2737 return gasm_->Int32Div(left, right);
2743 return gasm_->Int32Div(left, right);
2748 gasm_->Word32Equal(right, Int32Constant(0)), BranchHint::kFalse);
2753 gasm_->Word32Equal(right, Int32Constant(-1)), BranchHint::kFalse);
2758 Node* neg = gasm_->Int32Sub(Int32Constant(0), left);
2774 return gasm_->Int32Mod(left, right);
2802 Node* check0 = gasm_->Int32LessThan(zero, right);
2867 return gasm_->Uint32Div(left, right);
2872 gasm_->Word32Equal(right, Int32Constant(0)), BranchHint::kFalse);
2884 gasm_->Word32Equal(right, Int32Constant(0)), BranchHint::kFalse);
2902 BranchExpectFalse(gasm_->Word64Equal(right, Int64Constant(-1)), &denom_is_m1,
2912 return gasm_->Int64Div(left, right);
2923 gasm_->Word64Equal(right, Int64Constant(-1)));
2940 return gasm_->Uint64Div(left, right);
2949 return gasm_->Uint64Mod(left, right);
2964 Node* function = gasm_->ExternalConstant(ref);
2969 return gasm_->LoadFromObject(result_type, stack_slot, 0);
2973 return gasm_->TaggedEqual(object, RefNull());
2986 return gasm_->Call(call_descriptor, arraysize(call_args), call_args);
3068 gasm_->MergeControlToEnd(call);
3080 gasm_->Uint32Constant(func_index), continuation);
3094 Node* ref_node = gasm_->LoadFixedArrayElement(
3099 Node* func_index_times_pointersize = gasm_->IntMul(
3100 func_index_intptr, gasm_->IntPtrConstant(kSystemPointerSize));
3103 Node* target_node = gasm_->LoadImmutableFromObject(
3173 Node* ift_table = gasm_->LoadFixedArrayElementAny(ift_tables, table_index);
3176 *ift_size = gasm_->LoadFromObject(
3181 *ift_sig_ids = gasm_->LoadFromObject(
3185 *ift_targets = gasm_->LoadFromObject(
3189 *ift_instances = gasm_->LoadFromObject(
3212 Node* in_bounds = gasm_->Uint32LessThan(key, ift_size);
3228 BuildChangeUint32ToUintPtr(gasm_->Word32Shl(key, Int32Constant(2)));
3230 Node* loaded_sig = gasm_->LoadFromObject(MachineType::Int32(), ift_sig_ids,
3234 gasm_->Word32Equal(loaded_sig, Int32Constant(expected_sig_id));
3240 Node* target_instance = gasm_->LoadFixedArrayElement(
3244 gasm_->IntMul(key_intptr, gasm_->IntPtrConstant(kSystemPointerSize));
3246 Node* target = gasm_->LoadFromObject(MachineType::Pointer(), ift_targets,
3262 Node* external_pointer = gasm_->LoadFromObject(
3266 gasm_->Int32Constant(kExternalPointerIndexShift - kSystemPointerSizeLog2);
3267 Node* scaled_index = gasm_->Word32Shr(external_pointer, shift_amount);
3270 gasm_->LoadFromObject(MachineType::Pointer(), isolate_root,
3273 Node* decoded_ptr = gasm_->Load(MachineType::Pointer(), table, scaled_index);
3274 return gasm_->WordAnd(decoded_ptr, gasm_->IntPtrConstant(~tag));
3276 return gasm_->LoadFromObject(MachineType::Pointer(), object,
3283 Node* internal = gasm_->LoadFromObject(
3303 auto load_target = gasm_->MakeLabel();
3304 auto end_label = gasm_->MakeLabel(MachineType::PointerRepresentation());
3306 Node* ref_node = gasm_->LoadImmutableFromObject(
3312 Node* is_null_target = gasm_->WordEqual(target, gasm_->IntPtrConstant(0));
3313 gasm_->GotoIfNot(is_null_target, &end_label, target);
3317 Node* wrapper_code = gasm_->LoadImmutableFromObject(
3327 call_target = gasm_->IntAdd(
3328 wrapper_code, gasm_->IntPtrConstant(
3331 gasm_->Goto(&end_label, call_target);
3334 gasm_->Bind(&end_label);
3349 Node* internal_functions = gasm_->LoadImmutable(
3353 Node* function_ref_at_index = gasm_->LoadFixedArrayElement(
3354 internal_functions, gasm_->IntPtrConstant(function_index),
3356 gasm_->Branch(gasm_->TaggedEqual(function_ref_at_index, func_ref),
3439 return mcgraph()->machine()->Is64() ? gasm_->TruncateInt64ToInt32(value)
3444 return mcgraph()->machine()->Is64() ? gasm_->ChangeInt32ToInt64(value)
3449 return mcgraph()->machine()->Is32() ? gasm_->ChangeInt32ToInt64(value)
3461 return gasm_->ChangeUint32ToUint64(node);
3465 return gasm_->IntPtrConstant(kSmiShiftSize + kSmiTagSize);
3475 ? gasm_->Word32Shl(value, BuildSmiShiftBitsConstant32())
3476 : gasm_->WordShl(BuildChangeInt32ToIntPtr(value),
3482 ? gasm_->Word32Shl(value, BuildSmiShiftBitsConstant32())
3483 : gasm_->WordShl(BuildChangeUint32ToUintPtr(value),
3489 ? gasm_->Word32Sar(value, BuildSmiShiftBitsConstant32())
3491 gasm_->WordSar(value, BuildSmiShiftBitsConstant()));
3497 gasm_->Word32Sar(value, BuildSmiShiftBitsConstant32()))
3498 : gasm_->WordSar(value, BuildSmiShiftBitsConstant());
3505 Node* check = gasm_->Uint32LessThanOrEqual(value, max);
3507 Node* maxsmi = gasm_->NumberConstant(maxval);
3609 Node* WasmGraphBuilder::effect() { return gasm_->effect(); }
3611 Node* WasmGraphBuilder::control() { return gasm_->control(); }
3624 gasm_->InitializeEffectControl(effect, control);
3632 return gasm_->IntAdd(mem_start, gasm_->UintPtrConstant(offset));
3642 gasm_->WordShr(mem_size, Int32Constant(wasm::kWasmPageSizeLog2));
3665 Node* centry_stub = gasm_->LoadFromObject(MachineType::Pointer(),
3685 return gasm_->Call(call_descriptor, count, inputs);
3698 Node* base_or_index = gasm_->LoadFromObject(
3706 *base = gasm_->LoadFixedArrayElementAny(buffers, global.index);
3711 *offset = gasm_->IntAdd(
3712 gasm_->IntMul(base_or_index, gasm_->IntPtrConstant(kTaggedSize)),
3713 gasm_->IntPtrConstant(
3717 *offset = gasm_->IntPtrConstant(0);
3722 *offset = gasm_->IntPtrConstant(
3726 *offset = gasm_->IntPtrConstant(global.offset);
3737 return global.mutability ? gasm_->LoadFromObject(mem_type, base, offset)
3738 : gasm_->LoadImmutable(mem_type, base, offset);
3750 gasm_->StoreToObject(access, base, offset, val);
3755 return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableGet,
3757 gasm_->IntPtrConstant(table_index), index);
3762 gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableSet, Operator::kNoThrow,
3763 gasm_->IntPtrConstant(table_index), index, val);
3794 Node* effective_offset = gasm_->IntAdd(MemBuffer(capped_offset), index);
3797 gasm_->WordAnd(effective_offset, gasm_->IntPtrConstant(align_mask));
3799 gasm_->Word32Equal(cond, Int32Constant(0)), position);
3820 return {gasm_->UintPtrConstant(0), kOutOfBounds};
3831 Node* high_word = gasm_->TruncateInt64ToInt32(
3832 gasm_->Word64Shr(index, Int32Constant(32)));
3836 index = gasm_->TruncateInt64ToInt32(index);
3872 Node* cond = gasm_->UintLessThan(end_offset_node, mem_size);
3877 Node* effective_size = gasm_->IntSub(mem_size, end_offset_node);
3880 Node* cond = gasm_->UintLessThan(index, effective_size);
3925 Node* info = gasm_->IntPtrConstant(0);
3931 info = gasm_->StackSlot(size, size);
3933 gasm_->Store(StoreRepresentation(rep, kNoWriteBarrier), info,
3947 gasm_->StackSlot(sizeof(wasm::MemoryTracingInfo), kAlign);
3949 Node* effective_offset = gasm_->IntAdd(gasm_->UintPtrConstant(offset), index);
3951 gasm_->Store(StoreRepresentation(rep, kNoWriteBarrier), info,
4125 load = gasm_->LoadUnaligned(memtype, MemBuffer(capped_offset), index);
4128 load = gasm_->ProtectedLoad(memtype, MemBuffer(capped_offset), index);
4132 load = gasm_->Load(memtype, MemBuffer(capped_offset), index);
4144 ? gasm_->ChangeInt32ToInt64(load) // sign extend
4145 : gasm_->ChangeUint32ToUint64(load); // zero extend
4206 gasm_->StoreUnaligned(UnalignedStoreRepresentation{mem_rep},
4211 gasm_->ProtectedStore(mem_rep, MemBuffer(capped_offset), index, val),
4215 gasm_->Store(StoreRepresentation{mem_rep, kNoWriteBarrier},
4240 gasm_->UintLessThan(index, mem_size), BranchHint::kTrue);
4283 gasm_->Uint32LessThan(index, mem_size),
4420 gasm_->simplified(), mcgraph()->zone(), sig,
5353 Node* result = gasm_->AddNode(
5369 gasm_->IntAdd(gasm_->UintPtrConstant(capped_offset), index);
5373 return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmAtomicNotify,
5386 return gasm_->Call(call_descriptor, call_target, effective_offset,
5399 return gasm_->Call(call_descriptor, call_target, effective_offset,
5421 gasm_->ExternalConstant(ExternalReference::wasm_memory_init());
5430 gasm_->Uint32Constant(data_segment_index)},
5448 gasm_->StoreToObject(access, seg_size_array, data_segment_index << 2,
5466 gasm_->StoreUnaligned(type, stack_slot, Int32Constant(offset), value);
5484 gasm_->TruncateInt64ToInt32(gasm_->Word64Shr(*node, Int32Constant(32)));
5486 any_high_word ? gasm_->Word32Or(any_high_word, high_word) : high_word;
5488 *node = gasm_->TruncateInt64ToInt32(*node);
5496 gasm_->ExternalConstant(ExternalReference::wasm_memory_copy());
5515 gasm_->ExternalConstant(ExternalReference::wasm_memory_fill());
5535 gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableInit, Operator::kNoThrow,
5536 dst, src, size, gasm_->NumberConstant(table_index),
5537 gasm_->NumberConstant(elem_segment_index));
5550 gasm_->Store(store_rep, dropped_elem_segments, elem_segment_index,
5557 gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableCopy, Operator::kNoThrow,
5558 dst, src, size, gasm_->NumberConstant(table_dst_index),
5559 gasm_->NumberConstant(table_src_index));
5564 return BuildChangeSmiToInt32(gasm_->CallRuntimeStub(
5572 Node* table = gasm_->LoadFixedArrayElementAny(tables, table_index);
5576 Node* length_smi = gasm_->LoadFromObject(
5585 gasm_->CallRuntimeStub(
5596 Node* s = gasm_->Allocate(size);
5597 gasm_->StoreMap(s, rtt);
5598 gasm_->InitializeImmutableInObject(
5603 gasm_->StoreStructField(s, type, i, fields[i]);
5631 gasm_->Uint32LessThanOrEqual(
5632 length, gasm_->Uint32Constant(WasmArray::MaxLength(type))),
5635 // TODO(7748): Consider using gasm_->Allocate().
5641 gasm_->CallBuiltin(stub, Operator::kNoDeopt | Operator::kNoThrow, rtt,
5647 auto loop = gasm_->MakeLoopLabel(MachineRepresentation::kWord32);
5648 auto done = gasm_->MakeLabel();
5653 gasm_->Int32Add(start_offset, gasm_->Int32Mul(element_size, length));
5654 gasm_->Goto(&loop, start_offset);
5655 gasm_->Bind(&loop);
5658 Node* check = gasm_->Uint32LessThan(offset, end_offset);
5659 gasm_->GotoIfNot(check, &done);
5660 gasm_->StoreToObject(ObjectAccessForGCStores(type->element_type()), a,
5662 offset = gasm_->Int32Add(offset, element_size);
5663 gasm_->Goto(&loop, offset);
5665 gasm_->Bind(&done);
5673 // TODO(7748): Consider using gasm_->Allocate().
5675 gasm_->CallBuiltin(Builtin::kWasmAllocateArray_Uninitialized,
5681 gasm_->WasmArrayElementOffset(Int32Constant(i), element_type);
5683 gasm_->StoreToObject(ObjectAccessForGCStores(element_type), array, offset,
5686 gasm_->InitializeImmutableInObject(ObjectAccessForGCStores(element_type),
5697 Node* array = gasm_->CallBuiltin(
5699 gasm_->Uint32Constant(data_segment), offset, length, rtt);
5701 gasm_->TaggedEqual(
5702 array, gasm_->NumberConstant(
5707 gasm_->TaggedEqual(
5708 array, gasm_->NumberConstant(
5717 return gasm_->LoadImmutable(
5726 gasm_->GotoIf(condition, label, hint, Int32Constant(1));
5730 gasm_->GotoIf(condition, label, hint, Int32Constant(0));
5734 gasm_->GotoIfNot(condition, label, hint, Int32Constant(0));
5742 gasm_->GotoIf(condition, label, hint);
5795 Node* map = gasm_->LoadMap(object);
5799 callbacks.succeed_if(gasm_->TaggedEqual(map, rtt), BranchHint::kTrue);
5801 Node* type_info = gasm_->LoadWasmTypeInfo(map);
5802 Node* supertypes = gasm_->LoadSupertypes(type_info);
5803 Node* rtt_depth = gasm_->UintPtrConstant(config.rtt_depth);
5810 BuildChangeSmiToIntPtr(gasm_->LoadFixedArrayLengthAsSmi(supertypes));
5811 callbacks.fail_if_not(gasm_->UintLessThan(rtt_depth, supertypes_length),
5814 Node* maybe_match = gasm_->LoadImmutableFixedArrayElement(
5817 callbacks.fail_if_not(gasm_->TaggedEqual(maybe_match, rtt),
5826 callbacks.fail_if(gasm_->IsI31(object), BranchHint::kFalse);
5827 Node* map = gasm_->LoadMap(object);
5828 callbacks.fail_if_not(gasm_->IsDataRefMap(map), BranchHint::kTrue);
5838 callbacks.fail_if(gasm_->IsI31(object), BranchHint::kFalse);
5839 callbacks.fail_if_not(gasm_->HasInstanceType(object, instance_type),
5873 auto done = gasm_->MakeLabel(MachineRepresentation::kWord32);
5875 gasm_->Goto(&done, Int32Constant(1));
5876 gasm_->Bind(&done);
5884 auto done = gasm_->MakeLabel();
5886 gasm_->Goto(&done);
5887 gasm_->Bind(&done);
5904 auto done = gasm_->MakeLabel(MachineRepresentation::kWord32);
5906 gasm_->Goto(&done, Int32Constant(1));
5907 gasm_->Bind(&done);
5913 auto done = gasm_->MakeLabel();
5915 gasm_->Goto(&done);
5916 gasm_->Bind(&done);
5932 auto done = gasm_->MakeLabel(MachineRepresentation::kWord32);
5935 gasm_->Goto(&done, Int32Constant(1));
5936 gasm_->Bind(&done);
5942 auto done = gasm_->MakeLabel();
5946 gasm_->Goto(&done);
5947 gasm_->Bind(&done);
5965 auto done = gasm_->MakeLabel(MachineRepresentation::kWord32);
5968 gasm_->Goto(&done, Int32Constant(1));
5969 gasm_->Bind(&done);
5975 auto done = gasm_->MakeLabel();
5978 gasm_->Goto(&done);
5979 gasm_->Bind(&done);
5996 Node* WasmGraphBuilder::RefIsI31(Node* object) { return gasm_->IsI31(object); }
6000 TrapIfFalse(wasm::kTrapIllegalCast, gasm_->IsI31(object), position);
6009 gasm_->Branch(gasm_->IsI31(object), match_control, no_match_control,
6029 Node* offset = gasm_->FieldOffset(struct_type, field_index);
6031 ? gasm_->LoadFromObject(machine_type, struct_object, offset)
6032 : gasm_->LoadImmutableFromObject(machine_type, struct_object,
6044 gasm_->StoreStructField(struct_object, struct_type, field_index, field_value);
6050 Node* length = gasm_->LoadWasmArrayLength(array);
6051 TrapIfFalse(wasm::kTrapArrayOutOfBounds, gasm_->Uint32LessThan(index, length),
6059 Node* array_length = gasm_->LoadWasmArrayLength(array);
6060 Node* range_end = gasm_->Int32Add(index, length);
6061 Node* range_valid = gasm_->Word32And(
6062 gasm_->Uint32LessThanOrEqual(range_end, array_length),
6063 gasm_->Uint32LessThanOrEqual(index, range_end)); // No overflow
6077 Node* offset = gasm_->WasmArrayElementOffset(index, type->element_type());
6079 ? gasm_->LoadFromObject(machine_type, array_object, offset)
6080 : gasm_->LoadImmutableFromObject(machine_type, array_object,
6092 Node* offset = gasm_->WasmArrayElementOffset(index, type->element_type());
6093 gasm_->StoreToObject(ObjectAccessForGCStores(type->element_type()),
6102 return gasm_->LoadWasmArrayLength(array_object);
6121 auto skip = gasm_->MakeLabel();
6123 gasm_->GotoIf(gasm_->Word32Equal(length, Int32Constant(0)), &skip,
6127 gasm_->ExternalConstant(ExternalReference::wasm_array_copy());
6135 gasm_->Goto(&skip);
6136 gasm_->Bind(&skip);
6144 return gasm_->Word32Shl(input, BuildSmiShiftBitsConstant32());
6148 return gasm_->WordShl(input, gasm_->IntPtrConstant(kI31To32BitSmiShift));
6154 return gasm_->Word32SarShiftOutZeros(input, BuildSmiShiftBitsConstant32());
6158 gasm_->WordSar(input, gasm_->IntPtrConstant(kI31To32BitSmiShift)));
6164 return gasm_->Word32Shr(input, BuildSmiShiftBitsConstant32());
6168 gasm_->WordShr(input, gasm_->IntPtrConstant(kI31To32BitSmiShift)));
6247 : gasm_->GetBuiltinPointerTarget(builtin);
6258 auto builtin = gasm_->MakeDeferredLabel();
6259 auto done = gasm_->MakeLabel(MachineRepresentation::kTagged);
6262 Node* add = gasm_->Int32AddWithOverflow(value, value);
6263 Node* ovf = gasm_->Projection(1, add);
6264 gasm_->GotoIf(ovf, &builtin);
6267 Node* smi_tagged = BuildChangeInt32ToIntPtr(gasm_->Projection(0, add));
6268 gasm_->Goto(&done, smi_tagged);
6271 gasm_->Bind(&builtin);
6283 gasm_->Call(int32_to_heapnumber_operator_.get(), target, value);
6284 gasm_->Goto(&done, call);
6285 gasm_->Bind(&done);
6293 auto builtin = gasm_->MakeDeferredLabel();
6294 auto done = gasm_->MakeLabel(MachineRepresentation::kWord32);
6296 gasm_->GotoIfNot(IsSmi(value), &builtin);
6300 gasm_->Goto(&done, smi);
6303 gasm_->Bind(&builtin);
6317 ? gasm_->Call(tagged_non_smi_to_int32_operator_.get(),
6319 : gasm_->Call(tagged_non_smi_to_int32_operator_.get(),
6322 gasm_->Goto(&done, call);
6323 gasm_->Bind(&done);
6337 return gasm_->Call(float32_to_number_operator_.get(), target, value);
6350 return gasm_->Call(float64_to_number_operator_.get(), target, value);
6368 ? gasm_->Call(tagged_to_float64_operator_.get(), target,
6370 : gasm_->Call(tagged_to_float64_operator_.get(), target,
6403 gasm_->MakeLabel(MachineRepresentation::kTaggedPointer);
6405 gasm_->GotoIf(IsNull(node), &done, node);
6406 gasm_->Goto(&done,
6407 gasm_->LoadFromObject(
6411 gasm_->Bind(&done);
6414 return gasm_->LoadFromObject(
6427 gasm_->MakeLabel(MachineRepresentation::kTaggedPointer);
6429 gasm_->GotoIf(IsNull(node), &done, node);
6430 gasm_->Goto(&done, BuildAllocateObjectWrapper(node, context));
6431 gasm_->Bind(&done);
6444 auto wrap = gasm_->MakeLabel();
6445 auto function = gasm_->MakeLabel();
6446 auto done = gasm_->MakeLabel(MachineRepresentation::kTaggedPointer);
6447 gasm_->GotoIf(IsSmi(node), &done, node);
6448 gasm_->GotoIf(gasm_->IsDataRefMap(gasm_->LoadMap(node)), &wrap);
6449 gasm_->GotoIf(
6450 gasm_->HasInstanceType(node, WASM_INTERNAL_FUNCTION_TYPE),
6453 gasm_->Goto(&done, node);
6455 gasm_->Bind(&wrap);
6456 gasm_->Goto(&done, BuildAllocateObjectWrapper(node, context));
6458 gasm_->Bind(&function);
6459 gasm_->Goto(&done, gasm_->LoadFromObject(
6464 gasm_->Bind(&done);
6471 return gasm_->LoadFromObject(
6498 return gasm_->CallBuiltin(Builtin::kWasmAllocateObjectWrapper,
6507 auto not_a_function = gasm_->MakeLabel();
6508 auto end = gasm_->MakeLabel(MachineRepresentation::kTaggedPointer);
6510 gasm_->GotoIfNot(gasm_->HasInstanceType(input, JS_FUNCTION_TYPE),
6513 Node* function_data = gasm_->LoadFunctionDataFromJSFunction(input);
6516 Node* internal = gasm_->LoadFromObject(
6519 gasm_->Goto(&end, internal);
6521 gasm_->Bind(¬_a_function);
6523 Node* obj = gasm_->CallBuiltin(
6529 Node* is_undefined = gasm_->TaggedEqual(obj, UndefinedValue());
6530 gasm_->GotoIf(is_undefined, &end, input);
6532 gasm_->Goto(&end, obj);
6534 gasm_->Goto(&end, input);
6537 gasm_->Bind(&end);
6555 return gasm_->Call(GetI64ToBigIntCallDescriptor(), target, input);
6573 return frame_state ? gasm_->Call(GetBigIntToI64CallDescriptor(true), target,
6575 : gasm_->Call(GetBigIntToI64CallDescriptor(false),
6638 return gasm_->TruncateFloat64ToFloat32(
6664 return gasm_->RoundInt32ToFloat32(BuildChangeSmiToInt32(input));
6668 return gasm_->ChangeInt32ToFloat64(BuildChangeSmiToInt32(input));
6672 return gasm_->LoadFromObject(
6682 auto done = gasm_->MakeLabel(MachineRepresentation::kFloat32);
6683 auto heap_number = gasm_->MakeLabel();
6684 gasm_->GotoIfNot(IsSmi(input), &heap_number);
6685 gasm_->Goto(&done, SmiToFloat32(input));
6686 gasm_->Bind(&heap_number);
6688 gasm_->TruncateFloat64ToFloat32(HeapNumberToFloat64(input));
6689 gasm_->Goto(&done, value);
6690 gasm_->Bind(&done);
6694 auto done = gasm_->MakeLabel(MachineRepresentation::kFloat64);
6695 auto heap_number = gasm_->MakeLabel();
6696 gasm_->GotoIfNot(IsSmi(input), &heap_number);
6697 gasm_->Goto(&done, SmiToFloat64(input));
6698 gasm_->Bind(&heap_number);
6699 gasm_->Goto(&done, HeapNumberToFloat64(input));
6700 gasm_->Bind(&done);
6719 Node* flag_value = gasm_->LoadFromObject(MachineType::Pointer(),
6722 gasm_->Word32Equal(flag_value, Int32Constant(new_value ? 0 : 1));
6728 Node* message_id = gasm_->NumberConstant(static_cast<int32_t>(
6740 gasm_->StoreToObject(ObjectAccess(MachineType::Int32(), kNoWriteBarrier),
6750 gasm_->LoadFromObject(MachineType::Pointer(), isolate_root,
6789 return gasm_->CallBuiltin(Builtin::kIterableToFixedArrayForWasm,
6800 return gasm_->CallBuiltin(Builtin::kWasmAllocateJSArray,
6815 this, gasm_.get());
6821 gasm_->LoadExportedFunctionIndexAsSmi(function_data));
6827 Node* internal = gasm_->LoadFromObject(
6832 Node* instance_node = gasm_->LoadFromObject(
6849 Node* size = gasm_->NumberConstant(return_count);
6853 Node* fixed_array = gasm_->LoadJSArrayElements(jsval);
6857 gasm_->StoreFixedArrayElementAny(fixed_array, i, value);
6888 return gasm_->Word32Equal(
6889 gasm_->Word32And(BuildTruncateIntPtrToInt32(input),
6899 gasm_->GotoIfNot(IsSmi(input), slow_path);
6904 auto done = gasm_->MakeLabel();
6905 gasm_->GotoIf(IsSmi(input), &done);
6906 Node* map = gasm_->LoadMap(input);
6909 Node* is_heap_number = gasm_->WordEqual(heap_number_map, map);
6911 Node* is_heap_number = gasm_->TaggedEqual(heap_number_map, map);
6913 gasm_->GotoIf(is_heap_number, &done);
6914 gasm_->Goto(slow_path);
6915 gasm_->Bind(&done);
6943 Node* function_data = gasm_->LoadFunctionDataFromJSFunction(js_closure);
6968 auto done = gasm_->MakeLabel(MachineRepresentation::kTagged);
6970 auto slow_path = gasm_->MakeDeferredLabel();
6987 gasm_->Goto(&done, jsval);
6988 gasm_->Bind(&slow_path);
7007 wasm_param = gasm_->TruncateFloat64ToFloat32(wasm_param);
7018 gasm_->Goto(&done, jsval);
7019 gasm_->Bind(&done);
7030 Node* shared_function_info = gasm_->LoadSharedFunctionInfo(callable_node);
7031 Node* flags = gasm_->LoadFromObject(
7044 Node* global_proxy = gasm_->LoadFixedArrayElementPtr(
7056 auto resume = gasm_->MakeLabel(rep);
7057 gasm_->GotoIf(IsSmi(value), &resume, value);
7058 gasm_->GotoIfNot(gasm_->HasInstanceType(value, JS_PROMISE_TYPE), &resume,
7060 Node* suspender = gasm_->Load(
7063 Node* native_context = gasm_->Load(
7074 gasm_->Call(call_descriptor, call_target, chained_promise, suspender);
7075 gasm_->Goto(&resume, resolved);
7076 gasm_->Bind(&resume);
7088 Node* native_context = gasm_->Load(
7102 Node* callable_node = gasm_->Load(
7121 gasm_->LoadContextFromJSFunction(callable_node);
7143 call = gasm_->Call(call_descriptor, pos, args.begin());
7177 gasm_->LoadContextFromJSFunction(callable_node);
7185 call = gasm_->Call(call_descriptor, pos, args.begin());
7196 gasm_->GetBuiltinPointerTarget(Builtin::kCall_ReceiverIsAny);
7221 call = gasm_->Call(call_descriptor, pos, args.begin());
7244 wasm_values[i] = FromJS(gasm_->LoadFixedArrayElementAny(fixed_array, i),
7289 Node* function_node = gasm_->Load(
7292 Node* sfi_data = gasm_->LoadFunctionDataFromJSFunction(function_node);
7294 gasm_->Load(MachineType::AnyTagged(), sfi_data,
7301 gasm_->Store(StoreRepresentation(MachineType::PointerRepresentation(),
7319 gasm_->WordEqual(return_value, mcgraph()->IntPtrConstant(0)),
7330 Node* context = gasm_->Load(
7333 gasm_->Call(call_descriptor, call_target, return_value, context);
7363 Node* callable_node = gasm_->Load(
7366 Node* native_context = gasm_->Load(
7403 Node* stack_slot = gasm_->StackSlot(kSize, kAlign);
7405 gasm_->Store(StoreRepresentation(MachineType::PointerRepresentation(),
7432 Node* target_address = gasm_->ExternalConstant(
7434 gasm_->Store(StoreRepresentation(MachineType::PointerRepresentation(),
7436 target_address, 0, gasm_->IntPtrConstant(c_address));
7439 Node* javascript_execution_assert = gasm_->ExternalConstant(
7441 gasm_->Store(
7443 javascript_execution_assert, 0, gasm_->Int32Constant(0));
7446 Node* call = gasm_->Call(call_descriptor, pos, args.begin());
7449 gasm_->Store(
7451 javascript_execution_assert, 0, gasm_->Int32Constant(1));
7454 gasm_->Store(StoreRepresentation(MachineType::PointerRepresentation(),
7456 target_address, 0, gasm_->IntPtrConstant(0));
7482 Node* func_data = gasm_->LoadFunctionDataFromJSFunction(closure);
7483 Node* internal = gasm_->LoadFromObject(
7486 Node* ref = gasm_->LoadFromObject(
7489 Node* callable = gasm_->LoadFromObject(
7496 args[pos++] = gasm_->GetBuiltinPointerTarget(Builtin::kCall_ReceiverIsAny);
7519 Node* call = gasm_->Call(call_descriptor, pos, args.begin());
7532 Node* size = gasm_->NumberConstant(return_count);
7534 Node* result_fixed_array = gasm_->LoadJSArrayElements(jsval);
7537 Node* elem = gasm_->LoadFixedArrayElementAny(fixed_array, i);
7539 gasm_->StoreFixedArrayElementAny(result_fixed_array, i, cast);
7555 gasm_->Store(StoreRepresentation(MachineType::PointerRepresentation(),
7583 Node* call = gasm_->Call(call_descriptor, pos, args.begin());
7624 mcgraph()->common(), gasm_->simplified(),