Lines Matching defs:index
187 // Just encode the stub index. This will be patched at relocation.
384 Node* LoadFixedArrayElement(Node* array, int index, MachineType type) {
387 wasm::ObjectAccess::ElementOffsetInTaggedFixedArray(index));
390 Node* LoadFixedArrayElementSmi(Node* array, int index) {
391 return LoadFixedArrayElement(array, index, MachineType::TaggedSigned());
394 Node* LoadFixedArrayElementPtr(Node* array, int index) {
395 return LoadFixedArrayElement(array, index, MachineType::TaggedPointer());
398 Node* LoadFixedArrayElementAny(Node* array, int index) {
399 return LoadFixedArrayElement(array, index, MachineType::AnyTagged());
402 Node* StoreFixedArrayElement(Node* array, int index, Node* value,
406 wasm::ObjectAccess::ElementOffsetInTaggedFixedArray(index), value);
409 Node* StoreFixedArrayElementSmi(Node* array, int index, Node* value) {
411 array, index, value,
415 Node* StoreFixedArrayElementAny(Node* array, int index, Node* value) {
417 array, index, value,
480 Node* WasmArrayElementOffset(Node* index, wasm::ValueType element_type) {
482 mcgraph()->machine()->Is64() ? ChangeUint32ToUint64(index) : index;
571 Node* WasmGraphBuilder::Param(int index, const char* debug_name) {
575 DCHECK_GE(index, kMinParameterIndex);
576 int array_index = index - kMinParameterIndex;
579 mcgraph()->common()->Parameter(index, debug_name), graph()->start());
753 // Just encode the stub index. This will be patched at relocation.
2496 uint32_t index = 0;
2506 BuildEncodeException32BitValue(values_array, &index, value);
2514 BuildEncodeException32BitValue(values_array, &index, upper32);
2516 BuildEncodeException32BitValue(values_array, &index, lower32);
2521 values_array, &index,
2524 values_array, &index,
2527 values_array, &index,
2530 values_array, &index,
2536 gasm_->StoreFixedArrayElementAny(values_array, index, value);
2537 ++index;
2546 DCHECK_EQ(encoded_size, index);
2558 uint32_t* index,
2562 gasm_->StoreFixedArrayElementSmi(values_array, *index, upper_halfword_as_smi);
2563 ++(*index);
2566 gasm_->StoreFixedArrayElementSmi(values_array, *index, lower_halfword_as_smi);
2567 ++(*index);
2571 uint32_t* index) {
2573 gasm_->LoadFixedArrayElementSmi(values_array, *index));
2574 (*index)++;
2577 gasm_->LoadFixedArrayElementSmi(values_array, *index));
2578 (*index)++;
2584 uint32_t* index) {
2587 BuildDecodeException32BitValue(values_array, index)),
2590 BuildDecodeException32BitValue(values_array, index));
2628 uint32_t index = 0;
2635 value = BuildDecodeException32BitValue(values_array, &index);
2638 value = BuildDecodeException64BitValue(values_array, &index);
2642 BuildDecodeException32BitValue(values_array, &index));
2647 BuildDecodeException64BitValue(values_array, &index));
2653 BuildDecodeException32BitValue(values_array, &index));
2656 BuildDecodeException32BitValue(values_array, &index));
2659 BuildDecodeException32BitValue(values_array, &index));
2662 BuildDecodeException32BitValue(values_array, &index));
2667 value = gasm_->LoadFixedArrayElementAny(values_array, index);
2668 ++index;
2678 DCHECK_EQ(index, WasmExceptionPackage::GetEncodedSize(tag));
3007 // Make room for the instance_node parameter at index 1, just after code.
3116 Node* WasmGraphBuilder::CallDirect(uint32_t index, wasm::FunctionSig* real_sig,
3122 if (env_ && index < env_->module->num_imported_functions) {
3124 return BuildImportCall(real_sig, args, rets, position, index,
3129 // Just encode the function index. This will be patched at instantiation.
3130 Address code = static_cast<Address>(index);
3377 Node* WasmGraphBuilder::ReturnCall(uint32_t index,
3383 if (env_ && index < env_->module->num_imported_functions) {
3385 return BuildImportCall(real_sig, args, {}, position, index, kReturnCall);
3389 // Just encode the function index. This will be patched during code
3391 Address code = static_cast<Address>(index);
3701 Int32Constant(global.index * kSystemPointerSize));
3706 *base = gasm_->LoadFixedArrayElementAny(buffers, global.index);
3708 // For this case, {base_or_index} gives the index of the global in the
3709 // buffer. From the index, calculate the actual offset in the FixedArray.
3710 // This is kHeaderSize + (index * kTaggedSize).
3730 Node* WasmGraphBuilder::GlobalGet(uint32_t index) {
3731 const wasm::WasmGlobal& global = env_->module->globals[index];
3741 void WasmGraphBuilder::GlobalSet(uint32_t index, Node* val) {
3742 const wasm::WasmGlobal& global = env_->module->globals[index];
3753 Node* WasmGraphBuilder::TableGet(uint32_t table_index, Node* index,
3757 gasm_->IntPtrConstant(table_index), index);
3760 void WasmGraphBuilder::TableSet(uint32_t table_index, Node* index, Node* val,
3763 gasm_->IntPtrConstant(table_index), index, val);
3767 int8_t access_size, Node* index, uint64_t offset,
3771 index =
3772 BoundsCheckMem(access_size, index, offset, position, kNeedsBoundsCheck)
3779 // Don't emit an alignment check if the index is a constant.
3781 UintPtrMatcher match(index);
3788 return index;
3794 Node* effective_offset = gasm_->IntAdd(MemBuffer(capped_offset), index);
3800 return index;
3804 // bounds-checked index, which is guaranteed to have (the equivalent of)
3807 WasmGraphBuilder::BoundsCheckMem(uint8_t access_size, Node* index,
3823 // Convert the index to uintptr.
3825 index = BuildChangeUint32ToUintPtr(index);
3832 gasm_->Word64Shr(index, Int32Constant(32)));
3836 index = gasm_->TruncateInt64ToInt32(index);
3840 // converted index and assume it to be in-bounds.
3841 if (env_->bounds_checks == wasm::kNoBoundsChecks) return {index, kInBounds};
3843 // The accessed memory is [index + offset, index + end_offset].
3844 // Check that the last read byte (at {index + end_offset}) is in bounds.
3848 // 2) Check that {index + end_offset < mem_size} by
3850 // - checking that {index < effective_size}.
3854 UintPtrMatcher match(index);
3857 // The input index is a constant and everything is statically within
3859 return {index, kInBounds};
3864 return {index, kTrapHandler};
3880 Node* cond = gasm_->UintLessThan(index, effective_size);
3882 return {index, kDynamicallyChecked};
3943 Node* index, uintptr_t offset,
3949 Node* effective_offset = gasm_->IntAdd(gasm_->UintPtrConstant(offset), index);
4032 Node* value, Node* index, uint64_t offset,
4039 std::tie(index, bounds_check_result) =
4040 BoundsCheckMem(access_size, index, offset, position, kCanOmitBoundsCheck);
4049 MemBuffer(capped_offset), index, value, effect(), control()));
4055 TraceMemoryOperation(false, memtype.representation(), index, capped_offset,
4064 Node* index, uint64_t offset,
4081 std::tie(index, bounds_check_result) =
4082 BoundsCheckMem(access_size, index, offset, position, kCanOmitBoundsCheck);
4090 MemBuffer(capped_offset), index, effect(), control()));
4097 TraceMemoryOperation(false, memtype.representation(), index, capped_offset,
4104 Node* index, uint64_t offset,
4116 std::tie(index, bounds_check_result) = BoundsCheckMem(
4117 memtype.MemSize(), index, offset, position, kCanOmitBoundsCheck);
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);
4149 TraceMemoryOperation(false, memtype.representation(), index, capped_offset,
4156 void WasmGraphBuilder::StoreLane(MachineRepresentation mem_rep, Node* index,
4163 std::tie(index, bounds_check_result) =
4164 BoundsCheckMem(i::ElementSizeInBytes(mem_rep), index, offset, position,
4174 MemBuffer(capped_offset), index, val, effect(), control()));
4180 TraceMemoryOperation(true, mem_rep, index, capped_offset, position);
4184 void WasmGraphBuilder::StoreMem(MachineRepresentation mem_rep, Node* index,
4193 std::tie(index, bounds_check_result) =
4194 BoundsCheckMem(i::ElementSizeInBytes(mem_rep), index, offset, position,
4207 MemBuffer(capped_offset), index, val);
4211 gasm_->ProtectedStore(mem_rep, MemBuffer(capped_offset), index, val),
4216 MemBuffer(capped_offset), index, val);
4221 TraceMemoryOperation(true, mem_rep, index, capped_offset, position);
4225 Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) {
4238 index = BuildChangeUint32ToUintPtr(index);
4240 gasm_->UintLessThan(index, mem_size), BranchHint::kTrue);
4244 index, effect(), bounds_check.if_true);
4270 Node* WasmGraphBuilder::BuildAsmjsStoreMem(MachineType type, Node* index,
4283 gasm_->Uint32LessThan(index, mem_size),
4287 index = BuildChangeUint32ToUintPtr(index);
4290 Node* store = graph()->NewNode(store_op, mem_start, index, val, effect(),
5316 Node* index = CheckBoundsAndAlignment(info.machine_type.MemSize(), inputs[0],
5338 Node* input_nodes[6] = {MemBuffer(capped_offset), index};
5369 gasm_->IntAdd(gasm_->UintPtrConstant(capped_offset), index);
5416 // The data segment index must be in bounds since it is required by
5542 // The elem segment index must be in bounds since it is required by
6047 void WasmGraphBuilder::BoundsCheckArray(Node* array, Node* index,
6051 TrapIfFalse(wasm::kTrapArrayOutOfBounds, gasm_->Uint32LessThan(index, length),
6055 void WasmGraphBuilder::BoundsCheckArrayCopy(Node* array, Node* index,
6060 Node* range_end = gasm_->Int32Add(index, length);
6063 gasm_->Uint32LessThanOrEqual(index, range_end)); // No overflow
6068 const wasm::ArrayType* type, Node* index,
6074 BoundsCheckArray(array_object, index, position);
6077 Node* offset = gasm_->WasmArrayElementOffset(index, type->element_type());
6085 Node* index, Node* value,
6091 BoundsCheckArray(array_object, index, position);
6092 Node* offset = gasm_->WasmArrayElementOffset(index, type->element_type());
6381 Param(i + 1); // Start from index 1 to drop the instance_node.
6819 // Load function index from {WasmExportedFunctionData}.
7258 1 /* offset for first parameter index being -1 */ +
7280 // Start from the parameter with index 1 to drop the instance_node.
7509 Node* param = Param(i + 1); // Start from index 1 to skip receiver.
7546 // +1 offset for first parameter index being -1.
8187 1 /* offset for first parameter index being -1 */ +
8405 int index) {
8412 module_bytes.value(), index);
8424 int name_len = SNPrintF(name_vector, "wasm-function#%d", index);
8543 int index = -1 - (slot_offset_ + allocator_.NextStackSlot(rep));
8544 return LinkageLocation::ForCallerFrameSlot(index, type);