Commit b721e157 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Remove the --experimental-wasm-bigint flag

The flag was enabled by default in M85, it is time to remove it.

R=clemensb@chromium.org

Bug: v8:7741, chromium:1160677
Change-Id: Ic4a9490efa645a7466cb844484169ab262f0df38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2610965Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71945}
parent 7fa695a2
......@@ -6222,7 +6222,6 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
case wasm::ValueType::kS128:
UNREACHABLE();
case wasm::ValueType::kI64: {
DCHECK(enabled_features_.has_bigint());
return BuildChangeInt64ToBigInt(node);
}
case wasm::ValueType::kF32:
......@@ -6412,7 +6411,6 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
case wasm::ValueType::kI64:
// i64 values can only come from BigInt.
DCHECK(enabled_features_.has_bigint());
return BuildChangeBigIntToInt64(input, js_context);
case wasm::ValueType::kRtt: // TODO(7748): Implement.
......
......@@ -256,7 +256,6 @@ void Engine::operator delete(void* p) { ::operator delete(p); }
auto Engine::make(own<Config>&& config) -> own<Engine> {
i::FLAG_expose_gc = true;
i::FLAG_experimental_wasm_reftypes = true;
i::FLAG_experimental_wasm_bigint = true;
i::FLAG_experimental_wasm_mv = true;
auto engine = new (std::nothrow) EngineImpl;
if (!engine) return own<Engine>();
......
......@@ -1344,18 +1344,6 @@ bool InstanceBuilder::ProcessImportedGlobal(Handle<WasmInstanceObject> instance,
// global in the {imported_mutable_globals_} array.
const WasmGlobal& global = module_->globals[global_index];
// The mutable-global proposal allows importing i64 values, but only if
// they are passed as a WebAssembly.Global object.
//
// However, the bigint proposal allows importing constant i64 values,
// as non WebAssembly.Global object.
if (global.type == kWasmI64 && !enabled_.has_bigint() &&
!value->IsWasmGlobalObject()) {
ReportLinkError("global import cannot have type i64", import_index,
module_name, import_name);
return false;
}
// SIMD proposal allows modules to define an imported v128 global, and only
// supports importing a WebAssembly.Global object for this global, but also
// defines constructing a WebAssembly.Global of v128 to be a TypeError.
......@@ -1413,7 +1401,7 @@ bool InstanceBuilder::ProcessImportedGlobal(Handle<WasmInstanceObject> instance,
return true;
}
if (enabled_.has_bigint() && global.type == kWasmI64 && value->IsBigInt()) {
if (global.type == kWasmI64 && value->IsBigInt()) {
WriteGlobalValue(global, BigInt::cast(*value).AsInt64());
return true;
}
......
......@@ -80,14 +80,6 @@
// Shipped features (enabled by default). Remove the feature flag once they hit
// stable and are expected to stay enabled.
#define FOREACH_WASM_SHIPPED_FEATURE_FLAG(V) /* (force 80 columns) */ \
/* JS BigInt to wasm i64 integration. */ \
/* https://github.com/WebAssembly/JS-BigInt-integration */ \
/* V8 side owner: ahaas, ssauleau@igalia.com */ \
/* Shipped in v8.5. */ \
/* ITS: https://groups.google.com/a/chromium.org/g/blink-dev/c/ */ \
/* g4QKRUQV1-0/m/jdWjD1uZAAAJ */ \
V(bigint, "JS BigInt support", true) \
\
/* Bulk memory operations. */ \
/* https://github.com/webassembly/bulk-memory-operations */ \
/* V8 side owner: binji */ \
......
......@@ -1312,11 +1312,6 @@ void WebAssemblyGlobal(const v8::FunctionCallbackInfo<v8::Value>& args) {
case i::wasm::ValueType::kI64: {
int64_t i64_value = 0;
if (!value->IsUndefined()) {
if (!enabled_features.has_bigint()) {
thrower.TypeError("Can't set the value of i64 WebAssembly.Global");
return;
}
v8::Local<v8::BigInt> bigint_value;
if (!value->ToBigInt(context).ToLocal(&bigint_value)) return;
i64_value = bigint_value->Int64Value();
......@@ -1827,13 +1822,8 @@ void WebAssemblyGlobalGetValueCommon(
return_value.Set(receiver->GetI32());
break;
case i::wasm::ValueType::kI64: {
auto enabled_features = i::wasm::WasmFeatures::FromIsolate(i_isolate);
if (enabled_features.has_bigint()) {
Local<BigInt> value = BigInt::New(isolate, receiver->GetI64());
return_value.Set(value);
} else {
thrower.TypeError("Can't get the value of i64 WebAssembly.Global");
}
Local<BigInt> value = BigInt::New(isolate, receiver->GetI64());
return_value.Set(value);
break;
}
case i::wasm::ValueType::kF32:
......@@ -1910,14 +1900,9 @@ void WebAssemblyGlobalSetValue(
break;
}
case i::wasm::ValueType::kI64: {
auto enabled_features = i::wasm::WasmFeatures::FromIsolate(i_isolate);
if (enabled_features.has_bigint()) {
v8::Local<v8::BigInt> bigint_value;
if (!args[0]->ToBigInt(context).ToLocal(&bigint_value)) return;
receiver->SetI64(bigint_value->Int64Value());
} else {
thrower.TypeError("Can't set the value of i64 WebAssembly.Global");
}
v8::Local<v8::BigInt> bigint_value;
if (!args[0]->ToBigInt(context).ToLocal(&bigint_value)) return;
receiver->SetI64(bigint_value->Int64Value());
break;
}
case i::wasm::ValueType::kF32: {
......
......@@ -41,8 +41,7 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmModule* module,
for (auto type : sig->all()) {
// TODO(7748): Allow structs, arrays, rtts and i31s when their
// JS-interaction is decided on.
if ((type == kWasmI64 && !enabled_features.has_bigint()) ||
type == kWasmS128 || type.is_reference_to(HeapType::kI31) ||
if (type == kWasmS128 || type.is_reference_to(HeapType::kI31) ||
(type.has_index() && !module->has_signature(type.ref_index())) ||
type.is_rtt()) {
return false;
......
......@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-experimental-wasm-bigint
// Flags: --experimental-wasm-simd
load('test/mjsunit/wasm/wasm-module-builder.js');
let kSig_s_v = makeSig([], [kWasmS128]);
// Generate a re-exported function that wraps a JavaScript callable, but with a
// function signature that is incompatible (i.e. i64 return type) with JS.
// function signature that is incompatible (i.e. simd return type) with JS.
var fun1 = (function GenerateFun1() {
let builder = new WasmModuleBuilder();
function fun() { return 0 }
let fun_index = builder.addImport("m", "fun", kSig_l_v)
let fun_index = builder.addImport('m', 'fun', kSig_s_v)
builder.addExport("fun", fun_index);
let instance = builder.instantiate({ m: { fun: fun }});
return instance.exports.fun;
......@@ -21,7 +22,7 @@ var fun1 = (function GenerateFun1() {
// module, still with a function signature that is incompatible with JS.
var fun2 = (function GenerateFun2() {
let builder = new WasmModuleBuilder();
let fun_index = builder.addImport("m", "fun", kSig_l_v)
let fun_index = builder.addImport("m", "fun", kSig_s_v)
builder.addFunction('main', kSig_v_v)
.addBody([
kExprCallFunction, fun_index,
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --experimental-wasm-bigint
load("test/mjsunit/wasm/wasm-module-builder.js");
(function TestWasmI64ToJSBigIntImportedFunc() {
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --experimental-wasm-bigint
load("test/mjsunit/wasm/wasm-module-builder.js");
(function TestWasmI64ToJSBigInt() {
......
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