Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2714403004: [wasm] wasm-compiler: Remove unused parameter on MemSize method (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after
3061 *control_}; 3061 *control_};
3062 Node* call = graph()->NewNode(jsgraph()->common()->Call(desc), 3062 Node* call = graph()->NewNode(jsgraph()->common()->Call(desc),
3063 static_cast<int>(arraysize(inputs)), inputs); 3063 static_cast<int>(arraysize(inputs)), inputs);
3064 3064
3065 Node* result = BuildChangeSmiToInt32(call); 3065 Node* result = BuildChangeSmiToInt32(call);
3066 3066
3067 *effect_ = call; 3067 *effect_ = call;
3068 return result; 3068 return result;
3069 } 3069 }
3070 3070
3071 Node* WasmGraphBuilder::MemSize(uint32_t offset) { 3071 Node* WasmGraphBuilder::MemSize() {
3072 DCHECK(module_ && module_->instance); 3072 DCHECK_NOT_NULL(module_);
3073 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); 3073 if (mem_size_) return mem_size_;
3074 if (offset == 0) { 3074 uint32_t size = module_->instance ? module_->instance->mem_size : 0;
3075 if (!mem_size_) 3075 mem_size_ = jsgraph()->RelocatableInt32Constant(
3076 mem_size_ = jsgraph()->RelocatableInt32Constant( 3076 size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
3077 size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 3077 return mem_size_;
3078 return mem_size_;
3079 } else {
3080 return jsgraph()->RelocatableInt32Constant(
3081 size + offset, RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
3082 }
3083 } 3078 }
3084 3079
3085 void WasmGraphBuilder::EnsureFunctionTableNodes() { 3080 void WasmGraphBuilder::EnsureFunctionTableNodes() {
3086 if (function_tables_.size() > 0) return; 3081 if (function_tables_.size() > 0) return;
3087 size_t tables_size = module_->instance->function_tables.size(); 3082 size_t tables_size = module_->instance->function_tables.size();
3088 DCHECK(tables_size == module_->instance->signature_tables.size()); 3083 DCHECK(tables_size == module_->instance->signature_tables.size());
3089 for (size_t i = 0; i < tables_size; ++i) { 3084 for (size_t i = 0; i < tables_size; ++i) {
3090 auto function_handle = module_->instance->function_tables[i]; 3085 auto function_handle = module_->instance->function_tables[i];
3091 auto signature_handle = module_->instance->signature_tables[i]; 3086 auto signature_handle = module_->instance->signature_tables[i];
3092 DCHECK(!function_handle.is_null() && !signature_handle.is_null()); 3087 DCHECK(!function_handle.is_null() && !signature_handle.is_null());
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
3280 3275
3281 *effect_ = store; 3276 *effect_ = store;
3282 3277
3283 return store; 3278 return store;
3284 } 3279 }
3285 3280
3286 Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) { 3281 Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) {
3287 // TODO(turbofan): fold bounds checks for constant asm.js loads. 3282 // TODO(turbofan): fold bounds checks for constant asm.js loads.
3288 // asm.js semantics use CheckedLoad (i.e. OOB reads return 0ish). 3283 // asm.js semantics use CheckedLoad (i.e. OOB reads return 0ish).
3289 const Operator* op = jsgraph()->machine()->CheckedLoad(type); 3284 const Operator* op = jsgraph()->machine()->CheckedLoad(type);
3290 Node* load = graph()->NewNode(op, MemBuffer(0), index, MemSize(0), *effect_, 3285 Node* load =
3291 *control_); 3286 graph()->NewNode(op, MemBuffer(0), index, MemSize(), *effect_, *control_);
3292 *effect_ = load; 3287 *effect_ = load;
3293 return load; 3288 return load;
3294 } 3289 }
3295 3290
3296 Node* WasmGraphBuilder::BuildAsmjsStoreMem(MachineType type, Node* index, 3291 Node* WasmGraphBuilder::BuildAsmjsStoreMem(MachineType type, Node* index,
3297 Node* val) { 3292 Node* val) {
3298 // TODO(turbofan): fold bounds checks for constant asm.js stores. 3293 // TODO(turbofan): fold bounds checks for constant asm.js stores.
3299 // asm.js semantics use CheckedStore (i.e. ignore OOB writes). 3294 // asm.js semantics use CheckedStore (i.e. ignore OOB writes).
3300 const Operator* op = 3295 const Operator* op =
3301 jsgraph()->machine()->CheckedStore(type.representation()); 3296 jsgraph()->machine()->CheckedStore(type.representation());
3302 Node* store = graph()->NewNode(op, MemBuffer(0), index, MemSize(0), val, 3297 Node* store = graph()->NewNode(op, MemBuffer(0), index, MemSize(), val,
3303 *effect_, *control_); 3298 *effect_, *control_);
3304 *effect_ = store; 3299 *effect_ = store;
3305 return val; 3300 return val;
3306 } 3301 }
3307 3302
3308 void WasmGraphBuilder::PrintDebugName(Node* node) { 3303 void WasmGraphBuilder::PrintDebugName(Node* node) {
3309 PrintF("#%d:%s", node->id(), node->op()->mnemonic()); 3304 PrintF("#%d:%s", node->id(), node->op()->mnemonic());
3310 } 3305 }
3311 3306
3312 Node* WasmGraphBuilder::String(const char* string) { 3307 Node* WasmGraphBuilder::String(const char* string) {
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
4135 function_->code_end_offset - function_->code_start_offset, 4130 function_->code_end_offset - function_->code_start_offset,
4136 codegen_ms); 4131 codegen_ms);
4137 } 4132 }
4138 4133
4139 return code; 4134 return code;
4140 } 4135 }
4141 4136
4142 } // namespace compiler 4137 } // namespace compiler
4143 } // namespace internal 4138 } // namespace internal
4144 } // namespace v8 4139 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698