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/atomic-utils.h" | 7 #include "src/base/atomic-utils.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 | 9 |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 if (!weak_wasm_module->cleared()) { | 533 if (!weak_wasm_module->cleared()) { |
534 JSObject* wasm_module = JSObject::cast(weak_wasm_module->value()); | 534 JSObject* wasm_module = JSObject::cast(weak_wasm_module->value()); |
535 WasmCompiledModule* current_template = | 535 WasmCompiledModule* current_template = |
536 WasmCompiledModule::cast(wasm_module->GetInternalField(0)); | 536 WasmCompiledModule::cast(wasm_module->GetInternalField(0)); |
537 | 537 |
538 TRACE("chain before {\n"); | 538 TRACE("chain before {\n"); |
539 TRACE_CHAIN(current_template); | 539 TRACE_CHAIN(current_template); |
540 TRACE("}\n"); | 540 TRACE("}\n"); |
541 | 541 |
542 DCHECK(!current_template->has_weak_prev_instance()); | 542 DCHECK(!current_template->has_weak_prev_instance()); |
543 WeakCell* next = compiled_module->ptr_to_weak_next_instance(); | 543 WeakCell* next = compiled_module->maybe_ptr_to_weak_next_instance(); |
544 WeakCell* prev = compiled_module->ptr_to_weak_prev_instance(); | 544 WeakCell* prev = compiled_module->maybe_ptr_to_weak_prev_instance(); |
545 | 545 |
546 if (current_template == compiled_module) { | 546 if (current_template == compiled_module) { |
547 if (next == nullptr) { | 547 if (next == nullptr) { |
548 ResetCompiledModule(isolate, owner, compiled_module); | 548 ResetCompiledModule(isolate, owner, compiled_module); |
549 } else { | 549 } else { |
550 DCHECK(next->value()->IsFixedArray()); | 550 DCHECK(next->value()->IsFixedArray()); |
551 wasm_module->SetInternalField(0, next->value()); | 551 wasm_module->SetInternalField(0, next->value()); |
552 DCHECK_NULL(prev); | 552 DCHECK_NULL(prev); |
553 WasmCompiledModule::cast(next->value())->reset_weak_prev_instance(); | 553 WasmCompiledModule::cast(next->value())->reset_weak_prev_instance(); |
554 } | 554 } |
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 MaybeHandle<String> WasmCompiledModule::GetFunctionName( | 2203 MaybeHandle<String> WasmCompiledModule::GetFunctionName( |
2204 Handle<WasmCompiledModule> compiled_module, uint32_t func_index) { | 2204 Handle<WasmCompiledModule> compiled_module, uint32_t func_index) { |
2205 DCHECK_LT(func_index, compiled_module->module()->functions.size()); | 2205 DCHECK_LT(func_index, compiled_module->module()->functions.size()); |
2206 WasmFunction& function = compiled_module->module()->functions[func_index]; | 2206 WasmFunction& function = compiled_module->module()->functions[func_index]; |
2207 Isolate* isolate = compiled_module->GetIsolate(); | 2207 Isolate* isolate = compiled_module->GetIsolate(); |
2208 MaybeHandle<String> string = ExtractStringFromModuleBytes( | 2208 MaybeHandle<String> string = ExtractStringFromModuleBytes( |
2209 isolate, compiled_module, function.name_offset, function.name_length); | 2209 isolate, compiled_module, function.name_offset, function.name_length); |
2210 if (!string.is_null()) return string.ToHandleChecked(); | 2210 if (!string.is_null()) return string.ToHandleChecked(); |
2211 return {}; | 2211 return {}; |
2212 } | 2212 } |
OLD | NEW |