| 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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 uintptr_t mem_start = reinterpret_cast<uintptr_t>( | 2880 uintptr_t mem_start = reinterpret_cast<uintptr_t>( |
| 2881 module_->instance ? module_->instance->mem_start : nullptr); | 2881 module_->instance ? module_->instance->mem_start : nullptr); |
| 2882 if (offset == 0) { | 2882 if (offset == 0) { |
| 2883 if (!mem_buffer_) { | 2883 if (!mem_buffer_) { |
| 2884 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( | 2884 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant( |
| 2885 mem_start, RelocInfo::WASM_MEMORY_REFERENCE); | 2885 mem_start, RelocInfo::WASM_MEMORY_REFERENCE); |
| 2886 } | 2886 } |
| 2887 return mem_buffer_; | 2887 return mem_buffer_; |
| 2888 } else { | 2888 } else { |
| 2889 return jsgraph()->RelocatableIntPtrConstant( | 2889 return jsgraph()->RelocatableIntPtrConstant( |
| 2890 mem_start + offset, RelocInfo::WASM_MEMORY_REFERENCE); | 2890 static_cast<uintptr_t>(mem_start + offset), |
| 2891 RelocInfo::WASM_MEMORY_REFERENCE); |
| 2891 } | 2892 } |
| 2892 } | 2893 } |
| 2893 | 2894 |
| 2894 Node* WasmGraphBuilder::CurrentMemoryPages() { | 2895 Node* WasmGraphBuilder::CurrentMemoryPages() { |
| 2895 // CurrentMemoryPages can not be called from asm.js. | 2896 // CurrentMemoryPages can not be called from asm.js. |
| 2896 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); | 2897 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin()); |
| 2897 Node* call = BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), nullptr, | 2898 Node* call = BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), nullptr, |
| 2898 0, effect_, control_); | 2899 0, effect_, control_); |
| 2899 Node* result = BuildChangeSmiToInt32(call); | 2900 Node* result = BuildChangeSmiToInt32(call); |
| 2900 return result; | 2901 return result; |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.InitializeHandles(); | 4076 unit.InitializeHandles(); |
| 4076 unit.ExecuteCompilation(); | 4077 unit.ExecuteCompilation(); |
| 4077 return unit.FinishCompilation(thrower); | 4078 return unit.FinishCompilation(thrower); |
| 4078 } | 4079 } |
| 4079 | 4080 |
| 4080 } // namespace compiler | 4081 } // namespace compiler |
| 4081 } // namespace internal | 4082 } // namespace internal |
| 4082 } // namespace v8 | 4083 } // namespace v8 |
| OLD | NEW |