Commit 4aef9c1c authored by clemensh's avatar clemensh Committed by Commit bot

[wasm] wasm-compiler: Remove unused parameter on MemSize method

R=titzer@chromium.org, ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2714403004
Cr-Commit-Position: refs/heads/master@{#43450}
parent b2177684
...@@ -3073,18 +3073,13 @@ Node* WasmGraphBuilder::CurrentMemoryPages() { ...@@ -3073,18 +3073,13 @@ Node* WasmGraphBuilder::CurrentMemoryPages() {
return result; return result;
} }
Node* WasmGraphBuilder::MemSize(uint32_t offset) { Node* WasmGraphBuilder::MemSize() {
DCHECK(module_ && module_->instance); DCHECK_NOT_NULL(module_);
uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); if (mem_size_) return mem_size_;
if (offset == 0) { uint32_t size = module_->instance ? module_->instance->mem_size : 0;
if (!mem_size_)
mem_size_ = jsgraph()->RelocatableInt32Constant( mem_size_ = jsgraph()->RelocatableInt32Constant(
size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE); size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
return mem_size_; return mem_size_;
} else {
return jsgraph()->RelocatableInt32Constant(
size + offset, RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
}
} }
void WasmGraphBuilder::EnsureFunctionTableNodes() { void WasmGraphBuilder::EnsureFunctionTableNodes() {
...@@ -3292,8 +3287,8 @@ Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) { ...@@ -3292,8 +3287,8 @@ Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) {
// TODO(turbofan): fold bounds checks for constant asm.js loads. // TODO(turbofan): fold bounds checks for constant asm.js loads.
// asm.js semantics use CheckedLoad (i.e. OOB reads return 0ish). // asm.js semantics use CheckedLoad (i.e. OOB reads return 0ish).
const Operator* op = jsgraph()->machine()->CheckedLoad(type); const Operator* op = jsgraph()->machine()->CheckedLoad(type);
Node* load = graph()->NewNode(op, MemBuffer(0), index, MemSize(0), *effect_, Node* load =
*control_); graph()->NewNode(op, MemBuffer(0), index, MemSize(), *effect_, *control_);
*effect_ = load; *effect_ = load;
return load; return load;
} }
...@@ -3304,7 +3299,7 @@ Node* WasmGraphBuilder::BuildAsmjsStoreMem(MachineType type, Node* index, ...@@ -3304,7 +3299,7 @@ Node* WasmGraphBuilder::BuildAsmjsStoreMem(MachineType type, Node* index,
// asm.js semantics use CheckedStore (i.e. ignore OOB writes). // asm.js semantics use CheckedStore (i.e. ignore OOB writes).
const Operator* op = const Operator* op =
jsgraph()->machine()->CheckedStore(type.representation()); jsgraph()->machine()->CheckedStore(type.representation());
Node* store = graph()->NewNode(op, MemBuffer(0), index, MemSize(0), val, Node* store = graph()->NewNode(op, MemBuffer(0), index, MemSize(), val,
*effect_, *control_); *effect_, *control_);
*effect_ = store; *effect_ = store;
return val; return val;
......
...@@ -278,7 +278,7 @@ class WasmGraphBuilder { ...@@ -278,7 +278,7 @@ class WasmGraphBuilder {
Graph* graph(); Graph* graph();
Node* String(const char* string); Node* String(const char* string);
Node* MemSize(uint32_t offset); Node* MemSize();
Node* MemBuffer(uint32_t offset); Node* MemBuffer(uint32_t offset);
void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset, void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
......
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