From 462d57ae1faa422cad010f2a74b2a7ed94911edf Mon Sep 17 00:00:00 2001 From: mtrofin Date: Mon, 4 Jul 2016 13:08:54 -0700 Subject: [PATCH] [wasm] Fix possible gc-ing of wasm code objects If incremental GC starts before imports linking, and sees a wasm function, it won't revisit that after the imports that function are linked. As a result, the import code objects may be GC-ed. This change addresses this issue. BUG= Review-Url: https://codereview.chromium.org/2113183002 Cr-Commit-Position: refs/heads/master@{#37507} --- src/wasm/wasm-module.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc index 3fcd2232c3..ddc2eba7c8 100644 --- a/src/wasm/wasm-module.cc +++ b/src/wasm/wasm-module.cc @@ -372,7 +372,8 @@ bool LinkFunction(Handle unlinked, Handle new_target = code_targets[index]; if (target != *new_target) { it.rinfo()->set_target_address(new_target->instruction_start(), - SKIP_WRITE_BARRIER, SKIP_ICACHE_FLUSH); + UPDATE_WRITE_BARRIER, + SKIP_ICACHE_FLUSH); modified = true; } }