[dart2wasm] Switch to final GC encodings & Roll Chrome 119 + D8

Change-Id: If63a5b3caa8fe300d97a722c3d42929457bae1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326300
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
This commit is contained in:
Jackson Gardner 2023-10-13 17:09:19 +00:00 committed by Commit Queue
parent 8ea74c0f2e
commit 13a425d941
5 changed files with 55 additions and 58 deletions

4
DEPS
View file

@ -71,7 +71,7 @@ vars = {
# Checkout extra javascript engines for testing or benchmarking.
# d8, the V8 shell, is always checked out.
"checkout_javascript_engines": False,
"d8_tag": "version:11.9.79",
"d8_tag": "version:11.9.95",
"jsshell_tag": "version:95.0",
# As Flutter does, we use Fuchsia's GN and Clang toolchain. These revision
@ -205,7 +205,7 @@ vars = {
# Pinned browser versions used by the testing infrastructure. These are not
# meant to be downloaded by users for local testing.
"download_chrome": False,
"chrome_tag": "118.0.5993.70",
"chrome_tag": "119.0.6045.9", # Beta version with WasmGC final encodings.
"download_firefox": False,
"firefox_tag": "112.0.2",

View file

@ -570,7 +570,7 @@ class RefFunc implements Instruction {
}
class RefAsNonNull extends SingleByteInstruction {
const RefAsNonNull() : super(0xD3);
const RefAsNonNull() : super(0xD4);
}
class BrOnNull implements Instruction {
@ -580,13 +580,13 @@ class BrOnNull implements Instruction {
@override
void serialize(Serializer s) {
s.writeByte(0xD4);
s.writeByte(0xD5);
s.writeUnsigned(labelIndex);
}
}
class RefEq extends SingleByteInstruction {
const RefEq() : super(0xD5);
const RefEq() : super(0xD3);
}
class BrOnNonNull implements Instruction {
@ -609,7 +609,7 @@ class StructGet implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x03]);
s.writeBytes(const [0xFB, 0x02]);
s.writeUnsigned(structType.index);
s.writeUnsigned(fieldIndex);
}
@ -623,7 +623,7 @@ class StructGetS implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x04]);
s.writeBytes(const [0xFB, 0x03]);
s.writeUnsigned(structType.index);
s.writeUnsigned(fieldIndex);
}
@ -637,7 +637,7 @@ class StructGetU implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x05]);
s.writeBytes(const [0xFB, 0x04]);
s.writeUnsigned(structType.index);
s.writeUnsigned(fieldIndex);
}
@ -651,7 +651,7 @@ class StructSet implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x06]);
s.writeBytes(const [0xFB, 0x05]);
s.writeUnsigned(structType.index);
s.writeUnsigned(fieldIndex);
}
@ -664,7 +664,7 @@ class StructNew implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x07]);
s.writeBytes(const [0xFB, 0x00]);
s.writeUnsigned(structType.index);
}
}
@ -676,7 +676,7 @@ class StructNewDefault implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x08]);
s.writeBytes(const [0xFB, 0x01]);
s.writeUnsigned(structType.index);
}
}
@ -688,7 +688,7 @@ class ArrayGet implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x13]);
s.writeBytes(const [0xFB, 0x0b]);
s.writeUnsigned(arrayType.index);
}
}
@ -700,7 +700,7 @@ class ArrayGetS implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x14]);
s.writeBytes(const [0xFB, 0x0c]);
s.writeUnsigned(arrayType.index);
}
}
@ -712,7 +712,7 @@ class ArrayGetU implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x15]);
s.writeBytes(const [0xFB, 0x0d]);
s.writeUnsigned(arrayType.index);
}
}
@ -724,13 +724,13 @@ class ArraySet implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x16]);
s.writeBytes(const [0xFB, 0x0E]);
s.writeUnsigned(arrayType.index);
}
}
class ArrayLen extends MultiByteInstruction {
const ArrayLen() : super(const [0xFB, 0x19]);
const ArrayLen() : super(const [0xFB, 0x0F]);
}
class ArrayNewFixed implements Instruction {
@ -741,7 +741,7 @@ class ArrayNewFixed implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x1a]);
s.writeBytes(const [0xFB, 0x08]);
s.writeUnsigned(arrayType.index);
s.writeUnsigned(length);
}
@ -754,7 +754,7 @@ class ArrayNew implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x1b]);
s.writeBytes(const [0xFB, 0x06]);
s.writeUnsigned(arrayType.index);
}
}
@ -766,7 +766,7 @@ class ArrayNewDefault implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x1c]);
s.writeBytes(const [0xFB, 0x07]);
s.writeUnsigned(arrayType.index);
}
}
@ -779,7 +779,7 @@ class ArrayNewData implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x1d]);
s.writeBytes(const [0xFB, 0x09]);
s.writeUnsigned(arrayType.index);
s.writeUnsigned(data.index);
}
@ -793,7 +793,7 @@ class ArrayCopy implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x18]);
s.writeBytes(const [0xFB, 0x11]);
s.writeUnsigned(destArrayType.index);
s.writeUnsigned(sourceArrayType.index);
}
@ -806,21 +806,21 @@ class ArrayFill implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(const [0xFB, 0x0F]);
s.writeBytes(const [0xFB, 0x10]);
s.writeUnsigned(arrayType.index);
}
}
class I31New extends MultiByteInstruction {
const I31New() : super(const [0xFB, 0x20]);
const I31New() : super(const [0xFB, 0x1C]);
}
class I31GetS extends MultiByteInstruction {
const I31GetS() : super(const [0xFB, 0x21]);
const I31GetS() : super(const [0xFB, 0x1D]);
}
class I31GetU extends MultiByteInstruction {
const I31GetU() : super(const [0xFB, 0x22]);
const I31GetU() : super(const [0xFB, 0x1E]);
}
class RefTest implements Instruction {
@ -830,7 +830,7 @@ class RefTest implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(targetType.nullable ? const [0xFB, 0x48] : const [0xFB, 0x40]);
s.writeBytes(targetType.nullable ? const [0xFB, 0x15] : const [0xFB, 0x14]);
s.write(targetType.heapType);
}
}
@ -842,7 +842,7 @@ class RefCast implements Instruction {
@override
void serialize(Serializer s) {
s.writeBytes(targetType.nullable ? const [0xFB, 0x49] : const [0xFB, 0x41]);
s.writeBytes(targetType.nullable ? const [0xFB, 0x17] : const [0xFB, 0x16]);
s.write(targetType.heapType);
}
}
@ -858,7 +858,7 @@ class BrOnCast implements Instruction {
void serialize(Serializer s) {
int flags = (inputType.nullable ? 0x01 : 0x00) |
(targetType.nullable ? 0x02 : 0x00);
s.writeBytes(const [0xFB, 0x4E]);
s.writeBytes(const [0xFB, 0x18]);
s.writeByte(flags);
s.writeUnsigned(labelIndex);
s.write(inputType.heapType);
@ -877,7 +877,7 @@ class BrOnCastFail implements Instruction {
void serialize(Serializer s) {
int flags = (inputType.nullable ? 0x01 : 0x00) |
(targetType.nullable ? 0x02 : 0x00);
s.writeBytes(const [0xFB, 0x4F]);
s.writeBytes(const [0xFB, 0x19]);
s.writeByte(flags);
s.writeUnsigned(labelIndex);
s.write(inputType.heapType);
@ -886,11 +886,11 @@ class BrOnCastFail implements Instruction {
}
class ExternInternalize extends MultiByteInstruction {
const ExternInternalize() : super(const [0xFB, 0x70]);
const ExternInternalize() : super(const [0xFB, 0x1A]);
}
class ExternExternalize extends MultiByteInstruction {
const ExternExternalize() : super(const [0xFB, 0x71]);
const ExternExternalize() : super(const [0xFB, 0x1B]);
}
class I32Const implements Instruction {

View file

@ -94,19 +94,19 @@ class NumType extends ValueType {
void serialize(Serializer s) {
switch (kind) {
case NumTypeKind.i32:
s.writeByte(0x7F);
s.writeByte(0x7F); // -0x01
break;
case NumTypeKind.i64:
s.writeByte(0x7E);
s.writeByte(0x7E); // -0x02
break;
case NumTypeKind.f32:
s.writeByte(0x7D);
s.writeByte(0x7D); // -0x03
break;
case NumTypeKind.f64:
s.writeByte(0x7C);
s.writeByte(0x7C); // -0x04
break;
case NumTypeKind.v128:
s.writeByte(0x7B);
s.writeByte(0x7B); // -0x05
break;
}
}
@ -206,7 +206,7 @@ class RefType extends ValueType {
@override
void serialize(Serializer s) {
if (nullable != heapType.nullableByDefault) {
s.writeByte(nullable ? 0x6C : 0x6B);
s.writeByte(nullable ? 0x63 : 0x64); // -0x1d, -0x1c
}
s.write(heapType);
}
@ -334,7 +334,7 @@ class ExternHeapType extends HeapType {
other == HeapType.common || other == HeapType.extern;
@override
void serialize(Serializer s) => s.writeByte(0x6F);
void serialize(Serializer s) => s.writeByte(0x6F); // -0x11
@override
String toString() => "extern";
@ -360,7 +360,7 @@ class AnyHeapType extends HeapType {
other == HeapType.common || other == HeapType.any;
@override
void serialize(Serializer s) => s.writeByte(0x6E);
void serialize(Serializer s) => s.writeByte(0x6E); // -0x12
@override
String toString() => "any";
@ -386,7 +386,7 @@ class EqHeapType extends HeapType {
other == HeapType.common || other == HeapType.any || other == HeapType.eq;
@override
void serialize(Serializer s) => s.writeByte(0x6D);
void serialize(Serializer s) => s.writeByte(0x6D); // -0x13
@override
String toString() => "eq";
@ -412,7 +412,7 @@ class FuncHeapType extends HeapType {
other == HeapType.common || other == HeapType.func;
@override
void serialize(Serializer s) => s.writeByte(0x70);
void serialize(Serializer s) => s.writeByte(0x70); // -0x10
@override
String toString() => "func";
@ -441,7 +441,7 @@ class StructHeapType extends HeapType {
other == HeapType.struct;
@override
void serialize(Serializer s) => s.writeByte(0x67);
void serialize(Serializer s) => s.writeByte(0x6B); // -0x15
@override
String toString() => "struct";
@ -470,7 +470,7 @@ class ArrayHeapType extends HeapType {
other == HeapType.array;
@override
void serialize(Serializer s) => s.writeByte(0x66);
void serialize(Serializer s) => s.writeByte(0x6A); // -0x16
@override
String toString() => "array";
@ -499,7 +499,7 @@ class I31HeapType extends HeapType {
other == HeapType.i31;
@override
void serialize(Serializer s) => s.writeByte(0x6A);
void serialize(Serializer s) => s.writeByte(0x6C); // -0x14
@override
String toString() => "i31";
@ -525,7 +525,7 @@ class NoneHeapType extends HeapType {
other == HeapType.common || other.bottomType == HeapType.none;
@override
void serialize(Serializer s) => s.writeByte(0x65);
void serialize(Serializer s) => s.writeByte(0x71); // -0x0f
@override
String toString() => "none";
@ -554,7 +554,7 @@ class NoExternHeapType extends HeapType {
other == HeapType.common || other.bottomType == HeapType.noextern;
@override
void serialize(Serializer s) => s.writeByte(0x69);
void serialize(Serializer s) => s.writeByte(0x72); // -0x0e
@override
String toString() => "extern";
@ -583,7 +583,7 @@ class NoFuncHeapType extends HeapType {
other == HeapType.common || other.bottomType == HeapType.nofunc;
@override
void serialize(Serializer s) => s.writeByte(0x68);
void serialize(Serializer s) => s.writeByte(0x73); // -0x0d
@override
String toString() => "nofunc";
@ -634,12 +634,12 @@ abstract class DefType extends HeapType {
// if any.
void serializeDefinition(Serializer s) {
if (hasSuperType) {
s.writeByte(hasAnySubtypes ? 0x50 : 0x4E);
s.writeByte(hasAnySubtypes ? 0x50 : 0x4F); // -0x30, -0x31
s.writeUnsigned(1);
assert(isStructuralSubtypeOf(superType!));
s.write(superType!);
} else if (hasAnySubtypes) {
s.writeByte(0x50);
s.writeByte(0x50); // -0x30
s.writeUnsigned(0);
}
serializeDefinitionInner(s);
@ -687,7 +687,7 @@ class FunctionType extends DefType {
@override
void serializeDefinitionInner(Serializer s) {
s.writeByte(0x60);
s.writeByte(0x60); // -0x20
s.writeList(inputs);
s.writeList(outputs);
}
@ -745,7 +745,7 @@ class StructType extends DataType {
@override
void serializeDefinitionInner(Serializer s) {
s.writeByte(0x5F);
s.writeByte(0x5F); // -0x21
s.writeList(fields);
}
}
@ -778,7 +778,7 @@ class ArrayType extends DataType {
@override
void serializeDefinitionInner(Serializer s) {
s.writeByte(0x5E);
s.writeByte(0x5E); // -0x22
s.write(elementType);
}
}
@ -867,10 +867,10 @@ class PackedType implements StorageType {
void serialize(Serializer s) {
switch (kind) {
case PackedTypeKind.i8:
s.writeByte(0x7A);
s.writeByte(0x78); // -0x8
break;
case PackedTypeKind.i16:
s.writeByte(0x79);
s.writeByte(0x77); // -0x9
break;
}
}

View file

@ -47,7 +47,7 @@ class TypeSection extends Section {
int typeIndex = 0;
for (int split
in types.recursionGroupSplits.followedBy([defTypes.length])) {
s.writeByte(0x4F);
s.writeByte(0x4E); // -0x32
s.writeUnsigned(split - typeIndex);
for (; typeIndex < split; typeIndex++) {
ir.DefType defType = defTypes[typeIndex];

View file

@ -17,9 +17,6 @@ config("binaryen_flags") {
]
}
# Use legacy encoding for WasmGC instructions
defines = [ "USE_LEGACY_GC_ENCODINGS" ]
if (is_win) {
libs = [ "shell32.lib" ]
}