Commit 82cb91c2 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][memory64] Prepare TurboFan for 64-bit memory offsets

This CL changes the WasmGraphBuilder interface to accept 64-bit memory
offsets, and adapts the implementation to handle them correctly.

R=manoskouk@chromium.org

Bug: v8:10949
Change-Id: Ifd42edc855c9283ef69522663c735ab31c3d54f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2445474Reviewed-by: 's avatarManos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70331}
parent 1ba58b4d
This diff is collapsed.
...@@ -303,21 +303,21 @@ class WasmGraphBuilder { ...@@ -303,21 +303,21 @@ class WasmGraphBuilder {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
Node* CurrentMemoryPages(); Node* CurrentMemoryPages();
Node* TraceMemoryOperation(bool is_store, MachineRepresentation, Node* index, Node* TraceMemoryOperation(bool is_store, MachineRepresentation, Node* index,
uint32_t offset, wasm::WasmCodePosition); uintptr_t offset, wasm::WasmCodePosition);
Node* LoadMem(wasm::ValueType type, MachineType memtype, Node* index, Node* LoadMem(wasm::ValueType type, MachineType memtype, Node* index,
uint32_t offset, uint32_t alignment, uint64_t offset, uint32_t alignment,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
#if defined(V8_TARGET_BIG_ENDIAN) || defined(V8_TARGET_ARCH_S390_LE_SIM) #if defined(V8_TARGET_BIG_ENDIAN) || defined(V8_TARGET_ARCH_S390_LE_SIM)
Node* LoadTransformBigEndian(wasm::ValueType type, MachineType memtype, Node* LoadTransformBigEndian(wasm::ValueType type, MachineType memtype,
wasm::LoadTransformationKind transform, wasm::LoadTransformationKind transform,
Node* index, uint32_t offset, uint32_t alignment, Node* index, uint64_t offset, uint32_t alignment,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
#endif #endif
Node* LoadTransform(wasm::ValueType type, MachineType memtype, Node* LoadTransform(wasm::ValueType type, MachineType memtype,
wasm::LoadTransformationKind transform, Node* index, wasm::LoadTransformationKind transform, Node* index,
uint32_t offset, uint32_t alignment, uint64_t offset, uint32_t alignment,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
Node* StoreMem(MachineRepresentation mem_rep, Node* index, uint32_t offset, Node* StoreMem(MachineRepresentation mem_rep, Node* index, uint64_t offset,
uint32_t alignment, Node* val, wasm::WasmCodePosition position, uint32_t alignment, Node* val, wasm::WasmCodePosition position,
wasm::ValueType type); wasm::ValueType type);
static void PrintDebugName(Node* node); static void PrintDebugName(Node* node);
...@@ -382,7 +382,7 @@ class WasmGraphBuilder { ...@@ -382,7 +382,7 @@ class WasmGraphBuilder {
Node* Simd8x16ShuffleOp(const uint8_t shuffle[16], Node* const* inputs); Node* Simd8x16ShuffleOp(const uint8_t shuffle[16], Node* const* inputs);
Node* AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs, Node* AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs,
uint32_t alignment, uint32_t offset, uint32_t alignment, uint64_t offset,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
Node* AtomicFence(); Node* AtomicFence();
...@@ -455,7 +455,10 @@ class WasmGraphBuilder { ...@@ -455,7 +455,10 @@ class WasmGraphBuilder {
Node* BuildLoadIsolateRoot(); Node* BuildLoadIsolateRoot();
Node* MemBuffer(uint32_t offset); // MemBuffer is only called with valid offsets (after bounds checking), so the
// offset fits in a platform-dependent uintptr_t.
Node* MemBuffer(uintptr_t offset);
// BoundsCheckMem receives a uint32 {index} node and returns a ptrsize index. // BoundsCheckMem receives a uint32 {index} node and returns a ptrsize index.
Node* BoundsCheckMem(uint8_t access_size, Node* index, uint64_t offset, Node* BoundsCheckMem(uint8_t access_size, Node* index, uint64_t offset,
wasm::WasmCodePosition, EnforceBoundsCheck); wasm::WasmCodePosition, EnforceBoundsCheck);
...@@ -471,7 +474,7 @@ class WasmGraphBuilder { ...@@ -471,7 +474,7 @@ class WasmGraphBuilder {
Node* BoundsCheckMemRange(Node** start, Node** size, wasm::WasmCodePosition); Node* BoundsCheckMemRange(Node** start, Node** size, wasm::WasmCodePosition);
Node* CheckBoundsAndAlignment(int8_t access_size, Node* index, Node* CheckBoundsAndAlignment(int8_t access_size, Node* index,
uint32_t offset, wasm::WasmCodePosition); uint64_t offset, wasm::WasmCodePosition);
Node* Uint32ToUintptr(Node*); Node* Uint32ToUintptr(Node*);
const Operator* GetSafeLoadOperator(int offset, wasm::ValueType type); const Operator* GetSafeLoadOperator(int offset, wasm::ValueType type);
......
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