Commit 8c0b9b3b authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm-gc][asm-js] Consider gc disabled for asm-js modules

An asm-js module has all wasm feature flags disabled, despite the global
flag configuration. Therefore, in WasmExportedFunction::New, we should
retrieve the enabled features from the NativeModule instead of the
flags.

Bug: chromium:1279151
Change-Id: Ic44fe535baa7cb851644457cce533c24d4c9824e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3338256Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78368}
parent 52407c55
......@@ -1920,7 +1920,9 @@ Handle<WasmExportedFunction> WasmExportedFunction::New(
const wasm::FunctionSig* sig = instance->module()->functions[func_index].sig;
Address call_target = instance->GetCallTarget(func_index);
Handle<Map> rtt;
if (FLAG_experimental_wasm_gc) {
bool has_gc =
instance->module_object().native_module()->enabled_features().has_gc();
if (has_gc) {
int sig_index = instance->module()->functions[func_index].sig_index;
// TODO(7748): Create funcref RTTs lazily?
rtt = handle(Map::cast(instance->managed_object_maps().get(sig_index)),
......
// Copyright 2021 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: --experimental-wasm-gc
// --experimental-wasm-gc should not affect asm-js modules.
function NewModule() {
"use asm";
function foo() {}
return {foo:foo};
};
var v = NewModule();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment