Commit eded54ad authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Use GraphAssembler for loads and stores

This rewrites the macros to use the GraphAssembler directly. As a next
step we should explore if the macros are still worth having, or if they
should be inlined everywhere.

R=jkummerow@chromium.org

Bug: v8:10123
Change-Id: Ia700e00af6a617c4d5a9e34f5be6cab098cd576a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037449Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66144}
parent 6b842b41
......@@ -85,14 +85,11 @@ MachineType assert_size(int expected_size, MachineType type) {
#define WASM_INSTANCE_OBJECT_OFFSET(name) \
wasm::ObjectAccess::ToTagged(WasmInstanceObject::k##name##Offset)
#define LOAD_RAW(base_pointer, byte_offset, type) \
SetEffect(graph()->NewNode(mcgraph()->machine()->Load(type), base_pointer, \
mcgraph()->Int32Constant(byte_offset), effect(), \
control()))
#define LOAD_RAW_NODE_OFFSET(base_pointer, node_offset, type) \
gasm_->Load(type, base_pointer, node_offset)
#define LOAD_RAW_NODE_OFFSET(base_pointer, node_offset, type) \
SetEffect(graph()->NewNode(mcgraph()->machine()->Load(type), base_pointer, \
node_offset, effect(), control()))
#define LOAD_RAW(base_pointer, byte_offset, type) \
LOAD_RAW_NODE_OFFSET(base_pointer, gasm_->Int32Constant(byte_offset), type)
#define LOAD_INSTANCE_FIELD(name, type) \
LOAD_RAW(instance_node_.get(), WASM_INSTANCE_OBJECT_OFFSET(name), \
......@@ -117,15 +114,11 @@ MachineType assert_size(int expected_size, MachineType type) {
#define LOAD_FIXED_ARRAY_SLOT_ANY(array_node, index) \
LOAD_FIXED_ARRAY_SLOT(array_node, index, MachineType::AnyTagged())
#define STORE_RAW(base, offset, val, rep, barrier) \
SetEffect(graph()->NewNode( \
mcgraph()->machine()->Store(StoreRepresentation(rep, barrier)), base, \
mcgraph()->Int32Constant(offset), val, effect(), control()))
#define STORE_RAW(base, offset, val, rep, barrier) \
STORE_RAW_NODE_OFFSET(base, gasm_->Int32Constant(offset), val, rep, barrier)
#define STORE_RAW_NODE_OFFSET(base, node_offset, val, rep, barrier) \
SetEffect(graph()->NewNode( \
mcgraph()->machine()->Store(StoreRepresentation(rep, barrier)), base, \
node_offset, val, effect(), control()))
#define STORE_RAW_NODE_OFFSET(base, node_offset, val, rep, barrier) \
gasm_->Store(StoreRepresentation(rep, barrier), base, node_offset, val)
// This can be used to store tagged Smi values only.
#define STORE_FIXED_ARRAY_SLOT_SMI(array_node, index, value) \
......
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