Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: src/wasm/wasm-module.cc

Issue 2509053003: [wasm] Refactor interface to WasmCompiledModule (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698