mirrored from https://chromium.googlesource.com/v8/v8.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm][gc] Scan the code field of the WasmInternalFunction
The code field in the WasmInternalFunction is a code pointer since https://crrev.com/c/5110559, so it has to be scanned explicitly. Bug: 329130358 Change-Id: Ifc7a7cddb245e46fb9c006e560073a8d7ac65389 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5374907 Commit-Queue: Andreas Haas <ahaas@chromium.org> Reviewed-by: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#92878}
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2024 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// Flags: --expose-gc --wasm-wrapper-tiering-budget=1 --experimental-wasm-type-reflection | ||
|
||
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); | ||
|
||
const builder = new WasmModuleBuilder(); | ||
const type = builder.addType(kSig_i_i); | ||
const global = builder.addImportedGlobal('m', 'val', kWasmAnyFunc); | ||
|
||
builder.addFunction('main', type) | ||
.addBody([ | ||
kExprLocalGet, 0, kExprGlobalGet, global, kGCPrefix, kExprRefCast, type, | ||
kExprCallRef, type | ||
]) | ||
.exportFunc(); | ||
|
||
function foo() { | ||
gc(); | ||
} | ||
const func = | ||
new WebAssembly.Function({parameters: ['i32'], results: ['i32']}, foo); | ||
|
||
let instance = builder.instantiate({m: {val: func}}); | ||
instance.exports.main(3); | ||
instance.exports.main(3); |