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

Unified Diff: src/wasm/module-compiler.h

Issue 2929853003: Fix use of history timers in background threads. (Closed)
Patch Set: Merge with master. 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/module-compiler.h
diff --git a/src/wasm/module-compiler.h b/src/wasm/module-compiler.h
index 4f496c50e956655bf4fb77d78c0d459e2b698bee..2d66cb15b120bb08dcfa9736b99b4bf2144d0a5c 100644
--- a/src/wasm/module-compiler.h
+++ b/src/wasm/module-compiler.h
@@ -59,8 +59,7 @@ class ModuleCompiler {
Isolate* isolate_;
std::unique_ptr<WasmModule> module_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
bool is_sync_;
std::vector<std::unique_ptr<compiler::WasmCompilationUnit>>
compilation_units_;
@@ -71,6 +70,8 @@ class ModuleCompiler {
// This flag should only be set while holding result_mutex_.
bool finisher_is_running_ = false;
+ Counters* counters() const { return counters_shared_.get(); }
+
// Run by each compilation task and by the main thread. The
// no_finisher_callback is called within the result_mutex_ lock when no
// finishing task is running, i.e. when the finisher_is_running_ flag is not
@@ -156,8 +157,7 @@ class InstanceBuilder {
Isolate* isolate_;
WasmModule* const module_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
ErrorThrower* thrower_;
Handle<WasmModuleObject> module_object_;
Handle<JSReceiver> ffi_; // TODO(titzer): Use MaybeHandle
@@ -169,6 +169,8 @@ class InstanceBuilder {
JSToWasmWrapperCache js_to_wasm_cache_;
WeakCallbackInfo<void>::Callback instance_finalizer_callback_;
+ Counters* counters() const { return counters_shared_.get(); }
+
// Helper routines to print out errors with imports.
#define ERROR_THROWER_WITH_MESSAGE(TYPE) \
void Report##TYPE(const char* error, uint32_t index, \
@@ -260,8 +262,7 @@ class AsyncCompileJob {
private:
Isolate* isolate_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
std::unique_ptr<byte[]> bytes_copy_;
ModuleWireBytes wire_bytes_;
Handle<Context> context_;
@@ -280,6 +281,8 @@ class AsyncCompileJob {
size_t outstanding_units_ = 0;
size_t num_background_tasks_ = 0;
+ Counters* counters() const { return counters_shared_.get(); }
+
void ReopenHandlesInDeferredScope();
void AsyncCompileFailed(ErrorThrower& thrower);
« src/isolate.h ('K') | « src/isolate.h ('k') | src/wasm/module-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698