Commit b834c530 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm-gc] Emit array offset as intptr

Bug: v8:7748
Change-Id: Id94edd934ff57a722012fabb729046dc7a8bc29c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2968944Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75236}
parent acd567b8
......@@ -409,9 +409,12 @@ class WasmGraphAssembler : public GraphAssembler {
}
Node* WasmArrayElementOffset(Node* index, wasm::ValueType element_type) {
return Int32Add(
Int32Constant(wasm::ObjectAccess::ToTagged(WasmArray::kHeaderSize)),
Int32Mul(index, Int32Constant(element_type.element_size_bytes())));
Node* index_intptr =
mcgraph()->machine()->Is64() ? ChangeInt32ToInt64(index) : index;
return IntAdd(
IntPtrConstant(wasm::ObjectAccess::ToTagged(WasmArray::kHeaderSize)),
IntMul(index_intptr,
IntPtrConstant(element_type.element_size_bytes())));
}
Node* LoadWasmArrayLength(Node* array) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment