| OLD | NEW |
| 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 "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
| 8 | 8 |
| 9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); | 2314 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); |
| 2315 | 2315 |
| 2316 MergeControlToEnd(jsgraph(), ret); | 2316 MergeControlToEnd(jsgraph(), ret); |
| 2317 } | 2317 } |
| 2318 | 2318 |
| 2319 | 2319 |
| 2320 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { | 2320 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { |
| 2321 DCHECK(module_ && module_->instance); | 2321 DCHECK(module_ && module_->instance); |
| 2322 if (offset == 0) { | 2322 if (offset == 0) { |
| 2323 if (!mem_buffer_) { | 2323 if (!mem_buffer_) { |
| 2324 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( | 2324 mem_buffer_ = jsgraph()->IntPtrConstant( |
| 2325 reinterpret_cast<uintptr_t>(module_->instance->mem_start), | 2325 reinterpret_cast<uintptr_t>(module_->instance->mem_start)); |
| 2326 RelocInfo::WASM_MEMORY_REFERENCE); | |
| 2327 } | 2326 } |
| 2328 return mem_buffer_; | 2327 return mem_buffer_; |
| 2329 } else { | 2328 } else { |
| 2330 return jsgraph()->RelocatableIntPtrConstant( | 2329 return jsgraph()->IntPtrConstant( |
| 2331 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset), | 2330 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset)); |
| 2332 RelocInfo::WASM_MEMORY_REFERENCE); | |
| 2333 } | 2331 } |
| 2334 } | 2332 } |
| 2335 | 2333 |
| 2336 | 2334 |
| 2337 Node* WasmGraphBuilder::MemSize(uint32_t offset) { | 2335 Node* WasmGraphBuilder::MemSize(uint32_t offset) { |
| 2338 DCHECK(module_ && module_->instance); | 2336 DCHECK(module_ && module_->instance); |
| 2339 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); | 2337 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); |
| 2340 if (offset == 0) { | 2338 if (offset == 0) { |
| 2341 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); | 2339 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); |
| 2342 return mem_size_; | 2340 return mem_size_; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2806 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2804 static_cast<int>(function.code_end_offset - function.code_start_offset), |
| 2807 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2805 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
| 2808 } | 2806 } |
| 2809 return code; | 2807 return code; |
| 2810 } | 2808 } |
| 2811 | 2809 |
| 2812 | 2810 |
| 2813 } // namespace compiler | 2811 } // namespace compiler |
| 2814 } // namespace internal | 2812 } // namespace internal |
| 2815 } // namespace v8 | 2813 } // namespace v8 |
| OLD | NEW |