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

Reland "[wasm] [cleanup] Only pass information really needed"

This is a reland of fa18e78d.

Mips compile error is fixed.

Original change's description:
> [wasm] [cleanup] Only pass information really needed
>
> Instead of always passing the MachineType, we can often just pass the
> accessed memory size or the MachineRepresentation, which is less
> information to pass and will simplify the upcoming refactoring for
> memory operations in Liftoff.
>
> R=titzer@chromium.org
>
> Bug: v8:6600
> Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
> Reviewed-on: https://chromium-review.googlesource.com/822194
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50041}

TBR=titzer@chromium.org

Bug: v8:6600
Change-Id: Ia2c47464277a7c7a70099e7f7d6e32003e34d87e
Reviewed-on: https://chromium-review.googlesource.com/822342Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50047}
parent 65ac8ca0
This diff is collapsed.
......@@ -353,7 +353,7 @@ class WasmGraphBuilder {
Node* LoadMem(wasm::ValueType type, MachineType memtype, Node* index,
uint32_t offset, uint32_t alignment,
wasm::WasmCodePosition position);
Node* StoreMem(MachineType memtype, Node* index, uint32_t offset,
Node* StoreMem(MachineRepresentation mem_rep, Node* index, uint32_t offset,
uint32_t alignment, Node* val, wasm::WasmCodePosition position,
wasm::ValueType type);
static void PrintDebugName(Node* node);
......@@ -457,11 +457,11 @@ class WasmGraphBuilder {
Node* String(const char* string);
Node* MemBuffer(uint32_t offset);
void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset,
void BoundsCheckMem(uint8_t access_size, Node* index, uint32_t offset,
wasm::WasmCodePosition position);
const Operator* GetSafeLoadOperator(int offset, wasm::ValueType type);
const Operator* GetSafeStoreOperator(int offset, wasm::ValueType type);
Node* BuildChangeEndiannessStore(Node* node, MachineType type,
Node* BuildChangeEndiannessStore(Node* node, MachineRepresentation rep,
wasm::ValueType wasmtype = wasm::kWasmStmt);
Node* BuildChangeEndiannessLoad(Node* node, MachineType type,
wasm::ValueType wasmtype = wasm::kWasmStmt);
......
......@@ -528,7 +528,7 @@ class LiftoffCompiler {
Value* result) {
unsupported(decoder, "memory load");
}
void StoreMem(Decoder* decoder, ValueType type, MachineType mem_type,
void StoreMem(Decoder* decoder, ValueType type, MachineRepresentation mem_rep,
const MemoryAccessOperand<validate>& operand,
const Value& index, const Value& value) {
unsupported(decoder, "memory store");
......
......@@ -581,7 +581,7 @@ struct ControlWithNamedConstructors : public ControlBase<Value> {
F(LoadMem, ValueType type, MachineType mem_type, \
const MemoryAccessOperand<validate>& operand, const Value& index, \
Value* result) \
F(StoreMem, ValueType type, MachineType mem_type, \
F(StoreMem, ValueType type, MachineRepresentation mem_rep, \
const MemoryAccessOperand<validate>& operand, const Value& index, \
const Value& value) \
F(CurrentMemoryPages, Value* result) \
......@@ -1997,8 +1997,8 @@ class WasmFullDecoder : public WasmDecoder<validate> {
ElementSizeLog2Of(mem_type.representation()));
auto value = Pop(1, type);
auto index = Pop(0, kWasmI32);
CALL_INTERFACE_IF_REACHABLE(StoreMem, type, mem_type, operand, index,
value);
CALL_INTERFACE_IF_REACHABLE(StoreMem, type, mem_type.representation(),
operand, index, value);
return operand.length;
}
......
......@@ -347,10 +347,10 @@ class WasmGraphBuildingInterface {
operand.alignment, decoder->position());
}
void StoreMem(Decoder* decoder, ValueType type, MachineType mem_type,
void StoreMem(Decoder* decoder, ValueType type, MachineRepresentation mem_rep,
const MemoryAccessOperand<validate>& operand,
const Value& index, const Value& value) {
BUILD(StoreMem, mem_type, index.node, operand.offset, operand.alignment,
BUILD(StoreMem, mem_rep, index.node, operand.offset, operand.alignment,
value.node, decoder->position(), type);
}
......
......@@ -551,7 +551,7 @@ class V8_EXPORT_PRIVATE WasmOpcodes {
static const char* TrapReasonMessage(TrapReason reason);
static byte MemSize(MachineType type) {
return 1 << ElementSizeLog2Of(type.representation());
return MemSize(type.representation());
}
static byte MemSize(ValueType type) { return 1 << ElementSizeLog2Of(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