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

Unified Diff: src/wasm/signature-map.cc

Issue 2981883002: [wasm] More extensive indirect dispatch signature mismatch tests. (Closed)
Patch Set: Shorter constructor Created 3 years, 5 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
« no previous file with comments | « src/wasm/signature-map.h ('k') | test/mjsunit/wasm/indirect-sig-mismatch.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/signature-map.cc
diff --git a/src/wasm/signature-map.cc b/src/wasm/signature-map.cc
index e7f8b2fc94d16d66caad53f8778f3e0e7836da24..e7ee4eba4e21361977a0f363990c219e441a2af5 100644
--- a/src/wasm/signature-map.cc
+++ b/src/wasm/signature-map.cc
@@ -8,7 +8,10 @@ namespace v8 {
namespace internal {
namespace wasm {
+SignatureMap::SignatureMap() : mutex_(new base::Mutex()) {}
+
uint32_t SignatureMap::FindOrInsert(FunctionSig* sig) {
+ base::LockGuard<base::Mutex> guard(mutex_.get());
auto pos = map_.find(sig);
if (pos != map_.end()) {
return pos->second;
@@ -20,6 +23,7 @@ uint32_t SignatureMap::FindOrInsert(FunctionSig* sig) {
}
int32_t SignatureMap::Find(FunctionSig* sig) const {
+ base::LockGuard<base::Mutex> guard(mutex_.get());
auto pos = map_.find(sig);
if (pos != map_.end()) {
return static_cast<int32_t>(pos->second);
« no previous file with comments | « src/wasm/signature-map.h ('k') | test/mjsunit/wasm/indirect-sig-mismatch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698