Commit f43b45a1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][cleanup] Use macros to load instance fields

Use the existing macros to load MemoryStart and MemorySize from the
instance.

R=titzer@chromium.org

Change-Id: Iaa597fedcfc4581503d7cdf2fb94da6e285cc545
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1538122Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60434}
parent 27258eb8
......@@ -3040,16 +3040,12 @@ void WasmGraphBuilder::InitInstanceCache(
DCHECK_NOT_NULL(instance_node_);
// Load the memory start.
instance_cache->mem_start = SetEffect(graph()->NewNode(
mcgraph()->machine()->Load(MachineType::UintPtr()), instance_node_.get(),
mcgraph()->Int32Constant(WASM_INSTANCE_OBJECT_OFFSET(MemoryStart)),
Effect(), Control()));
instance_cache->mem_start =
LOAD_INSTANCE_FIELD(MemoryStart, MachineType::UintPtr());
// Load the memory size.
instance_cache->mem_size = SetEffect(graph()->NewNode(
mcgraph()->machine()->Load(MachineType::UintPtr()), instance_node_.get(),
mcgraph()->Int32Constant(WASM_INSTANCE_OBJECT_OFFSET(MemorySize)),
Effect(), Control()));
instance_cache->mem_size =
LOAD_INSTANCE_FIELD(MemorySize, MachineType::UintPtr());
if (untrusted_code_mitigations_) {
// Load the memory mask.
......
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