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

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

Issue 2403093002: [wasm] Canonicalize function signature indices for matching in indirect calls. (Closed)
Patch Set: Add TODO for myself 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
« no previous file with comments | « src/api.cc ('k') | src/v8.gyp » ('j') | src/wasm/signature-map.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 3308d4393d001b0fbfd6c72e45ac4e32c730d1f9..dc23e0d2bf866f5de4c9aa14f8a9687aae62f6b2 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2148,9 +2148,11 @@ Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, Node*** rets,
Int32Constant(kPointerSizeLog2)),
Int32Constant(fixed_offset)),
*effect_, *control_);
+ int32_t key = module_->module->function_tables[0].map_.Find(sig);
+ DCHECK_GE(key, 0);
Node* sig_match =
graph()->NewNode(machine->Word32Equal(),
- BuildChangeSmiToInt32(load_sig), Int32Constant(index));
+ BuildChangeSmiToInt32(load_sig), Int32Constant(key));
trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position);
}
« no previous file with comments | « src/api.cc ('k') | src/v8.gyp » ('j') | src/wasm/signature-map.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698