| 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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 case Conversion::kFloat64: | 2880 case Conversion::kFloat64: |
| 2881 ret = BuildChangeTaggedToFloat64(ret); | 2881 ret = BuildChangeTaggedToFloat64(ret); |
| 2882 break; | 2882 break; |
| 2883 default: | 2883 default: |
| 2884 break; | 2884 break; |
| 2885 } | 2885 } |
| 2886 return ret; | 2886 return ret; |
| 2887 } | 2887 } |
| 2888 | 2888 |
| 2889 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { | 2889 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { |
| 2890 MachineType mem_type = module_->GetGlobalType(index); | 2890 MachineType mem_type = |
| 2891 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index)); |
| 2891 Node* addr = jsgraph()->RelocatableIntPtrConstant( | 2892 Node* addr = jsgraph()->RelocatableIntPtrConstant( |
| 2892 reinterpret_cast<uintptr_t>(module_->instance->globals_start + | 2893 reinterpret_cast<uintptr_t>(module_->instance->globals_start + |
| 2893 module_->module->globals[index].offset), | 2894 module_->module->globals[index].offset), |
| 2894 RelocInfo::WASM_GLOBAL_REFERENCE); | 2895 RelocInfo::WASM_GLOBAL_REFERENCE); |
| 2895 const Operator* op = jsgraph()->machine()->Load(mem_type); | 2896 const Operator* op = jsgraph()->machine()->Load(mem_type); |
| 2896 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), *effect_, | 2897 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), *effect_, |
| 2897 *control_); | 2898 *control_); |
| 2898 *effect_ = node; | 2899 *effect_ = node; |
| 2899 return node; | 2900 return node; |
| 2900 } | 2901 } |
| 2901 | 2902 |
| 2902 Node* WasmGraphBuilder::StoreGlobal(uint32_t index, Node* val) { | 2903 Node* WasmGraphBuilder::StoreGlobal(uint32_t index, Node* val) { |
| 2903 MachineType mem_type = module_->GetGlobalType(index); | 2904 MachineType mem_type = |
| 2905 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index)); |
| 2904 Node* addr = jsgraph()->RelocatableIntPtrConstant( | 2906 Node* addr = jsgraph()->RelocatableIntPtrConstant( |
| 2905 reinterpret_cast<uintptr_t>(module_->instance->globals_start + | 2907 reinterpret_cast<uintptr_t>(module_->instance->globals_start + |
| 2906 module_->module->globals[index].offset), | 2908 module_->module->globals[index].offset), |
| 2907 RelocInfo::WASM_GLOBAL_REFERENCE); | 2909 RelocInfo::WASM_GLOBAL_REFERENCE); |
| 2908 const Operator* op = jsgraph()->machine()->Store( | 2910 const Operator* op = jsgraph()->machine()->Store( |
| 2909 StoreRepresentation(mem_type.representation(), kNoWriteBarrier)); | 2911 StoreRepresentation(mem_type.representation(), kNoWriteBarrier)); |
| 2910 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), val, | 2912 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), val, |
| 2911 *effect_, *control_); | 2913 *effect_, *control_); |
| 2912 *effect_ = node; | 2914 *effect_ = node; |
| 2913 return node; | 2915 return node; |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3667 function_->code_start_offset), | 3669 function_->code_start_offset), |
| 3668 compile_ms); | 3670 compile_ms); |
| 3669 } | 3671 } |
| 3670 | 3672 |
| 3671 return code; | 3673 return code; |
| 3672 } | 3674 } |
| 3673 | 3675 |
| 3674 } // namespace compiler | 3676 } // namespace compiler |
| 3675 } // namespace internal | 3677 } // namespace internal |
| 3676 } // namespace v8 | 3678 } // namespace v8 |
| OLD | NEW |