| 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 <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 2881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2892 uintptr_t mem_start = reinterpret_cast<uintptr_t>( | 2892 uintptr_t mem_start = reinterpret_cast<uintptr_t>( |
| 2893 module_->instance ? module_->instance->mem_start : nullptr); | 2893 module_->instance ? module_->instance->mem_start : nullptr); |
| 2894 if (offset == 0) { | 2894 if (offset == 0) { |
| 2895 if (!mem_buffer_) { | 2895 if (!mem_buffer_) { |
| 2896 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( | 2896 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( |
| 2897 mem_start, RelocInfo::WASM_MEMORY_REFERENCE); | 2897 mem_start, RelocInfo::WASM_MEMORY_REFERENCE); |
| 2898 } | 2898 } |
| 2899 return mem_buffer_; | 2899 return mem_buffer_; |
| 2900 } else { | 2900 } else { |
| 2901 return jsgraph()->RelocatableIntPtrConstant( | 2901 return jsgraph()->RelocatableIntPtrConstant( |
| 2902 static_cast<uintptr_t>(mem_start + offset), | 2902 mem_start + offset, RelocInfo::WASM_MEMORY_REFERENCE); |
| 2903 RelocInfo::WASM_MEMORY_REFERENCE); | |
| 2904 } | 2903 } |
| 2905 } | 2904 } |
| 2906 | 2905 |
| 2907 Node* WasmGraphBuilder::CurrentMemoryPages() { | 2906 Node* WasmGraphBuilder::CurrentMemoryPages() { |
| 2908 // CurrentMemoryPages can not be called from asm.js. | 2907 // CurrentMemoryPages can not be called from asm.js. |
| 2909 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); | 2908 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); |
| 2910 Node* call = | 2909 Node* call = |
| 2911 BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), centry_stub_node_, | 2910 BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), centry_stub_node_, |
| 2912 nullptr, 0, effect_, control_); | 2911 nullptr, 0, effect_, control_); |
| 2913 Node* result = BuildChangeSmiToInt32(call); | 2912 Node* result = BuildChangeSmiToInt32(call); |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4084 wasm::ErrorThrower* thrower, Isolate* isolate, | 4083 wasm::ErrorThrower* thrower, Isolate* isolate, |
| 4085 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4084 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
| 4086 WasmCompilationUnit unit(isolate, module_env, function); | 4085 WasmCompilationUnit unit(isolate, module_env, function); |
| 4087 unit.ExecuteCompilation(); | 4086 unit.ExecuteCompilation(); |
| 4088 return unit.FinishCompilation(thrower); | 4087 return unit.FinishCompilation(thrower); |
| 4089 } | 4088 } |
| 4090 | 4089 |
| 4091 } // namespace compiler | 4090 } // namespace compiler |
| 4092 } // namespace internal | 4091 } // namespace internal |
| 4093 } // namespace v8 | 4092 } // namespace v8 |
| OLD | NEW |