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

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

Issue 2424623002: [wasm] Use a Managed<WasmModule> to hold metadata about modules. (Closed)
Patch Set: Review comments Created 4 years, 2 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/signature-map.cc
diff --git a/src/wasm/signature-map.cc b/src/wasm/signature-map.cc
index e7f8b2fc94d16d66caad53f8778f3e0e7836da24..ef20fac08aec7fb40435b02f8fcbee3261a78d47 100644
--- a/src/wasm/signature-map.cc
+++ b/src/wasm/signature-map.cc
@@ -46,6 +46,18 @@ bool SignatureMap::CompareFunctionSigs::operator()(FunctionSig* a,
return false;
}
+bool SignatureMap::Equal(FunctionSig* a, FunctionSig* b) {
+ if (a->parameter_count() != b->parameter_count()) return false;
+ if (a->return_count() != b->return_count()) return false;
+ for (size_t i = 0; i < a->parameter_count(); i++) {
Mircea Trofin 2016/10/19 05:28:55 This bottom part could be done blindly wrt what's
titzer 2016/10/19 09:54:41 Done.
+ if (a->GetParam(i) != b->GetParam(i)) return false;
+ }
+ for (size_t i = 0; i < a->return_count(); i++) {
+ if (a->GetReturn(i) != b->GetReturn(i)) return false;
+ }
+ return true;
+}
+
} // namespace wasm
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698