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 mem_start + offset, RelocInfo::WASM_MEMORY_REFERENCE); | 2902 static_cast<uintptr_t>(mem_start + offset), |
| 2903 RelocInfo::WASM_MEMORY_REFERENCE); |
2903 } | 2904 } |
2904 } | 2905 } |
2905 | 2906 |
2906 Node* WasmGraphBuilder::CurrentMemoryPages() { | 2907 Node* WasmGraphBuilder::CurrentMemoryPages() { |
2907 // CurrentMemoryPages can not be called from asm.js. | 2908 // CurrentMemoryPages can not be called from asm.js. |
2908 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); | 2909 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); |
2909 Node* call = | 2910 Node* call = |
2910 BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), centry_stub_node_, | 2911 BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), centry_stub_node_, |
2911 nullptr, 0, effect_, control_); | 2912 nullptr, 0, effect_, control_); |
2912 Node* result = BuildChangeSmiToInt32(call); | 2913 Node* result = BuildChangeSmiToInt32(call); |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4072 wasm::ErrorThrower* thrower, Isolate* isolate, | 4073 wasm::ErrorThrower* thrower, Isolate* isolate, |
4073 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4074 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
4074 WasmCompilationUnit unit(isolate, module_env, function); | 4075 WasmCompilationUnit unit(isolate, module_env, function); |
4075 unit.ExecuteCompilation(); | 4076 unit.ExecuteCompilation(); |
4076 return unit.FinishCompilation(thrower); | 4077 return unit.FinishCompilation(thrower); |
4077 } | 4078 } |
4078 | 4079 |
4079 } // namespace compiler | 4080 } // namespace compiler |
4080 } // namespace internal | 4081 } // namespace internal |
4081 } // namespace v8 | 4082 } // namespace v8 |
OLD | NEW |