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 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2287 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); | 2287 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); |
2288 | 2288 |
2289 MergeControlToEnd(jsgraph(), ret); | 2289 MergeControlToEnd(jsgraph(), ret); |
2290 } | 2290 } |
2291 | 2291 |
2292 | 2292 |
2293 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { | 2293 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { |
2294 DCHECK(module_ && module_->instance); | 2294 DCHECK(module_ && module_->instance); |
2295 if (offset == 0) { | 2295 if (offset == 0) { |
2296 if (!mem_buffer_) { | 2296 if (!mem_buffer_) { |
2297 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( | 2297 mem_buffer_ = jsgraph()->IntPtrConstant( |
2298 reinterpret_cast<uintptr_t>(module_->instance->mem_start), | 2298 reinterpret_cast<uintptr_t>(module_->instance->mem_start)); |
2299 RelocInfo::WASM_MEMORY_REFERENCE); | |
2300 } | 2299 } |
2301 return mem_buffer_; | 2300 return mem_buffer_; |
2302 } else { | 2301 } else { |
2303 return jsgraph()->RelocatableIntPtrConstant( | 2302 return jsgraph()->IntPtrConstant( |
2304 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset), | 2303 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset)); |
2305 RelocInfo::WASM_MEMORY_REFERENCE); | |
2306 } | 2304 } |
2307 } | 2305 } |
2308 | 2306 |
2309 | 2307 |
2310 Node* WasmGraphBuilder::MemSize(uint32_t offset) { | 2308 Node* WasmGraphBuilder::MemSize(uint32_t offset) { |
2311 DCHECK(module_ && module_->instance); | 2309 DCHECK(module_ && module_->instance); |
2312 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); | 2310 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); |
2313 if (offset == 0) { | 2311 if (offset == 0) { |
2314 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); | 2312 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); |
2315 return mem_size_; | 2313 return mem_size_; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2780 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2778 static_cast<int>(function.code_end_offset - function.code_start_offset), |
2781 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
2782 } | 2780 } |
2783 return code; | 2781 return code; |
2784 } | 2782 } |
2785 | 2783 |
2786 | 2784 |
2787 } // namespace compiler | 2785 } // namespace compiler |
2788 } // namespace internal | 2786 } // namespace internal |
2789 } // namespace v8 | 2787 } // namespace v8 |
OLD | NEW |