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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/base/atomic-utils.h" | 8 #include "src/base/atomic-utils.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compiler/wasm-compiler.h" | 10 #include "src/compiler/wasm-compiler.h" |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 os << "?"; | 779 os << "?"; |
780 } | 780 } |
781 return os; | 781 return os; |
782 } | 782 } |
783 | 783 |
784 WasmInstanceObject* wasm::GetOwningWasmInstance(Code* code) { | 784 WasmInstanceObject* wasm::GetOwningWasmInstance(Code* code) { |
785 DCHECK(code->kind() == Code::WASM_FUNCTION); | 785 DCHECK(code->kind() == Code::WASM_FUNCTION); |
786 DisallowHeapAllocation no_gc; | 786 DisallowHeapAllocation no_gc; |
787 FixedArray* deopt_data = code->deoptimization_data(); | 787 FixedArray* deopt_data = code->deoptimization_data(); |
788 DCHECK_NOT_NULL(deopt_data); | 788 DCHECK_NOT_NULL(deopt_data); |
789 DCHECK(deopt_data->length() == 2); | 789 DCHECK_EQ(2, deopt_data->length()); |
790 Object* weak_link = deopt_data->get(0); | 790 Object* weak_link = deopt_data->get(0); |
791 DCHECK(weak_link->IsWeakCell()); | 791 DCHECK(weak_link->IsWeakCell()); |
792 WeakCell* cell = WeakCell::cast(weak_link); | 792 WeakCell* cell = WeakCell::cast(weak_link); |
793 if (!cell->value()) return nullptr; | 793 if (!cell->value()) return nullptr; |
794 return WasmInstanceObject::cast(cell->value()); | 794 return WasmInstanceObject::cast(cell->value()); |
795 } | 795 } |
796 | 796 |
797 int wasm::GetFunctionCodeOffset(Handle<WasmCompiledModule> compiled_module, | 797 int wasm::GetFunctionCodeOffset(Handle<WasmCompiledModule> compiled_module, |
798 int func_index) { | 798 int func_index) { |
799 return GetFunctionOffsetAndLength(compiled_module, func_index).first; | 799 return GetFunctionOffsetAndLength(compiled_module, func_index).first; |
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 CHECK(!compiled_module->has_weak_owning_instance()); | 2308 CHECK(!compiled_module->has_weak_owning_instance()); |
2309 } | 2309 } |
2310 | 2310 |
2311 void testing::ValidateOrphanedInstance(Isolate* isolate, | 2311 void testing::ValidateOrphanedInstance(Isolate* isolate, |
2312 Handle<WasmInstanceObject> instance) { | 2312 Handle<WasmInstanceObject> instance) { |
2313 DisallowHeapAllocation no_gc; | 2313 DisallowHeapAllocation no_gc; |
2314 WasmCompiledModule* compiled_module = instance->get_compiled_module(); | 2314 WasmCompiledModule* compiled_module = instance->get_compiled_module(); |
2315 CHECK(compiled_module->has_weak_wasm_module()); | 2315 CHECK(compiled_module->has_weak_wasm_module()); |
2316 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared()); | 2316 CHECK(compiled_module->ptr_to_weak_wasm_module()->cleared()); |
2317 } | 2317 } |
OLD | NEW |