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

Unified Diff: src/wasm/wasm-module.cc

Issue 2929853003: Fix use of history timers in background threads. (Closed)
Patch Set: Fix issues with counters on foreground thread. Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 82bb1540adb22423ccb0dcbb3ddb949122095a4e..6778d33f21bbffb02edec1d448078e0cfbc7eaa0 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -745,8 +745,8 @@ Handle<JSArray> wasm::GetCustomSections(Isolate* isolate,
bool wasm::SyncValidate(Isolate* isolate, const ModuleWireBytes& bytes) {
if (bytes.start() == nullptr || bytes.length() == 0) return false;
- ModuleResult result =
- DecodeWasmModule(isolate, bytes.start(), bytes.end(), true, kWasmOrigin);
+ ModuleResult result = SyncDecodeWasmModule(isolate, bytes.start(),
+ bytes.end(), true, kWasmOrigin);
return result.ok();
}
@@ -754,9 +754,8 @@ MaybeHandle<WasmModuleObject> wasm::SyncCompileTranslatedAsmJs(
Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes,
Handle<Script> asm_js_script,
Vector<const byte> asm_js_offset_table_bytes) {
-
- ModuleResult result = DecodeWasmModule(isolate, bytes.start(), bytes.end(),
- false, kAsmJsOrigin);
+ ModuleResult result = SyncDecodeWasmModule(isolate, bytes.start(),
+ bytes.end(), false, kAsmJsOrigin);
if (result.failed()) {
thrower->CompileFailed("Wasm decoding failed", result);
return {};
@@ -778,8 +777,8 @@ MaybeHandle<WasmModuleObject> wasm::SyncCompile(Isolate* isolate,
return {};
}
- ModuleResult result =
- DecodeWasmModule(isolate, bytes.start(), bytes.end(), false, kWasmOrigin);
+ ModuleResult result = SyncDecodeWasmModule(isolate, bytes.start(),
+ bytes.end(), false, kWasmOrigin);
if (result.failed()) {
thrower->CompileFailed("Wasm decoding failed", result);
return {};
@@ -937,8 +936,7 @@ Handle<Code> wasm::CompileLazy(Isolate* isolate) {
}
void LazyCompilationOrchestrator::CompileFunction(
- Isolate* isolate, Handle<WasmInstanceObject> instance, int func_index,
- Counters* counters) {
+ Isolate* isolate, Handle<WasmInstanceObject> instance, int func_index) {
Handle<WasmCompiledModule> compiled_module(instance->compiled_module(),
isolate);
if (Code::cast(compiled_module->code_table()->get(func_index))->kind() ==
@@ -1026,7 +1024,7 @@ void LazyCompilationOrchestrator::CompileFunction(
code_specialization.ApplyToWasmCode(*code, SKIP_ICACHE_FLUSH);
Assembler::FlushICache(isolate, code->instruction_start(),
code->instruction_size());
- RecordLazyCodeStats(*code, counters);
+ RecordLazyCodeStats(*code, isolate->counters());
}
Handle<Code> LazyCompilationOrchestrator::CompileLazy(
@@ -1036,7 +1034,7 @@ Handle<Code> LazyCompilationOrchestrator::CompileLazy(
int offset;
int func_index;
};
- std::shared_ptr<Counters> counters_shared = isolate->counters_shared();
+ const std::shared_ptr<Counters> counters_shared = isolate->counters_shared();
std::vector<NonCompiledFunction> non_compiled_functions;
int func_to_return_idx = exported_func_index;
wasm::Decoder decoder(nullptr, nullptr);
@@ -1081,7 +1079,7 @@ Handle<Code> LazyCompilationOrchestrator::CompileLazy(
// TODO(clemensh): compile all functions in non_compiled_functions in
// background, wait for func_to_return_idx.
- CompileFunction(isolate, instance, func_to_return_idx, counters_shared.get());
+ CompileFunction(isolate, instance, func_to_return_idx);
if (is_js_to_wasm || patch_caller) {
DisallowHeapAllocation no_gc;
« src/wasm/wasm-module.h ('K') | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698