Version 2.17.0-228.0.dev
Merge commit '69d66d9bd5a4ba79bc9040a60ec9e93df0a25255' into 'dev'
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 45cd4ba..46404b1 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -83,7 +83,7 @@
/// TODO(scheglov) Clean up the list of implicitly analyzed files.
class AnalysisDriver implements AnalysisDriverGeneric {
/// The version of data format, should be incremented on every format change.
- static const int DATA_VERSION = 211;
+ static const int DATA_VERSION = 212;
static const bool _applyFileChangesSynchronously = true;
diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
index ca06838..ff42940 100644
--- a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
@@ -21,6 +21,7 @@
EnableString.extension_methods: ExperimentalFeatures.extension_methods,
EnableString.extension_types: ExperimentalFeatures.extension_types,
EnableString.generic_metadata: ExperimentalFeatures.generic_metadata,
+ EnableString.inference_update_1: ExperimentalFeatures.inference_update_1,
EnableString.macros: ExperimentalFeatures.macros,
EnableString.named_arguments_anywhere:
ExperimentalFeatures.named_arguments_anywhere,
@@ -63,6 +64,9 @@
/// String to enable the experiment "generic-metadata"
static const String generic_metadata = 'generic-metadata';
+ /// String to enable the experiment "inference-update-1"
+ static const String inference_update_1 = 'inference-update-1';
+
/// String to enable the experiment "macros"
static const String macros = 'macros';
@@ -181,8 +185,18 @@
releaseVersion: Version.parse('2.14.0'),
);
- static final macros = ExperimentalFeature(
+ static final inference_update_1 = ExperimentalFeature(
index: 8,
+ enableString: EnableString.inference_update_1,
+ isEnabledByDefault: IsEnabledByDefault.inference_update_1,
+ isExpired: IsExpired.inference_update_1,
+ documentation: 'Enhanced type inference',
+ experimentalReleaseVersion: null,
+ releaseVersion: null,
+ );
+
+ static final macros = ExperimentalFeature(
+ index: 9,
enableString: EnableString.macros,
isEnabledByDefault: IsEnabledByDefault.macros,
isExpired: IsExpired.macros,
@@ -192,7 +206,7 @@
);
static final named_arguments_anywhere = ExperimentalFeature(
- index: 9,
+ index: 10,
enableString: EnableString.named_arguments_anywhere,
isEnabledByDefault: IsEnabledByDefault.named_arguments_anywhere,
isExpired: IsExpired.named_arguments_anywhere,
@@ -202,7 +216,7 @@
);
static final non_nullable = ExperimentalFeature(
- index: 10,
+ index: 11,
enableString: EnableString.non_nullable,
isEnabledByDefault: IsEnabledByDefault.non_nullable,
isExpired: IsExpired.non_nullable,
@@ -212,7 +226,7 @@
);
static final nonfunction_type_aliases = ExperimentalFeature(
- index: 11,
+ index: 12,
enableString: EnableString.nonfunction_type_aliases,
isEnabledByDefault: IsEnabledByDefault.nonfunction_type_aliases,
isExpired: IsExpired.nonfunction_type_aliases,
@@ -222,7 +236,7 @@
);
static final set_literals = ExperimentalFeature(
- index: 12,
+ index: 13,
enableString: EnableString.set_literals,
isEnabledByDefault: IsEnabledByDefault.set_literals,
isExpired: IsExpired.set_literals,
@@ -232,7 +246,7 @@
);
static final spread_collections = ExperimentalFeature(
- index: 13,
+ index: 14,
enableString: EnableString.spread_collections,
isEnabledByDefault: IsEnabledByDefault.spread_collections,
isExpired: IsExpired.spread_collections,
@@ -242,7 +256,7 @@
);
static final super_parameters = ExperimentalFeature(
- index: 14,
+ index: 15,
enableString: EnableString.super_parameters,
isEnabledByDefault: IsEnabledByDefault.super_parameters,
isExpired: IsExpired.super_parameters,
@@ -252,7 +266,7 @@
);
static final test_experiment = ExperimentalFeature(
- index: 15,
+ index: 16,
enableString: EnableString.test_experiment,
isEnabledByDefault: IsEnabledByDefault.test_experiment,
isExpired: IsExpired.test_experiment,
@@ -263,7 +277,7 @@
);
static final triple_shift = ExperimentalFeature(
- index: 16,
+ index: 17,
enableString: EnableString.triple_shift,
isEnabledByDefault: IsEnabledByDefault.triple_shift,
isExpired: IsExpired.triple_shift,
@@ -273,7 +287,7 @@
);
static final value_class = ExperimentalFeature(
- index: 17,
+ index: 18,
enableString: EnableString.value_class,
isEnabledByDefault: IsEnabledByDefault.value_class,
isExpired: IsExpired.value_class,
@@ -283,7 +297,7 @@
);
static final variance = ExperimentalFeature(
- index: 18,
+ index: 19,
enableString: EnableString.variance,
isEnabledByDefault: IsEnabledByDefault.variance,
isExpired: IsExpired.variance,
@@ -320,6 +334,9 @@
/// Default state of the experiment "generic-metadata"
static const bool generic_metadata = true;
+ /// Default state of the experiment "inference-update-1"
+ static const bool inference_update_1 = false;
+
/// Default state of the experiment "macros"
static const bool macros = false;
@@ -382,6 +399,9 @@
/// Expiration status of the experiment "generic-metadata"
static const bool generic_metadata = true;
+ /// Expiration status of the experiment "inference-update-1"
+ static const bool inference_update_1 = false;
+
/// Expiration status of the experiment "macros"
static const bool macros = false;
@@ -445,6 +465,10 @@
/// Current state for the flag "generic-metadata"
bool get generic_metadata => isEnabled(ExperimentalFeatures.generic_metadata);
+ /// Current state for the flag "inference-update-1"
+ bool get inference_update_1 =>
+ isEnabled(ExperimentalFeatures.inference_update_1);
+
/// Current state for the flag "macros"
bool get macros => isEnabled(ExperimentalFeatures.macros);
diff --git a/pkg/dart2wasm/bin/run_wasm.js b/pkg/dart2wasm/bin/run_wasm.js
index 7e962a0..b5034ea 100644
--- a/pkg/dart2wasm/bin/run_wasm.js
+++ b/pkg/dart2wasm/bin/run_wasm.js
@@ -2,16 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
-// Runner V8 script for testing dart2wasm, takes ".wasm" file as argument.
+// Runner V8 script for testing dart2wasm, takes ".wasm" files as arguments.
+//
// Run as follows:
//
-// $> d8 --experimental-wasm-gc --wasm-gc-js-interop run_wasm.js -- <file_name>.wasm
+// $> d8 --experimental-wasm-gc --wasm-gc-js-interop run_wasm.js -- <dart_module>.wasm [<ffi_module>.wasm]
+//
+// If an FFI module is specified, it will be instantiated first, and its
+// exports will be supplied as imports to the Dart module under the 'ffi'
+// module name.
function stringFromDartString(string) {
- var length = inst.exports.$stringLength(string);
+ var length = dartInstance.exports.$stringLength(string);
var array = new Array(length);
for (var i = 0; i < length; i++) {
- array[i] = inst.exports.$stringRead(string, i);
+ array[i] = dartInstance.exports.$stringRead(string, i);
}
return String.fromCharCode(...array);
}
@@ -23,15 +28,15 @@
range |= string.codePointAt(i);
}
if (range < 256) {
- var dartString = inst.exports.$stringAllocate1(length);
+ var dartString = dartInstance.exports.$stringAllocate1(length);
for (var i = 0; i < length; i++) {
- inst.exports.$stringWrite1(dartString, i, string.codePointAt(i));
+ dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i));
}
return dartString;
} else {
- var dartString = inst.exports.$stringAllocate2(length);
+ var dartString = dartInstance.exports.$stringAllocate2(length);
for (var i = 0; i < length; i++) {
- inst.exports.$stringWrite2(dartString, i, string.codePointAt(i));
+ dartInstance.exports.$stringWrite2(dartString, i, string.codePointAt(i));
}
return dartString;
}
@@ -44,7 +49,7 @@
},
scheduleCallback: function(milliseconds, closure) {
setTimeout(function() {
- inst.exports.$call0(closure);
+ dartInstance.exports.$call0(closure);
}, milliseconds);
},
getCurrentStackTrace: function() {
@@ -62,15 +67,28 @@
}
};
-// Create a Wasm module from the binary wasm file.
-var bytes = readbuffer(arguments[0]);
-var module = new WebAssembly.Module(bytes);
+function instantiate(filename, imports) {
+ // Create a Wasm module from the binary wasm file.
+ var bytes = readbuffer(filename);
+ var module = new WebAssembly.Module(bytes);
+ return new WebAssembly.Instance(module, imports);
+}
-// Instantiate the Wasm module, importing from the global scope.
+// Import from the global scope.
var importObject = (typeof window !== 'undefined')
? window
: Realm.global(Realm.current());
-var inst = new WebAssembly.Instance(module, importObject);
-var result = inst.exports.main();
+// Is an FFI module specified?
+if (arguments.length > 1) {
+ // instantiate FFI module
+ var ffiInstance = instantiate(arguments[1], {});
+ // Make its exports available as imports under the 'ffi' module name
+ importObject.ffi = ffiInstance.exports;
+}
+
+// Instantiate the Dart module, importing from the global scope.
+var dartInstance = instantiate(arguments[0], importObject);
+
+var result = dartInstance.exports.main();
if (result) console.log(result);
diff --git a/pkg/dart2wasm/lib/code_generator.dart b/pkg/dart2wasm/lib/code_generator.dart
index 96cdc9b..9fe6c33 100644
--- a/pkg/dart2wasm/lib/code_generator.dart
+++ b/pkg/dart2wasm/lib/code_generator.dart
@@ -236,7 +236,9 @@
ClassInfo info = translator.classInfo[cls]!;
thisLocal = paramLocals[0];
w.RefType thisType = info.nonNullableType;
- if (translator.needsConversion(paramLocals[0].type, thisType)) {
+ if (translator.needsConversion(paramLocals[0].type, thisType) &&
+ !(cls == translator.ffiPointerClass ||
+ translator.isFfiCompound(cls))) {
preciseThisLocal = addLocal(thisType);
b.local_get(paramLocals[0]);
translator.ref_cast(b, info);
@@ -988,6 +990,10 @@
@override
w.ValueType visitConstructorInvocation(
ConstructorInvocation node, w.ValueType expectedType) {
+ w.ValueType? intrinsicResult =
+ intrinsifier.generateConstructorIntrinsic(node);
+ if (intrinsicResult != null) return intrinsicResult;
+
ClassInfo info = translator.classInfo[node.target.enclosingClass]!;
translator.functions.allocateClass(info.classId);
w.Local temp = addLocal(info.nonNullableType);
@@ -1014,6 +1020,7 @@
StaticInvocation node, w.ValueType expectedType) {
w.ValueType? intrinsicResult = intrinsifier.generateStaticIntrinsic(node);
if (intrinsicResult != null) return intrinsicResult;
+
_visitArguments(node.arguments, node.targetReference, 0);
return _call(node.targetReference);
}
@@ -1042,6 +1049,7 @@
InstanceInvocation node, w.ValueType expectedType) {
w.ValueType? intrinsicResult = intrinsifier.generateInstanceIntrinsic(node);
if (intrinsicResult != null) return intrinsicResult;
+
Procedure target = node.interfaceTarget;
if (node.kind == InstanceAccessKind.Object) {
switch (target.name.text) {
@@ -1096,6 +1104,7 @@
w.ValueType visitEqualsCall(EqualsCall node, w.ValueType expectedType) {
w.ValueType? intrinsicResult = intrinsifier.generateEqualsIntrinsic(node);
if (intrinsicResult != null) return intrinsicResult;
+
Member? singleTarget = translator.singleTarget(node);
if (singleTarget == translator.coreTypes.objectEquals) {
// Plain reference comparison
@@ -1352,6 +1361,7 @@
w.ValueType? intrinsicResult =
intrinsifier.generateStaticGetterIntrinsic(node);
if (intrinsicResult != null) return intrinsicResult;
+
Member target = node.target;
if (target is Field) {
return translator.globals.readGlobal(b, target);
@@ -1493,6 +1503,9 @@
w.ValueType _directGet(
Member target, Expression receiver, w.ValueType? Function() intrinsify) {
+ w.ValueType? intrinsicResult = intrinsify();
+ if (intrinsicResult != null) return intrinsicResult;
+
if (target is Field) {
ClassInfo info = translator.classInfo[target.enclosingClass]!;
int fieldIndex = translator.fieldIndex[target]!;
@@ -1504,8 +1517,6 @@
} else {
// Instance call of getter
assert(target is Procedure && target.isGetter);
- w.ValueType? intrinsicResult = intrinsify();
- if (intrinsicResult != null) return intrinsicResult;
w.BaseFunction targetFunction =
translator.functions.getFunction(target.reference);
wrap(receiver, targetFunction.type.inputs.single);
diff --git a/pkg/dart2wasm/lib/dispatch_table.dart b/pkg/dart2wasm/lib/dispatch_table.dart
index 3c6b024..f257241 100644
--- a/pkg/dart2wasm/lib/dispatch_table.dart
+++ b/pkg/dart2wasm/lib/dispatch_table.dart
@@ -125,8 +125,8 @@
List<w.ValueType> inputs = List.generate(
inputSets.length,
(i) => translator.typeForInfo(
- upperBound(inputSets[i]), inputNullable[i]) as w.ValueType);
- inputs[0] = translator.ensureBoxed(inputs[0]);
+ upperBound(inputSets[i]), inputNullable[i], ensureBoxed: i == 0)
+ as w.ValueType);
if (name == '==') {
// == can't be called with null
inputs[1] = inputs[1].withNullability(false);
diff --git a/pkg/dart2wasm/lib/intrinsics.dart b/pkg/dart2wasm/lib/intrinsics.dart
index 002daa3..c1d914d 100644
--- a/pkg/dart2wasm/lib/intrinsics.dart
+++ b/pkg/dart2wasm/lib/intrinsics.dart
@@ -16,6 +16,11 @@
/// member in [generateMemberIntrinsic].
class Intrinsifier {
final CodeGenerator codeGen;
+
+ // The ABI type sizes are the same for 32-bit Wasm as for 32-bit ARM, so we
+ // can just use an ABI enum index corresponding to a 32-bit ARM platform.
+ static const int abiEnumIndex = 0; // androidArm
+
static const w.ValueType boolType = w.NumType.i32;
static const w.ValueType intType = w.NumType.i64;
static const w.ValueType doubleType = w.NumType.f64;
@@ -145,6 +150,7 @@
return w.NumType.i64;
}
+ // _HashAbstractImmutableBase._indexNullable
if (node.interfaceTarget == translator.immutableMapIndexNullable) {
ClassInfo info = translator.classInfo[translator.hashFieldBaseClass]!;
codeGen.wrap(node.receiver, info.nullableType);
@@ -152,6 +158,25 @@
return info.struct.fields[FieldIndex.hashBaseIndex].type.unpacked;
}
+ // _Compound._typedDataBase
+ if (node.interfaceTarget.enclosingClass == translator.ffiCompoundClass &&
+ name == '_typedDataBase') {
+ // A compound (subclass of Struct or Union) is represented by its i32
+ // address. The _typedDataBase field contains a Pointer pointing to the
+ // compound, whose representation is the same.
+ codeGen.wrap(node.receiver, w.NumType.i32);
+ return w.NumType.i32;
+ }
+
+ // Pointer.address
+ if (node.interfaceTarget.enclosingClass == translator.ffiPointerClass &&
+ name == 'address') {
+ // A Pointer is represented by its i32 address.
+ codeGen.wrap(node.receiver, w.NumType.i32);
+ b.i64_extend_i32_u();
+ return w.NumType.i64;
+ }
+
return null;
}
@@ -400,6 +425,31 @@
if (receiver is ConstantExpression &&
receiver.constant is ListConstant &&
name == '[]') {
+ Expression arg = node.arguments.positional.single;
+
+ // If the list is indexed by a constant, or the ABI index, just pick
+ // the element at that constant index.
+ int? constIndex = null;
+ if (arg is IntLiteral) {
+ constIndex = arg.value;
+ } else if (arg is ConstantExpression) {
+ Constant argConst = arg.constant;
+ if (argConst is IntConstant) {
+ constIndex = argConst.value;
+ }
+ } else if (arg is StaticInvocation) {
+ if (arg.target.enclosingLibrary.name == "dart.ffi" &&
+ arg.name.text == "_abi") {
+ constIndex = abiEnumIndex;
+ }
+ }
+ if (constIndex != null) {
+ ListConstant list = receiver.constant as ListConstant;
+ Expression element = ConstantExpression(list.entries[constIndex]);
+ return codeGen.wrap(element, typeOfExp(element));
+ }
+
+ // Access the underlying array directly.
ClassInfo info = translator.classInfo[translator.listBaseClass]!;
w.RefType listType = info.nullableType;
Field arrayField = translator.listBaseClass.fields
@@ -410,7 +460,7 @@
as w.ArrayType;
codeGen.wrap(receiver, listType);
b.struct_get(info.struct, arrayFieldIndex);
- codeGen.wrap(node.arguments.positional.single, w.NumType.i64);
+ codeGen.wrap(arg, w.NumType.i64);
b.i32_wrap_i64();
b.array_get(arrayType);
return translator.topInfo.nullableType;
@@ -451,6 +501,7 @@
w.ValueType leftType = typeOfExp(node.left);
w.ValueType rightType = typeOfExp(node.right);
+ // Compare bool or Pointer
if (leftType == boolType && rightType == boolType) {
codeGen.wrap(node.left, w.NumType.i32);
codeGen.wrap(node.right, w.NumType.i32);
@@ -458,6 +509,7 @@
return w.NumType.i32;
}
+ // Compare int
if (leftType == intType && rightType == intType) {
codeGen.wrap(node.left, w.NumType.i64);
codeGen.wrap(node.right, w.NumType.i64);
@@ -465,6 +517,7 @@
return w.NumType.i32;
}
+ // Compare double
if (leftType == doubleType && rightType == doubleType) {
codeGen.wrap(node.left, w.NumType.f64);
codeGen.wrap(node.right, w.NumType.f64);
@@ -491,6 +544,14 @@
return w.NumType.i64;
}
+ // nullptr
+ if (target.enclosingLibrary.name == "dart.ffi" &&
+ target.name.text == "nullptr") {
+ // A Pointer is represented by its i32 address.
+ b.i32_const(0);
+ return w.NumType.i32;
+ }
+
return null;
}
@@ -552,6 +613,9 @@
translator.translateType(node.arguments.types.single);
Expression operand = node.arguments.positional.single;
return codeGen.wrap(operand, targetType);
+ case "_nativeEffect":
+ // Ignore argument
+ return translator.voidMarker;
case "allocateOneByteString":
ClassInfo info = translator.classInfo[translator.oneByteStringClass]!;
translator.functions.allocateClass(info.classId);
@@ -644,6 +708,123 @@
}
}
+ // dart:ffi static functions
+ if (node.target.enclosingLibrary.name == "dart.ffi") {
+ // Pointer.fromAddress
+ if (name == "fromAddress") {
+ // A Pointer is represented by its i32 address.
+ codeGen.wrap(node.arguments.positional.single, w.NumType.i64);
+ b.i32_wrap_i64();
+ return w.NumType.i32;
+ }
+
+ // Accesses to Pointer.value, Pointer.value=, Pointer.[], Pointer.[]= and
+ // the members of structs and unions are desugared by the FFI kernel
+ // transformations into calls to memory load and store functions.
+ RegExp loadStoreFunctionNames = RegExp("^_(load|store)"
+ "((Int|Uint)(8|16|32|64)|(Float|Double)(Unaligned)?|Pointer)\$");
+ if (loadStoreFunctionNames.hasMatch(name)) {
+ Expression pointerArg = node.arguments.positional[0];
+ Expression offsetArg = node.arguments.positional[1];
+ codeGen.wrap(pointerArg, w.NumType.i32);
+ int offset;
+ if (offsetArg is IntLiteral) {
+ offset = offsetArg.value;
+ } else if (offsetArg is ConstantExpression &&
+ offsetArg.constant is IntConstant) {
+ offset = (offsetArg.constant as IntConstant).value;
+ } else {
+ codeGen.wrap(offsetArg, w.NumType.i64);
+ b.i32_wrap_i64();
+ b.i32_add();
+ offset = 0;
+ }
+ switch (name) {
+ case "_loadInt8":
+ b.i64_load8_s(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadUint8":
+ b.i64_load8_u(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadInt16":
+ b.i64_load16_s(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadUint16":
+ b.i64_load16_u(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadInt32":
+ b.i64_load32_s(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadUint32":
+ b.i64_load32_u(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadInt64":
+ case "_loadUint64":
+ b.i64_load(translator.ffiMemory, offset);
+ return w.NumType.i64;
+ case "_loadFloat":
+ b.f32_load(translator.ffiMemory, offset);
+ b.f64_promote_f32();
+ return w.NumType.f64;
+ case "_loadFloatUnaligned":
+ b.f32_load(translator.ffiMemory, offset, 0);
+ b.f64_promote_f32();
+ return w.NumType.f64;
+ case "_loadDouble":
+ b.f64_load(translator.ffiMemory, offset);
+ return w.NumType.f64;
+ case "_loadDoubleUnaligned":
+ b.f64_load(translator.ffiMemory, offset, 0);
+ return w.NumType.f64;
+ case "_loadPointer":
+ b.i32_load(translator.ffiMemory, offset);
+ return w.NumType.i32;
+ case "_storeInt8":
+ case "_storeUint8":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.i64);
+ b.i64_store8(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeInt16":
+ case "_storeUint16":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.i64);
+ b.i64_store16(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeInt32":
+ case "_storeUint32":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.i64);
+ b.i64_store32(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeInt64":
+ case "_storeUint64":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.i64);
+ b.i64_store(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeFloat":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.f64);
+ b.f32_demote_f64();
+ b.f32_store(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeFloatUnaligned":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.f64);
+ b.f32_demote_f64();
+ b.f32_store(translator.ffiMemory, offset, 0);
+ return translator.voidMarker;
+ case "_storeDouble":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.f64);
+ b.f64_store(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ case "_storeDoubleUnaligned":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.f64);
+ b.f64_store(translator.ffiMemory, offset, 0);
+ return translator.voidMarker;
+ case "_storePointer":
+ codeGen.wrap(node.arguments.positional[2], w.NumType.i32);
+ b.i32_store(translator.ffiMemory, offset);
+ return translator.voidMarker;
+ }
+ }
+ }
+
// Wasm(Int|Float|Object)Array constructors
if (node.target.enclosingClass?.superclass ==
translator.wasmArrayBaseClass) {
@@ -683,6 +864,21 @@
return null;
}
+ w.ValueType? generateConstructorIntrinsic(ConstructorInvocation node) {
+ String name = node.name.text;
+
+ // _Compound.#fromTypedDataBase
+ if (name == "#fromTypedDataBase") {
+ // A compound (subclass of Struct or Union) is represented by its i32
+ // address. The argument to the #fromTypedDataBase constructor is a
+ // Pointer, whose representation is the same.
+ codeGen.wrap(node.arguments.positional.single, w.NumType.i32);
+ return w.NumType.i32;
+ }
+
+ return null;
+ }
+
bool generateMemberIntrinsic(Reference target, w.DefinedFunction function,
List<w.Local> paramLocals, w.Label? returnLabel) {
Member member = target.asMember;
diff --git a/pkg/dart2wasm/lib/target.dart b/pkg/dart2wasm/lib/target.dart
index 76623cc..15e6651 100644
--- a/pkg/dart2wasm/lib/target.dart
+++ b/pkg/dart2wasm/lib/target.dart
@@ -11,6 +11,12 @@
import 'package:kernel/target/targets.dart';
import 'package:vm/transformations/mixin_full_resolution.dart'
as transformMixins show transformLibraries;
+import 'package:vm/transformations/ffi/common.dart' as ffiHelper
+ show calculateTransitiveImportsOfDartFfiIfUsed;
+import 'package:vm/transformations/ffi/definitions.dart'
+ as transformFfiDefinitions show transformLibraries;
+import 'package:vm/transformations/ffi/use_sites.dart' as transformFfiUseSites
+ show transformLibraries;
import 'package:dart2wasm/constants_backend.dart';
import 'package:dart2wasm/transformers.dart' as wasmTrans;
@@ -35,6 +41,14 @@
TargetFlags get flags => TargetFlags(enableNullSafety: true);
@override
+ List<String> get extraRequiredLibraries => const <String>[
+ 'dart:ffi',
+ 'dart:_internal',
+ 'dart:typed_data',
+ 'dart:nativewrappers',
+ ];
+
+ @override
List<String> get extraIndexedLibraries => const <String>[
"dart:collection",
"dart:typed_data",
@@ -82,6 +96,24 @@
this, coreTypes, hierarchy, libraries, referenceFromIndex);
logger?.call("Transformed mixin applications");
+ List<Library>? transitiveImportingDartFfi = ffiHelper
+ .calculateTransitiveImportsOfDartFfiIfUsed(component, libraries);
+ if (transitiveImportingDartFfi == null) {
+ logger?.call("Skipped ffi transformation");
+ } else {
+ transformFfiDefinitions.transformLibraries(
+ component,
+ coreTypes,
+ hierarchy,
+ transitiveImportingDartFfi,
+ diagnosticReporter,
+ referenceFromIndex,
+ changedStructureNotifier);
+ transformFfiUseSites.transformLibraries(component, coreTypes, hierarchy,
+ transitiveImportingDartFfi, diagnosticReporter, referenceFromIndex);
+ logger?.call("Transformed ffi annotations");
+ }
+
wasmTrans.transformLibraries(libraries, coreTypes, hierarchy);
}
diff --git a/pkg/dart2wasm/lib/translator.dart b/pkg/dart2wasm/lib/translator.dart
index e34f5ba..8b71467 100644
--- a/pkg/dart2wasm/lib/translator.dart
+++ b/pkg/dart2wasm/lib/translator.dart
@@ -83,11 +83,13 @@
late final Class oneByteStringClass;
late final Class twoByteStringClass;
late final Class typeClass;
+ late final Class stackTraceClass;
+ late final Class ffiCompoundClass;
+ late final Class ffiPointerClass;
late final Class typedListBaseClass;
late final Class typedListClass;
late final Class typedListViewClass;
late final Class byteDataViewClass;
- late final Class stackTraceClass;
late final Procedure stackTraceCurrent;
late final Procedure stringEquals;
late final Procedure stringInterpolate;
@@ -115,7 +117,10 @@
late final w.Module m;
late final w.DefinedFunction initFunction;
late final w.ValueType voidMarker;
+ // Lazily create exception tag if used.
late final w.Tag exceptionTag = createExceptionTag();
+ // Lazily import FFI memory if used.
+ late final w.Memory ffiMemory = m.importMemory("ffi", "memory", 0);
// Caches for when identical source constructs need a common representation.
final Map<w.StorageType, w.ArrayType> arrayTypeCache = {};
@@ -138,29 +143,17 @@
dispatchTable = DispatchTable(this);
functions = FunctionCollector(this);
- Library coreLibrary =
- component.libraries.firstWhere((l) => l.name == "dart.core");
- Class lookupCore(String name) {
- return coreLibrary.classes.firstWhere((c) => c.name == name);
+ Class Function(String) makeLookup(String libraryName) {
+ Library library =
+ component.libraries.firstWhere((l) => l.name == libraryName);
+ return (name) => library.classes.firstWhere((c) => c.name == name);
}
- Library collectionLibrary =
- component.libraries.firstWhere((l) => l.name == "dart.collection");
- Class lookupCollection(String name) {
- return collectionLibrary.classes.firstWhere((c) => c.name == name);
- }
-
- Library typedDataLibrary =
- component.libraries.firstWhere((l) => l.name == "dart.typed_data");
- Class lookupTypedData(String name) {
- return typedDataLibrary.classes.firstWhere((c) => c.name == name);
- }
-
- Library wasmLibrary =
- component.libraries.firstWhere((l) => l.name == "dart.wasm");
- Class lookupWasm(String name) {
- return wasmLibrary.classes.firstWhere((c) => c.name == name);
- }
+ Class Function(String) lookupCore = makeLookup("dart.core");
+ Class Function(String) lookupCollection = makeLookup("dart.collection");
+ Class Function(String) lookupFfi = makeLookup("dart.ffi");
+ Class Function(String) lookupTypedData = makeLookup("dart.typed_data");
+ Class Function(String) lookupWasm = makeLookup("dart.wasm");
wasmTypesBaseClass = lookupWasm("_WasmBase");
wasmArrayBaseClass = lookupWasm("_WasmArray");
@@ -182,6 +175,8 @@
twoByteStringClass = lookupCore("_TwoByteString");
typeClass = lookupCore("_Type");
stackTraceClass = lookupCore("StackTrace");
+ ffiCompoundClass = lookupFfi("_Compound");
+ ffiPointerClass = lookupFfi("Pointer");
typedListBaseClass = lookupTypedData("_TypedListBase");
typedListClass = lookupTypedData("_TypedList");
typedListViewClass = lookupTypedData("_TypedListView");
@@ -217,6 +212,7 @@
lookupWasm("WasmI64"): w.NumType.i64,
lookupWasm("WasmF32"): w.NumType.f32,
lookupWasm("WasmF64"): w.NumType.f64,
+ ffiPointerClass: w.NumType.i32,
};
boxedClasses = {
w.NumType.i32: boxedBoolClass,
@@ -371,28 +367,39 @@
throw "Packed types are only allowed in arrays and fields";
}
- bool isWasmType(Class cls) {
+ bool _hasSuperclass(Class cls, Class superclass) {
while (cls.superclass != null) {
cls = cls.superclass!;
- if (cls == wasmTypesBaseClass) return true;
+ if (cls == superclass) return true;
}
return false;
}
- w.StorageType typeForInfo(ClassInfo info, bool nullable) {
+ bool isWasmType(Class cls) => _hasSuperclass(cls, wasmTypesBaseClass);
+
+ bool isFfiCompound(Class cls) => _hasSuperclass(cls, ffiCompoundClass);
+
+ w.StorageType typeForInfo(ClassInfo info, bool nullable,
+ {bool ensureBoxed = false}) {
Class? cls = info.cls;
if (cls != null) {
w.StorageType? builtin = builtinTypes[cls];
if (builtin != null) {
- if (!nullable) return builtin;
+ if (!nullable && (!ensureBoxed || cls == ffiPointerClass)) {
+ return builtin;
+ }
if (isWasmType(cls)) {
if (builtin.isPrimitive) throw "Wasm numeric types can't be nullable";
return (builtin as w.RefType).withNullability(true);
}
+ if (cls == ffiPointerClass) throw "FFI types can't be nullable";
Class? boxedClass = boxedClasses[builtin];
if (boxedClass != null) {
info = classInfo[boxedClass]!;
}
+ } else if (isFfiCompound(cls)) {
+ if (nullable) throw "FFI types can't be nullable";
+ return w.NumType.i32;
}
}
return w.RefType.def(info.repr.struct,
@@ -529,13 +536,6 @@
});
}
- w.ValueType ensureBoxed(w.ValueType type) {
- // Box receiver if it's primitive
- if (type is w.RefType) return type;
- return w.RefType.def(classInfo[boxedClasses[type]!]!.struct,
- nullable: false);
- }
-
w.ValueType typeForLocal(w.ValueType type) {
return options.localNullability ? type : type.withNullability(true);
}
diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
index 953dfa4..e6a113c 100644
--- a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
+++ b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
@@ -19,6 +19,7 @@
extensionMethods,
extensionTypes,
genericMetadata,
+ inferenceUpdate1,
macros,
namedArgumentsAnywhere,
nonNullable,
@@ -42,6 +43,7 @@
const Version enableExtensionMethodsVersion = const Version(2, 6);
const Version enableExtensionTypesVersion = const Version(2, 17);
const Version enableGenericMetadataVersion = const Version(2, 14);
+const Version enableInferenceUpdate1Version = const Version(2, 17);
const Version enableMacrosVersion = const Version(2, 17);
const Version enableNamedArgumentsAnywhereVersion = const Version(2, 17);
const Version enableNonNullableVersion = const Version(2, 12);
@@ -74,6 +76,8 @@
return ExperimentalFlag.extensionTypes;
case "generic-metadata":
return ExperimentalFlag.genericMetadata;
+ case "inference-update-1":
+ return ExperimentalFlag.inferenceUpdate1;
case "macros":
return ExperimentalFlag.macros;
case "named-arguments-anywhere":
@@ -110,6 +114,7 @@
ExperimentalFlag.extensionMethods: true,
ExperimentalFlag.extensionTypes: false,
ExperimentalFlag.genericMetadata: true,
+ ExperimentalFlag.inferenceUpdate1: false,
ExperimentalFlag.macros: false,
ExperimentalFlag.namedArgumentsAnywhere: true,
ExperimentalFlag.nonNullable: true,
@@ -133,6 +138,7 @@
ExperimentalFlag.extensionMethods: true,
ExperimentalFlag.extensionTypes: false,
ExperimentalFlag.genericMetadata: true,
+ ExperimentalFlag.inferenceUpdate1: false,
ExperimentalFlag.macros: false,
ExperimentalFlag.namedArgumentsAnywhere: false,
ExperimentalFlag.nonNullable: true,
@@ -156,6 +162,7 @@
ExperimentalFlag.extensionMethods: const Version(2, 6),
ExperimentalFlag.extensionTypes: const Version(2, 17),
ExperimentalFlag.genericMetadata: const Version(2, 14),
+ ExperimentalFlag.inferenceUpdate1: const Version(2, 17),
ExperimentalFlag.macros: const Version(2, 17),
ExperimentalFlag.namedArgumentsAnywhere: const Version(2, 17),
ExperimentalFlag.nonNullable: const Version(2, 12),
@@ -179,6 +186,7 @@
ExperimentalFlag.extensionMethods: const Version(2, 6),
ExperimentalFlag.extensionTypes: const Version(2, 17),
ExperimentalFlag.genericMetadata: const Version(2, 14),
+ ExperimentalFlag.inferenceUpdate1: const Version(2, 17),
ExperimentalFlag.macros: const Version(2, 17),
ExperimentalFlag.namedArgumentsAnywhere: const Version(2, 17),
ExperimentalFlag.nonNullable: const Version(2, 10),
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index d4ea6ce..5fc0557 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -1780,10 +1780,13 @@
Class? cls;
if (className != null) {
- ClassBuilder? classBuilder = libraryBuilder.scope
- .lookupLocalMember(className, setter: false) as ClassBuilder?;
- cls = classBuilder?.cls;
- if (cls == null) return null;
+ Builder? scopeMember =
+ libraryBuilder.scope.lookupLocalMember(className, setter: false);
+ if (scopeMember is ClassBuilder) {
+ cls = scopeMember.cls;
+ } else {
+ return null;
+ }
}
Extension? extension;
String? extensionName;
diff --git a/pkg/front_end/lib/src/fasta/kernel/utils.dart b/pkg/front_end/lib/src/fasta/kernel/utils.dart
index 3a85b46..4cfbf57 100644
--- a/pkg/front_end/lib/src/fasta/kernel/utils.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/utils.dart
@@ -96,6 +96,20 @@
const String kDebugClassName = "#DebugClass";
+class _CollectLibraryDependencies extends RecursiveVisitor {
+ Set<LibraryDependency> foundLibraryDependencies = {};
+
+ @override
+ void visitLoadLibrary(LoadLibrary node) {
+ foundLibraryDependencies.add(node.import);
+ }
+
+ @override
+ void visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node) {
+ foundLibraryDependencies.add(node.import);
+ }
+}
+
Component createExpressionEvaluationComponent(Procedure procedure) {
Library realLibrary = procedure.enclosingLibrary;
@@ -106,6 +120,17 @@
..nonNullableByDefaultCompiledMode =
realLibrary.nonNullableByDefaultCompiledMode;
+ // Add deferred library dependencies. They are needed for serializing
+ // references to deferred libraries. We can just claim ownership of the ones
+ // we find as they were created when doing the expression compilation.
+ _CollectLibraryDependencies collectLibraryDependencies =
+ new _CollectLibraryDependencies();
+ procedure.accept(collectLibraryDependencies);
+ for (LibraryDependency libraryDependency
+ in collectLibraryDependencies.foundLibraryDependencies) {
+ fakeLibrary.addDependency(libraryDependency);
+ }
+
TreeNode? realClass = procedure.parent;
if (realClass is Class) {
Class fakeClass = new Class(name: kDebugClassName, fileUri: uri)
diff --git a/pkg/front_end/testcases/expression/issue_48587.expression.yaml b/pkg/front_end/testcases/expression/issue_48587.expression.yaml
new file mode 100644
index 0000000..b527faf
--- /dev/null
+++ b/pkg/front_end/testcases/expression/issue_48587.expression.yaml
@@ -0,0 +1,27 @@
+# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Check the expression compilation (including serialization) of usage of a
+# deferred import works.
+
+sources:
+ main.dart: |
+ import 'import.dart' deferred as d;
+
+ void main() {
+ print('hello');
+ }
+
+ Future<void> printDeferred() async {
+ d.deferredPrintLocal();
+ }
+
+ import.dart: |
+ void deferredPrintLocal() {
+ print('hello from deferred library');
+ }
+definitions: []
+position: "main.dart"
+expression: |
+ d.deferredPrintLocal()
diff --git a/pkg/front_end/testcases/expression/issue_48587.expression.yaml.expect b/pkg/front_end/testcases/expression/issue_48587.expression.yaml.expect
new file mode 100644
index 0000000..f33f124
--- /dev/null
+++ b/pkg/front_end/testcases/expression/issue_48587.expression.yaml.expect
@@ -0,0 +1,4 @@
+Errors: {
+}
+method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr() → dynamic
+ return let final dynamic #t1 = CheckLibraryIsLoaded(d) in #lib1::deferredPrintLocal();
diff --git a/pkg/front_end/testcases/expression/wrong_position.expression.yaml b/pkg/front_end/testcases/expression/wrong_position.expression.yaml
new file mode 100644
index 0000000..1656813
--- /dev/null
+++ b/pkg/front_end/testcases/expression/wrong_position.expression.yaml
@@ -0,0 +1,13 @@
+# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+sources:
+ main.dart: |
+ void main() {
+ print('hello');
+ }
+definitions: []
+position: "main.dart#main"
+expression: |
+ main()
diff --git a/pkg/front_end/testcases/expression/wrong_position.expression.yaml.expect b/pkg/front_end/testcases/expression/wrong_position.expression.yaml.expect
new file mode 100644
index 0000000..ba1f145
--- /dev/null
+++ b/pkg/front_end/testcases/expression/wrong_position.expression.yaml.expect
@@ -0,0 +1,3 @@
+Errors: {
+}
+<no procedure>
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.expect
index e5c093e..143b766 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.expect
@@ -25,5 +25,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.transformed.expect
index de205ad..0ce631d 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.strong.transformed.expect
@@ -52,5 +52,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.expect
index ec86fcc..69afb57 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.expect
@@ -25,5 +25,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.modular.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.modular.expect
index ec86fcc..69afb57 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.modular.expect
@@ -25,5 +25,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.transformed.expect
index 77e3dbf..6f63e04 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array.dart.weak.transformed.expect
@@ -52,5 +52,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.expect
index f82c29d..67f064e2 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.expect
@@ -33,5 +33,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array_multi_dimensional.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.transformed.expect
index d5ddd95..c8f0636 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.strong.transformed.expect
@@ -84,5 +84,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array_multi_dimensional.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.expect
index d33f1a0..2a5a6bf 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.expect
@@ -33,5 +33,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array_multi_dimensional.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.modular.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.modular.expect
index d33f1a0..2a5a6bf 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.modular.expect
@@ -33,5 +33,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array_multi_dimensional.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.transformed.expect
index 6a4db26..82be0e6 100644
--- a/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart.weak.transformed.expect
@@ -84,5 +84,5 @@
Constructor coverage from constants:
org-dartlang-testcase:///ffi_struct_inline_array_multi_dimensional.dart:
-- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:140:9)
+- _ArraySize. (from org-dartlang-sdk:///sdk/lib/ffi/ffi.dart:141:9)
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
diff --git a/pkg/wasm_builder/lib/src/module.dart b/pkg/wasm_builder/lib/src/module.dart
index e015acf..2e03919 100644
--- a/pkg/wasm_builder/lib/src/module.dart
+++ b/pkg/wasm_builder/lib/src/module.dart
@@ -27,6 +27,7 @@
BaseFunction? startFunction = null;
bool anyFunctionsDefined = false;
+ bool anyMemoriesDefined = false;
bool anyGlobalsDefined = false;
bool dataReferencedFromGlobalInitializer = false;
@@ -45,13 +46,23 @@
}
/// All module imports (functions and globals).
- Iterable<Import> get imports =>
- functions.whereType<Import>().followedBy(globals.whereType<Import>());
+ Iterable<Import> get imports => functions
+ .whereType<Import>()
+ .followedBy(memories.whereType<Import>())
+ .followedBy(globals.whereType<Import>());
/// All functions defined in the module.
Iterable<DefinedFunction> get definedFunctions =>
functions.whereType<DefinedFunction>();
+ /// All memories defined in the module.
+ Iterable<DefinedMemory> get definedMemories =>
+ memories.whereType<DefinedMemory>();
+
+ /// All globals defined in the module.
+ Iterable<DefinedGlobal> get definedGlobals =>
+ globals.whereType<DefinedGlobal>();
+
/// Add a new function type to the module.
///
/// All function types are canonicalized, such that identical types become
@@ -119,8 +130,9 @@
}
/// Add a new memory to the module.
- Memory addMemory(int minSize, [int? maxSize]) {
- final memory = Memory(memories.length, minSize, maxSize);
+ DefinedMemory addMemory(int minSize, [int? maxSize]) {
+ anyMemoriesDefined = true;
+ final memory = DefinedMemory(memories.length, minSize, maxSize);
memories.add(memory);
return memory;
}
@@ -179,6 +191,21 @@
return function;
}
+ /// Import a memory into the module.
+ ///
+ /// All imported memories must be specified before any memories are declared
+ /// using [Module.addMemory].
+ ImportedMemory importMemory(String module, String name, int minSize,
+ [int? maxSize]) {
+ if (anyMemoriesDefined) {
+ throw "All memory imports must be specified before any definitions.";
+ }
+ final memory =
+ ImportedMemory(module, name, memories.length, minSize, maxSize);
+ memories.add(memory);
+ return memory;
+ }
+
/// Import a global variable into the module.
///
/// All imported globals must be specified before any globals are declared
@@ -381,15 +408,14 @@
}
/// A memory in a module.
-class Memory implements Serializable {
+class Memory {
final int index;
final int minSize;
final int? maxSize;
Memory(this.index, this.minSize, [this.maxSize]);
- @override
- void serialize(Serializer s) {
+ void _serializeLimits(Serializer s) {
if (maxSize == null) {
s.writeByte(0x00);
s.writeUnsigned(minSize);
@@ -401,6 +427,14 @@
}
}
+class DefinedMemory extends Memory implements Serializable {
+ DefinedMemory(int index, int minSize, int? maxSize)
+ : super(index, minSize, maxSize);
+
+ @override
+ void serialize(Serializer s) => _serializeLimits(s);
+}
+
/// A tag in a module.
class Tag implements Serializable {
final int index;
@@ -517,6 +551,23 @@
String toString() => "$module.$name";
}
+/// An imported memory.
+class ImportedMemory extends Memory implements Import {
+ final String module;
+ final String name;
+
+ ImportedMemory(this.module, this.name, int index, int minSize, int? maxSize)
+ : super(index, minSize, maxSize);
+
+ @override
+ void serialize(Serializer s) {
+ s.writeName(module);
+ s.writeName(name);
+ s.writeByte(0x02);
+ _serializeLimits(s);
+ }
+}
+
/// An imported global variable.
class ImportedGlobal extends Global implements Import {
final String module;
@@ -660,11 +711,11 @@
int get id => 5;
@override
- bool get isNotEmpty => module.memories.isNotEmpty;
+ bool get isNotEmpty => module.definedMemories.isNotEmpty;
@override
void serializeContents() {
- writeList(module.memories);
+ writeList(module.definedMemories.toList());
}
}
@@ -690,11 +741,11 @@
int get id => 6;
@override
- bool get isNotEmpty => module.globals.whereType<DefinedGlobal>().isNotEmpty;
+ bool get isNotEmpty => module.definedGlobals.isNotEmpty;
@override
void serializeContents() {
- writeList(module.globals.whereType<DefinedGlobal>().toList());
+ writeList(module.definedGlobals.toList());
}
}
diff --git a/runtime/docs/gc.md b/runtime/docs/gc.md
index ac9696d..7c2fd9a 100644
--- a/runtime/docs/gc.md
+++ b/runtime/docs/gc.md
@@ -13,7 +13,7 @@
Heap objects are always allocated in double-word increments. Objects in old-space are kept at double-word alignment (address % double-word == 0), and objects in new-space are kept offset from double-word alignment (address % double-word == word). This allows checking an object's age without comparing to a boundary address, avoiding restrictions on heap placement and avoiding loading the boundary from thread-local storage. Additionally, the scavenger can quickly skip over both immediates and old objects with a single branch.
| Pointer | Referent |
-| ---------- | --------------------------------------- |
+| --- | --- |
| 0x00000002 | Small integer 1 |
| 0xFFFFFFFE | Small integer -1 |
| 0x00A00001 | Heap object at 0x00A00000, in old-space |
@@ -75,7 +75,7 @@
## Concurrent Marking
-To reduce the time the mutator is paused for old-space GCs, we allow the mutator to continue running during most of the marking work.
+To reduce the time the mutator is paused for old-space GCs, we allow the mutator to continue running during most of the marking work.
### Barrier
@@ -204,35 +204,3 @@
<instructions that cannot directly call Dart functions>
StoreInstanceField(container, value, NoBarrier)
```
-
-## Finalizers
-
-The GC is aware of two types of objects for the purposes of running finalizers.
-
-1) `FinalizerEntry`
-2) `Finalizer` (`FinalizerBase`, `_FinalizerImpl`)
-
-A `FinalizerEntry` contains the `value`, the optional `detach` key, and the `token`, and a reference to the `finalizer`.
-An entry only holds on weakly to the value, detach key, and finalizer. (Similar to how `WeakReference` only holds on weakly to target).
-
-A `Finalizer` contains all entries, a list of entries of which the value is collected, and a reference to the isolate.
-
-When the value of an entry is GCed, the entry is added over to the collected list.
-If any entry is moved to the collected list, a message is sent that invokes the finalizer to call the callback on all entries in that list.
-
-When a finalizer is detached by the user, the entry token is set to the entry itself and is removed from the all entries set.
-This ensures that if the entry was already moved to the collected list, the finalizer is not executed.
-
-To speed up detaching, we use a weak map from detach keys to list of entries. This ensures entries can be GCed.
-
-Both the scavenger and marker can process finalizer entries in parallel.
-Parallel tasks use an atomic exchange on the head of the collected entries list, ensuring no entries get lost.
-Mutator threads are guaranteed to be stopped when processing entries.
-This ensures that we do not need barriers for moving entries into the finalizers collected list.
-Dart reads and replaces the collected entries list also with an atomic exchange, ensuring the GC doesn't run in between a load/store.
-
-When a finalizer gets posted a message to process finalized objects, it is being kept alive by the message.
-An alternative design would be to pre-allocate a `WeakReference` in the finalizer pointing to the finalizer, and send that itself.
-This would be at the cost of an extra object.
-
-If the finalizer object itself is GCed, the callback is not run for any of the attachments.
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index e2ef579..3d2a0f0 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -242,8 +242,6 @@
break;
MESSAGE_SNAPSHOT_ILLEGAL(DynamicLibrary);
- // TODO(http://dartbug.com/47777): Send and exit support: remove this.
- MESSAGE_SNAPSHOT_ILLEGAL(Finalizer);
MESSAGE_SNAPSHOT_ILLEGAL(MirrorReference);
MESSAGE_SNAPSHOT_ILLEGAL(Pointer);
MESSAGE_SNAPSHOT_ILLEGAL(ReceivePort);
@@ -286,7 +284,6 @@
return obj.ptr();
}
-// TODO(http://dartbug.com/47777): Add support for Finalizers.
DEFINE_NATIVE_ENTRY(Isolate_exit_, 0, 2) {
GET_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
if (!port.IsNull()) {
@@ -641,10 +638,9 @@
// Make a copy of the state's isolate flags and hand it to the callback.
Dart_IsolateFlags api_flags = *(state_->isolate_flags());
api_flags.is_system_isolate = false;
- Dart_Isolate isolate =
- (create_group_callback)(state_->script_url(), name, nullptr,
- state_->package_config(), &api_flags,
- parent_isolate_->init_callback_data(), &error);
+ Dart_Isolate isolate = (create_group_callback)(
+ state_->script_url(), name, nullptr, state_->package_config(),
+ &api_flags, parent_isolate_->init_callback_data(), &error);
parent_isolate_->DecrementSpawnCount();
parent_isolate_ = nullptr;
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_helper.dart b/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_helper.dart
deleted file mode 100644
index c0dfdeb..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_helper.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:isolate';
-
-import 'helpers.dart';
-
-int callbackCount = 0;
-
-void callback(Nonce token) {
- callbackCount++;
- print('$name: Running finalizer: token: $token');
-}
-
-final finalizer = Finalizer<Nonce>(callback);
-
-late String name;
-
-void main(List<String> arguments, SendPort port) async {
- name = arguments[0];
-
- final token = Nonce(42);
- makeObjectWithFinalizer(finalizer, token);
-
- final awaitBeforeShuttingDown = ReceivePort();
- port.send(awaitBeforeShuttingDown.sendPort);
- final message = await awaitBeforeShuttingDown.first;
- print('$name: $message');
-
- await Future.delayed(Duration(milliseconds: 1));
- print('$name: Awaited to see if there were any callbacks.');
-
- print('$name: Helper isolate exiting. num callbacks: $callbackCount.');
- port.send(callbackCount);
-}
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_test.dart
deleted file mode 100644
index ba5216f..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_isolate_groups_run_gc_test.dart
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-import 'dart:async';
-import 'dart:isolate';
-
-import 'package:async/async.dart';
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testFinalizerInOtherIsolateGroupGCBeforeExit();
- await testFinalizerInOtherIsolateGroupGCAfterExit();
- await testFinalizerInOtherIsolateGroupNoGC();
-
- print('$name: End of test, shutting down.');
-}
-
-const name = 'main';
-
-late bool hotReloadBot;
-
-Future<void> testFinalizerInOtherIsolateGroupGCBeforeExit() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
-
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 1'],
- receivePort.sendPort,
- );
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- doGC(name: name);
- await yieldToMessageLoop(name: name);
-
- signalHelperIsolate.send('Done GCing.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- // Different isolate group, so we don't expect a GC in this isolate to cause
- // collected objects in the helper.
- // Except for in --hot-reload-test-mode, then the GC is triggered.
- hotReloadBot = helperCallbacks == 1;
-}
-
-Future<void> testFinalizerInOtherIsolateGroupGCAfterExit() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 2'],
- receivePort.sendPort,
- );
-
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- signalHelperIsolate.send('Before GCing.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- Expect.equals(hotReloadBot ? 1 : 0, helperCallbacks);
-
- doGC(name: name);
- await yieldToMessageLoop(name: name);
-}
-
-Future<void> testFinalizerInOtherIsolateGroupNoGC() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
-
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 3'],
- receivePort.sendPort,
- );
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- signalHelperIsolate.send('Before quitting main isolate.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- Expect.equals(hotReloadBot ? 1 : 0, helperCallbacks);
-}
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_isolates_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/finalizer_isolates_run_gc_test.dart
deleted file mode 100644
index 5750bf4..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_isolates_run_gc_test.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-import 'dart:async';
-import 'dart:isolate';
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testNormalExit();
- await testSendAndExit();
- await testSendAndExitFinalizer();
- print('End of test, shutting down.');
-}
-
-final finalizerTokens = <Nonce>{};
-
-void callback(Nonce token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
-}
-
-void runIsolateAttachFinalizer(Object? message) {
- final finalizer = Finalizer<Nonce>(callback);
- final value = Nonce(1001);
- final token = Nonce(1002);
- finalizer.attach(value, token);
- final token9 = Nonce(9002);
- makeObjectWithFinalizer(finalizer, token9);
- if (message == null) {
- print('Isolate done.');
- return;
- }
- final list = message as List;
- assert(list.length == 2);
- final sendPort = list[0] as SendPort;
- final tryToSendFinalizer = list[1] as bool;
- if (tryToSendFinalizer) {
- Expect.throws(() {
- // TODO(http://dartbug.com/47777): Send and exit support.
- print('Trying to send and exit finalizer.');
- Isolate.exit(sendPort, [value, finalizer]);
- });
- }
- print('Isolate sending and exit.');
- Isolate.exit(sendPort, [value]);
-}
-
-Future testNormalExit() async {
- final portExitMessage = ReceivePort();
- await Isolate.spawn(
- runIsolateAttachFinalizer,
- null,
- onExit: portExitMessage.sendPort,
- );
- await portExitMessage.first;
-
- doGC();
- await yieldToMessageLoop();
-
- Expect.equals(0, finalizerTokens.length);
-}
-
-@pragma('vm:never-inline')
-Future<Finalizer?> testSendAndExitHelper(
- {bool trySendFinalizer = false}) async {
- final port = ReceivePort();
- await Isolate.spawn(
- runIsolateAttachFinalizer,
- [port.sendPort, trySendFinalizer],
- );
- final message = await port.first as List;
- print('Received message ($message).');
- final value = message[0] as Nonce;
- print('Received value ($value), but now forgetting about it.');
-
- Expect.equals(1, message.length);
- // TODO(http://dartbug.com/47777): Send and exit support.
- return null;
-}
-
-Future testSendAndExit() async {
- await testSendAndExitHelper(trySendFinalizer: false);
-
- doGC();
- await yieldToMessageLoop();
-
- Expect.equals(0, finalizerTokens.length);
-}
-
-Future testSendAndExitFinalizer() async {
- final finalizer = await testSendAndExitHelper(trySendFinalizer: true);
-
- // TODO(http://dartbug.com/47777): Send and exit support.
- Expect.isNull(finalizer);
-}
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_nullable_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/finalizer_nullable_run_gc_test.dart
deleted file mode 100644
index 8000a41..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_nullable_run_gc_test.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() {
- testFinalizer();
-}
-
-void testFinalizer() async {
- final finalizerTokens = <Nonce?>{};
- void callback(Nonce? token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
- }
-
- final finalizer = Finalizer<Nonce?>(callback);
-
- {
- final detach = Nonce(2022);
- final token = null;
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isFalse(finalizerTokens.contains(token));
-
- await Future.delayed(Duration(milliseconds: 1));
-
- // Now we have.
- Expect.isTrue(finalizerTokens.contains(token));
-
- // Try detaching after finalizer ran.
- finalizer.detach(detach);
- }
-
- print('End of test, shutting down.');
-}
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/finalizer_run_gc_test.dart
deleted file mode 100644
index a278b5d..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_run_gc_test.dart
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() {
- testWrongArguments();
- testFinalizer();
-}
-
-void testWrongArguments() {
- void callback(Object token) {
- throw 'This should never happen!';
- }
-
- final finalizer = Finalizer<Nonce>(callback);
- final myFinalizable = Nonce(1000);
- final token = Nonce(2000);
- final detach = Nonce(3000);
-
- Expect.throws(() {
- finalizer.attach(myFinalizable, token, detach: 123);
- });
- Expect.throws(() {
- finalizer.attach(123, token, detach: detach);
- });
-}
-
-void testFinalizer() async {
- final finalizerTokens = <Object>{};
- void callback(Object token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
- }
-
- final finalizer = Finalizer<Nonce>(callback);
-
- {
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isFalse(finalizerTokens.contains(token));
-
- await Future.delayed(Duration(milliseconds: 1));
-
- // Now we have.
- Expect.isTrue(finalizerTokens.contains(token));
-
- // Try detaching after finalizer ran.
- finalizer.detach(detach);
- }
-
- {
- final token = Nonce(1337);
- final token2 = Nonce(1338);
- final detachkey = Nonce(1984);
- {
- final value = Nonce(2);
- final value2 = Nonce(2000000);
- finalizer.attach(value, token, detach: detachkey);
- finalizer.attach(value2, token2, detach: detachkey);
- // Should detach 2 finalizers.
- finalizer.detach(detachkey);
- // Try detaching again, should do nothing.
- finalizer.detach(detachkey);
- }
- doGC();
- await yieldToMessageLoop();
- Expect.isFalse(finalizerTokens.contains(token));
- Expect.isFalse(finalizerTokens.contains(token2));
- }
-
- // Not running finalizer on shutdown.
- final value = Nonce(3);
- final token = Nonce(1337);
- finalizer.attach(value, token);
- print('End of test, shutting down.');
-}
diff --git a/runtime/tests/vm/dart/finalizer/finalizer_zone_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/finalizer_zone_run_gc_test.dart
deleted file mode 100644
index bcc6d9e1..0000000
--- a/runtime/tests/vm/dart/finalizer/finalizer_zone_run_gc_test.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-import 'dart:async';
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testFinalizerZone();
- await testFinalizerException();
-}
-
-Future<void> testFinalizerZone() async {
- Zone? expectedZone;
- Zone? actualZone;
-
- final finalizer = runZoned(() {
- expectedZone = Zone.current;
-
- void callback(Object token) {
- actualZone = Zone.current;
- }
-
- return Finalizer<Nonce>(callback);
- });
-
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isNull(actualZone);
-
- await yieldToMessageLoop();
-
- // Now we have.
- Expect.equals(expectedZone, actualZone);
-}
-
-Future<void> testFinalizerException() async {
- Object? caughtError;
-
- final finalizer = runZonedGuarded(() {
- void callback(Object token) {
- throw 'uncaught!';
- }
-
- return Finalizer<Nonce>(callback);
- }, (Object error, StackTrace stack) {
- caughtError = error;
- })!;
-
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- Expect.isNull(caughtError);
- await yieldToMessageLoop();
- Expect.isNotNull(caughtError);
-}
diff --git a/runtime/tests/vm/dart/finalizer/helpers.dart b/runtime/tests/vm/dart/finalizer/helpers.dart
deleted file mode 100644
index d776098..0000000
--- a/runtime/tests/vm/dart/finalizer/helpers.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// ignore: import_internal_library, unused_import
-import 'dart:_internal';
-import 'dart:async';
-
-/// A user-defined class of which objects can be identified with a field value.
-class Nonce {
- final int value;
-
- Nonce(this.value);
-
- String toString() => 'Nonce($value)';
-}
-
-/// Never inline to ensure `object` becomes unreachable.
-@pragma('vm:never-inline')
-void makeObjectWithFinalizer<T>(Finalizer<T> finalizer, T token,
- {Object? detach}) {
- final value = Nonce(1);
- finalizer.attach(value, token, detach: detach);
-}
-
-/// Triggers garbage collection.
-// Defined in `dart:_internal`.
-// ignore: undefined_identifier
-void triggerGc() => VMInternalsForTesting.collectAllGarbage();
-
-void Function(String) _namedPrint(String? name) {
- if (name != null) {
- return (String value) => print('$name: $value');
- }
- return (String value) => print(value);
-}
-
-/// Does a GC and if [doAwait] awaits a future to enable running finalizers.
-///
-/// Also prints for debug purposes.
-///
-/// If provided, [name] prefixes the debug prints.
-void doGC({String? name}) {
- final _print = _namedPrint(name);
-
- _print('Do GC.');
- triggerGc();
- _print('GC done');
-}
-
-Future<void> yieldToMessageLoop({String? name}) async {
- await Future.delayed(Duration(milliseconds: 1));
- _namedPrint(name)('Await done.');
- return null;
-}
diff --git a/runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart b/runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart
index da365b9..15b330d 100644
--- a/runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart
+++ b/runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart
@@ -2,9 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:expect/expect.dart';
+// ignore: import_internal_library, unused_import
+import 'dart:_internal';
-import 'helpers.dart';
+import 'package:expect/expect.dart';
void main() {
testWeakReferenceNonExpandoKey();
@@ -12,6 +13,14 @@
testWeakReference();
}
+class Nonce {
+ final int value;
+
+ Nonce(this.value);
+
+ String toString() => 'Nonce($value)';
+}
+
void testWeakReferenceNonExpandoKey() {
Expect.throwsArgumentError(() {
WeakReference<String>("Hello world!");
@@ -46,3 +55,7 @@
print('End of test, shutting down.');
}
+
+// Defined in `dart:_internal`.
+// ignore: undefined_identifier
+void triggerGc() => VMInternalsForTesting.collectAllGarbage();
diff --git a/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart b/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart
index d714c56..cd24fbc 100644
--- a/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart
+++ b/runtime/tests/vm/dart/isolates/fast_object_copy_test.dart
@@ -245,7 +245,6 @@
await testWeakProperty();
await testWeakReference();
- await testFinalizer();
await testForbiddenClosures();
}
@@ -757,14 +756,6 @@
}
}
- Future testFinalizer() async {
- print('testFinalizer');
-
- void callback(Object token) {}
- final finalizer = Finalizer<Object>(callback);
- Expect.throwsArgumentError(() => sendPort.send(finalizer));
- }
-
Future testForbiddenClosures() async {
print('testForbiddenClosures');
for (final closure in nonCopyableClosures) {
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_helper.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_helper.dart
deleted file mode 100644
index 58ff5bb..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_helper.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// @dart = 2.9
-
-import 'dart:isolate';
-
-import 'helpers.dart';
-
-int callbackCount = 0;
-
-void callback(Nonce token) {
- callbackCount++;
- print('$name: Running finalizer: token: $token');
-}
-
-final finalizer = Finalizer<Nonce>(callback);
-
-String name;
-
-void main(List<String> arguments, SendPort port) async {
- name = arguments[0];
-
- final token = Nonce(42);
- makeObjectWithFinalizer(finalizer, token);
-
- final awaitBeforeShuttingDown = ReceivePort();
- port.send(awaitBeforeShuttingDown.sendPort);
- final message = await awaitBeforeShuttingDown.first;
- print('$name: $message');
-
- await Future.delayed(Duration(milliseconds: 1));
- print('$name: Awaited to see if there were any callbacks.');
-
- print('$name: Helper isolate exiting. num callbacks: $callbackCount.');
- port.send(callbackCount);
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_test.dart
deleted file mode 100644
index afd09bb..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_isolate_groups_run_gc_test.dart
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-// @dart = 2.9
-
-import 'dart:async';
-import 'dart:isolate';
-
-import 'package:async/async.dart';
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testFinalizerInOtherIsolateGroupGCBeforeExit();
- await testFinalizerInOtherIsolateGroupGCAfterExit();
- await testFinalizerInOtherIsolateGroupNoGC();
-
- print('$name: End of test, shutting down.');
-}
-
-const name = 'main';
-
-bool hotReloadBot;
-
-Future<void> testFinalizerInOtherIsolateGroupGCBeforeExit() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
-
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 1'],
- receivePort.sendPort,
- );
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- doGC(name: name);
- await yieldToMessageLoop(name: name);
-
- signalHelperIsolate.send('Done GCing.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- // Different isolate group, so we don't expect a GC in this isolate to cause
- // collected objects in the helper.
- // Except for in --hot-reload-test-mode, then the GC is triggered.
- hotReloadBot = helperCallbacks == 1;
-}
-
-Future<void> testFinalizerInOtherIsolateGroupGCAfterExit() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 2'],
- receivePort.sendPort,
- );
-
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- signalHelperIsolate.send('Before GCing.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- Expect.equals(hotReloadBot ? 1 : 0, helperCallbacks);
-
- doGC(name: name);
- await yieldToMessageLoop(name: name);
-}
-
-Future<void> testFinalizerInOtherIsolateGroupNoGC() async {
- final receivePort = ReceivePort();
- final messagesQueue = StreamQueue(receivePort);
-
- await Isolate.spawnUri(
- Uri.parse('finalizer_isolate_groups_run_gc_helper.dart'),
- ['helper 3'],
- receivePort.sendPort,
- );
- final signalHelperIsolate = await messagesQueue.next as SendPort;
-
- signalHelperIsolate.send('Before quitting main isolate.');
-
- final helperCallbacks = await messagesQueue.next as int;
- messagesQueue.cancel();
- print('$name: Helper exited.');
- Expect.equals(hotReloadBot ? 1 : 0, helperCallbacks);
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_isolates_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_isolates_run_gc_test.dart
deleted file mode 100644
index 7c2103d..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_isolates_run_gc_test.dart
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-// @dart = 2.9
-
-import 'dart:async';
-import 'dart:isolate';
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testNormalExit();
- await testSendAndExit();
- await testSendAndExitFinalizer();
- print('End of test, shutting down.');
-}
-
-final finalizerTokens = <Nonce>{};
-
-void callback(Nonce token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
-}
-
-void runIsolateAttachFinalizer(Object message) {
- final finalizer = Finalizer<Nonce>(callback);
- final value = Nonce(1001);
- final token = Nonce(1002);
- finalizer.attach(value, token);
- final token9 = Nonce(9002);
- makeObjectWithFinalizer(finalizer, token9);
- if (message == null) {
- print('Isolate done.');
- return;
- }
- final list = message as List;
- assert(list.length == 2);
- final sendPort = list[0] as SendPort;
- final tryToSendFinalizer = list[1] as bool;
- if (tryToSendFinalizer) {
- Expect.throws(() {
- // TODO(http://dartbug.com/47777): Send and exit support.
- print('Trying to send and exit finalizer.');
- Isolate.exit(sendPort, [value, finalizer]);
- });
- }
- print('Isolate sending and exit.');
- Isolate.exit(sendPort, [value]);
-}
-
-Future testNormalExit() async {
- final portExitMessage = ReceivePort();
- await Isolate.spawn(
- runIsolateAttachFinalizer,
- null,
- onExit: portExitMessage.sendPort,
- );
- await portExitMessage.first;
-
- doGC();
- await yieldToMessageLoop();
-
- Expect.equals(0, finalizerTokens.length);
-}
-
-@pragma('vm:never-inline')
-Future<Finalizer> testSendAndExitHelper({bool trySendFinalizer = false}) async {
- final port = ReceivePort();
- await Isolate.spawn(
- runIsolateAttachFinalizer,
- [port.sendPort, trySendFinalizer],
- );
- final message = await port.first as List;
- print('Received message ($message).');
- final value = message[0] as Nonce;
- print('Received value ($value), but now forgetting about it.');
-
- Expect.equals(1, message.length);
- // TODO(http://dartbug.com/47777): Send and exit support.
- return null;
-}
-
-Future testSendAndExit() async {
- await testSendAndExitHelper(trySendFinalizer: false);
-
- doGC();
- await yieldToMessageLoop();
-
- Expect.equals(0, finalizerTokens.length);
-}
-
-Future testSendAndExitFinalizer() async {
- final finalizer = await testSendAndExitHelper(trySendFinalizer: true);
-
- // TODO(http://dartbug.com/47777): Send and exit support.
- Expect.isNull(finalizer);
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_nullable_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_nullable_run_gc_test.dart
deleted file mode 100644
index b033c1b..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_nullable_run_gc_test.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// @dart = 2.9
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() {
- testFinalizer();
-}
-
-void testFinalizer() async {
- final finalizerTokens = <Nonce>{};
- void callback(Nonce token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
- }
-
- final finalizer = Finalizer<Nonce>(callback);
-
- {
- final detach = Nonce(2022);
- final token = null;
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isFalse(finalizerTokens.contains(token));
-
- await Future.delayed(Duration(milliseconds: 1));
-
- // Now we have.
- Expect.isTrue(finalizerTokens.contains(token));
-
- // Try detaching after finalizer ran.
- finalizer.detach(detach);
- }
-
- print('End of test, shutting down.');
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_run_gc_test.dart
deleted file mode 100644
index 9c17461..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_run_gc_test.dart
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-// @dart = 2.9
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() {
- testWrongArguments();
- testFinalizer();
-}
-
-void testWrongArguments() {
- void callback(Object token) {
- throw 'This should never happen!';
- }
-
- final finalizer = Finalizer<Nonce>(callback);
- final myFinalizable = Nonce(1000);
- final token = Nonce(2000);
- final detach = Nonce(3000);
-
- Expect.throws(() {
- finalizer.attach(myFinalizable, token, detach: 123);
- });
- Expect.throws(() {
- finalizer.attach(123, token, detach: detach);
- });
-}
-
-void testFinalizer() async {
- final finalizerTokens = <Object>{};
- void callback(Object token) {
- print('Running finalizer: token: $token');
- finalizerTokens.add(token);
- }
-
- final finalizer = Finalizer<Nonce>(callback);
-
- {
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isFalse(finalizerTokens.contains(token));
-
- await Future.delayed(Duration(milliseconds: 1));
-
- // Now we have.
- Expect.isTrue(finalizerTokens.contains(token));
-
- // Try detaching after finalizer ran.
- finalizer.detach(detach);
- }
-
- {
- final token = Nonce(1337);
- final token2 = Nonce(1338);
- final detachkey = Nonce(1984);
- {
- final value = Nonce(2);
- final value2 = Nonce(2000000);
- finalizer.attach(value, token, detach: detachkey);
- finalizer.attach(value2, token2, detach: detachkey);
- // Should detach 2 finalizers.
- finalizer.detach(detachkey);
- // Try detaching again, should do nothing.
- finalizer.detach(detachkey);
- }
- doGC();
- await yieldToMessageLoop();
- Expect.isFalse(finalizerTokens.contains(token));
- Expect.isFalse(finalizerTokens.contains(token2));
- }
-
- // Not running finalizer on shutdown.
- final value = Nonce(3);
- final token = Nonce(1337);
- finalizer.attach(value, token);
- print('End of test, shutting down.');
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/finalizer_zone_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/finalizer_zone_run_gc_test.dart
deleted file mode 100644
index 17646d1..0000000
--- a/runtime/tests/vm/dart_2/finalizer/finalizer_zone_run_gc_test.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// VMOptions=
-// VMOptions=--use_compactor
-// VMOptions=--use_compactor --force_evacuation
-
-// @dart = 2.9
-
-import 'dart:async';
-
-import 'package:expect/expect.dart';
-
-import 'helpers.dart';
-
-void main() async {
- await testFinalizerZone();
- await testFinalizerException();
-}
-
-Future<void> testFinalizerZone() async {
- Zone expectedZone;
- Zone actualZone;
-
- final finalizer = runZoned(() {
- expectedZone = Zone.current;
-
- void callback(Object token) {
- actualZone = Zone.current;
- }
-
- return Finalizer<Nonce>(callback);
- });
-
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- // We haven't stopped running synchronous dart code yet.
- Expect.isNull(actualZone);
-
- await yieldToMessageLoop();
-
- // Now we have.
- Expect.equals(expectedZone, actualZone);
-}
-
-Future<void> testFinalizerException() async {
- Object caughtError;
-
- final finalizer = runZonedGuarded(() {
- void callback(Object token) {
- throw 'uncaught!';
- }
-
- return Finalizer<Nonce>(callback);
- }, (Object error, StackTrace stack) {
- caughtError = error;
- });
-
- final detach = Nonce(2022);
- final token = Nonce(42);
-
- makeObjectWithFinalizer(finalizer, token, detach: detach);
-
- doGC();
-
- Expect.isNull(caughtError);
- await yieldToMessageLoop();
- Expect.isNotNull(caughtError);
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/helpers.dart b/runtime/tests/vm/dart_2/finalizer/helpers.dart
deleted file mode 100644
index a82646c..0000000
--- a/runtime/tests/vm/dart_2/finalizer/helpers.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// @dart = 2.9
-
-// ignore: import_internal_library, unused_import
-import 'dart:_internal';
-import 'dart:async';
-
-/// A user-defined class of which objects can be identified with a field value.
-class Nonce {
- final int value;
-
- Nonce(this.value);
-
- String toString() => 'Nonce($value)';
-}
-
-/// Never inline to ensure `value` becomes unreachable.
-@pragma('vm:never-inline')
-void makeObjectWithFinalizer<T>(Finalizer<T> finalizer, T token,
- {Object detach}) {
- final value = Nonce(1);
- finalizer.attach(value, token, detach: detach);
-}
-
-/// Triggers garbage collection.
-// Defined in `dart:_internal`.
-// ignore: undefined_identifier
-void triggerGc() => VMInternalsForTesting.collectAllGarbage();
-
-void Function(String) _namedPrint(String name) {
- if (name != null) {
- return (String value) => print('$name: $value');
- }
- return (String value) => print(value);
-}
-
-/// Does a GC and if [doAwait] awaits a future to enable running finalizers.
-///
-/// Also prints for debug purposes.
-///
-/// If provided, [name] prefixes the debug prints.
-void doGC({String name}) {
- final _print = _namedPrint(name);
-
- _print('Do GC.');
- triggerGc();
- _print('GC done');
-}
-
-Future<void> yieldToMessageLoop({String name}) async {
- await Future.delayed(Duration(milliseconds: 1));
- _namedPrint(name)('Await done.');
- return null;
-}
diff --git a/runtime/tests/vm/dart_2/finalizer/weak_reference_run_gc_test.dart b/runtime/tests/vm/dart_2/finalizer/weak_reference_run_gc_test.dart
index 708d540..8c7583d 100644
--- a/runtime/tests/vm/dart_2/finalizer/weak_reference_run_gc_test.dart
+++ b/runtime/tests/vm/dart_2/finalizer/weak_reference_run_gc_test.dart
@@ -4,9 +4,10 @@
// @dart = 2.9
-import 'package:expect/expect.dart';
+// ignore: import_internal_library, unused_import
+import 'dart:_internal';
-import 'helpers.dart';
+import 'package:expect/expect.dart';
void main() {
testWeakReferenceNonExpandoKey();
@@ -14,6 +15,14 @@
testWeakReference();
}
+class Nonce {
+ final int value;
+
+ Nonce(this.value);
+
+ String toString() => 'Nonce($value)';
+}
+
void testWeakReferenceNonExpandoKey() {
Expect.throwsArgumentError(() {
WeakReference<String>("Hello world!");
@@ -48,3 +57,7 @@
print('End of test, shutting down.');
}
+
+// Defined in `dart:_internal`.
+// ignore: undefined_identifier
+void triggerGc() => VMInternalsForTesting.collectAllGarbage();
diff --git a/runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart b/runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart
index 91fd27d..1843f0c 100644
--- a/runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart
+++ b/runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart
@@ -247,7 +247,6 @@
await testWeakProperty();
await testWeakReference();
- await testFinalizer();
await testForbiddenClosures();
}
@@ -759,14 +758,6 @@
}
}
- Future testFinalizer() async {
- print('testFinalizer');
-
- void callback(Object token) {}
- final finalizer = Finalizer<Object>(callback);
- Expect.throwsArgumentError(() => sendPort.send(finalizer));
- }
-
Future testForbiddenClosures() async {
print('testForbiddenClosures');
for (final closure in nonCopyableClosures) {
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 8feee00..1f5066c 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -108,7 +108,6 @@
[ $compiler == dartkp ]
dart/causal_stacks/async_throws_stack_no_causal_non_symbolic_test: SkipByDesign # --no-lazy... does nothing on precompiler.
dart/causal_stacks/async_throws_stack_no_causal_test: SkipByDesign # --no-lazy... does nothing on precompiler.
-dart/finalizer/finalizer_isolate_groups_run_gc_test: SkipByDesign # Isolate.spawnUri is not supported in AOT.
dart/redirection_type_shuffling_test: SkipByDesign # Uses dart:mirrors.
dart/scavenger_abort_test: SkipSlow
dart/v8_snapshot_profile_writer_test: Pass, Slow # Can be slow due to re-invoking the precompiler.
@@ -443,11 +442,9 @@
# These Isolate tests that use spawnURI are hence skipped on purpose.
[ $runtime == dart_precompiled || $runtime == vm && ($arch == simarm || $arch == simarm64 || $arch == simarm64c || $arch == simriscv32 || $arch == simriscv64) ]
dart/data_uri_spawn_test: SkipByDesign # Isolate.spawnUri
-dart/finalizer/finalizer_isolate_groups_run_gc_test: SkipByDesign # uses spawnUri.
dart/isolates/send_object_to_spawn_uri_isolate_test: SkipByDesign # uses spawnUri
dart/issue32950_test: SkipByDesign # uses spawnUri.
dart_2/data_uri_spawn_test: SkipByDesign # Isolate.spawnUri
-dart_2/finalizer/finalizer_isolate_groups_run_gc_test: SkipByDesign # uses spawnUri.
dart_2/isolates/send_object_to_spawn_uri_isolate_test: SkipByDesign # uses spawnUri
dart_2/issue32950_test: SkipByDesign # uses spawnUri.
diff --git a/runtime/vm/app_snapshot.cc b/runtime/vm/app_snapshot.cc
index e2b8a40..f694613b 100644
--- a/runtime/vm/app_snapshot.cc
+++ b/runtime/vm/app_snapshot.cc
@@ -5140,7 +5140,7 @@
Deserializer::InitializeHeader(property, kWeakPropertyCid,
WeakProperty::InstanceSize());
ReadFromTo(property);
- property->untag()->next_seen_by_gc_ = WeakProperty::null();
+ property->untag()->next_ = WeakProperty::null();
}
}
};
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index e91180e..dc432e3 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -267,10 +267,6 @@
ASSERT_EQUAL(WeakProperty::InstanceSize(), cls.host_instance_size());
cls = object_store->weak_reference_class();
ASSERT_EQUAL(WeakReference::InstanceSize(), cls.host_instance_size());
- cls = object_store->finalizer_class();
- ASSERT_EQUAL(Finalizer::InstanceSize(), cls.host_instance_size());
- cls = object_store->finalizer_entry_class();
- ASSERT_EQUAL(FinalizerEntry::InstanceSize(), cls.host_instance_size());
cls = object_store->linked_hash_map_class();
ASSERT_EQUAL(LinkedHashMap::InstanceSize(), cls.host_instance_size());
cls = object_store->immutable_linked_hash_map_class();
diff --git a/runtime/vm/class_id.h b/runtime/vm/class_id.h
index 501c3a8..93e1979 100644
--- a/runtime/vm/class_id.h
+++ b/runtime/vm/class_id.h
@@ -68,9 +68,6 @@
V(TypeArguments) \
V(AbstractType) \
V(Type) \
- V(FinalizerBase) \
- V(Finalizer) \
- V(FinalizerEntry) \
V(FunctionType) \
V(TypeRef) \
V(TypeParameter) \
diff --git a/runtime/vm/compiler/backend/range_analysis.cc b/runtime/vm/compiler/backend/range_analysis.cc
index 8d01fc7..4d28937 100644
--- a/runtime/vm/compiler/backend/range_analysis.cc
+++ b/runtime/vm/compiler/backend/range_analysis.cc
@@ -2797,16 +2797,6 @@
case Slot::Kind::kClosure_function:
case Slot::Kind::kClosure_function_type_arguments:
case Slot::Kind::kClosure_instantiator_type_arguments:
- case Slot::Kind::kFinalizer_callback:
- case Slot::Kind::kFinalizer_type_arguments:
- case Slot::Kind::kFinalizerBase_all_entries:
- case Slot::Kind::kFinalizerBase_detachments:
- case Slot::Kind::kFinalizerBase_entries_collected:
- case Slot::Kind::kFinalizerEntry_detach:
- case Slot::Kind::kFinalizerEntry_finalizer:
- case Slot::Kind::kFinalizerEntry_next:
- case Slot::Kind::kFinalizerEntry_token:
- case Slot::Kind::kFinalizerEntry_value:
case Slot::Kind::kFunction_data:
case Slot::Kind::kFunction_signature:
case Slot::Kind::kFunctionType_named_parameter_names:
diff --git a/runtime/vm/compiler/backend/slot.cc b/runtime/vm/compiler/backend/slot.cc
index dfd04ac..4a512f8 100644
--- a/runtime/vm/compiler/backend/slot.cc
+++ b/runtime/vm/compiler/backend/slot.cc
@@ -227,16 +227,6 @@
case Slot::Kind::kClosure_hash:
case Slot::Kind::kCapturedVariable:
case Slot::Kind::kDartField:
- case Slot::Kind::kFinalizer_callback:
- case Slot::Kind::kFinalizer_type_arguments:
- case Slot::Kind::kFinalizerBase_all_entries:
- case Slot::Kind::kFinalizerBase_detachments:
- case Slot::Kind::kFinalizerBase_entries_collected:
- case Slot::Kind::kFinalizerEntry_detach:
- case Slot::Kind::kFinalizerEntry_finalizer:
- case Slot::Kind::kFinalizerEntry_next:
- case Slot::Kind::kFinalizerEntry_token:
- case Slot::Kind::kFinalizerEntry_value:
case Slot::Kind::kFunction_data:
case Slot::Kind::kFunction_signature:
case Slot::Kind::kFunctionType_named_parameter_names:
diff --git a/runtime/vm/compiler/backend/slot.h b/runtime/vm/compiler/backend/slot.h
index 995ce8cf..ab82fe2 100644
--- a/runtime/vm/compiler/backend/slot.h
+++ b/runtime/vm/compiler/backend/slot.h
@@ -53,15 +53,6 @@
// that) or like a non-final field.
#define NULLABLE_BOXED_NATIVE_SLOTS_LIST(V) \
V(Array, UntaggedArray, type_arguments, TypeArguments, FINAL) \
- V(Finalizer, UntaggedFinalizer, type_arguments, TypeArguments, FINAL) \
- V(FinalizerBase, UntaggedFinalizerBase, all_entries, LinkedHashSet, VAR) \
- V(FinalizerBase, UntaggedFinalizerBase, detachments, Dynamic, VAR) \
- V(FinalizerBase, UntaggedFinalizer, entries_collected, FinalizerEntry, VAR) \
- V(FinalizerEntry, UntaggedFinalizerEntry, value, Dynamic, VAR) \
- V(FinalizerEntry, UntaggedFinalizerEntry, detach, Dynamic, VAR) \
- V(FinalizerEntry, UntaggedFinalizerEntry, token, Dynamic, VAR) \
- V(FinalizerEntry, UntaggedFinalizerEntry, finalizer, FinalizerBase, VAR) \
- V(FinalizerEntry, UntaggedFinalizerEntry, next, FinalizerEntry, VAR) \
V(Function, UntaggedFunction, signature, FunctionType, FINAL) \
V(Context, UntaggedContext, parent, Context, FINAL) \
V(Closure, UntaggedClosure, instantiator_type_arguments, TypeArguments, \
@@ -100,7 +91,6 @@
V(Closure, UntaggedClosure, function, Function, FINAL) \
V(Closure, UntaggedClosure, context, Context, FINAL) \
V(Closure, UntaggedClosure, hash, Context, VAR) \
- V(Finalizer, UntaggedFinalizer, callback, Closure, FINAL) \
V(Function, UntaggedFunction, data, Dynamic, FINAL) \
V(FunctionType, UntaggedFunctionType, named_parameter_names, Array, FINAL) \
V(FunctionType, UntaggedFunctionType, parameter_types, Array, FINAL) \
@@ -169,7 +159,6 @@
AOT_ONLY_UNBOXED_NATIVE_SLOTS_LIST(V) \
V(ClosureData, UntaggedClosureData, default_type_arguments_kind, Uint8, \
FINAL) \
- V(FinalizerBase, UntaggedFinalizerBase, isolate, IntPtr, VAR) \
V(Function, UntaggedFunction, entry_point, Uword, FINAL) \
V(Function, UntaggedFunction, kind_tag, Uint32, FINAL) \
V(Function, UntaggedFunction, packed_fields, Uint32, FINAL) \
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 9abd1fd..006ea70 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -818,13 +818,6 @@
V(ByteDataViewLength, TypedDataBase_length) \
V(ByteDataViewOffsetInBytes, TypedDataView_offset_in_bytes) \
V(ByteDataViewTypedData, TypedDataView_typed_data) \
- V(Finalizer_getCallback, Finalizer_callback) \
- V(FinalizerBase_getAllEntries, FinalizerBase_all_entries) \
- V(FinalizerBase_getDetachments, FinalizerBase_detachments) \
- V(FinalizerEntry_getDetach, FinalizerEntry_detach) \
- V(FinalizerEntry_getNext, FinalizerEntry_next) \
- V(FinalizerEntry_getToken, FinalizerEntry_token) \
- V(FinalizerEntry_getValue, FinalizerEntry_value) \
V(GrowableArrayLength, GrowableObjectArray_length) \
V(ImmutableLinkedHashBase_getData, ImmutableLinkedHashBase_data) \
V(ImmutableLinkedHashBase_getIndex, ImmutableLinkedHashBase_index) \
@@ -842,14 +835,6 @@
V(WeakReference_getTarget, WeakReference_target)
#define STORE_NATIVE_FIELD(V) \
- V(Finalizer_setCallback, Finalizer_callback) \
- V(FinalizerBase_setAllEntries, FinalizerBase_all_entries) \
- V(FinalizerBase_setDetachments, FinalizerBase_detachments) \
- V(FinalizerEntry_setDetach, FinalizerEntry_detach) \
- V(FinalizerEntry_setFinalizer, FinalizerEntry_finalizer) \
- V(FinalizerEntry_setNext, FinalizerEntry_next) \
- V(FinalizerEntry_setToken, FinalizerEntry_token) \
- V(FinalizerEntry_setValue, FinalizerEntry_value) \
V(LinkedHashBase_setData, LinkedHashBase_data) \
V(LinkedHashBase_setIndex, LinkedHashBase_index) \
V(WeakProperty_setKey, WeakProperty_key) \
@@ -934,10 +919,6 @@
case MethodRecognizer::kFfiAsExternalTypedDataFloat:
case MethodRecognizer::kFfiAsExternalTypedDataDouble:
case MethodRecognizer::kGetNativeField:
- case MethodRecognizer::kFinalizerBase_exchangeEntriesCollectedWithNull:
- case MethodRecognizer::kFinalizerBase_getIsolateFinalizers:
- case MethodRecognizer::kFinalizerBase_setIsolate:
- case MethodRecognizer::kFinalizerBase_setIsolateFinalizers:
case MethodRecognizer::kObjectEquals:
case MethodRecognizer::kStringBaseLength:
case MethodRecognizer::kStringBaseIsEmpty:
@@ -1586,41 +1567,6 @@
body += LoadLocal(parsed_function_->RawParameterVariable(0));
body += MathUnary(MathUnaryInstr::kSqrt);
} break;
- case MethodRecognizer::kFinalizerBase_setIsolate:
- ASSERT_EQUAL(function.NumParameters(), 1);
- body += LoadLocal(parsed_function_->RawParameterVariable(0));
- body += LoadIsolate();
- body += ConvertUntaggedToUnboxed(kUnboxedIntPtr);
- body += StoreNativeField(Slot::FinalizerBase_isolate());
- body += NullConstant();
- break;
- case MethodRecognizer::kFinalizerBase_getIsolateFinalizers:
- ASSERT_EQUAL(function.NumParameters(), 0);
- body += LoadIsolate();
- body += RawLoadField(compiler::target::Isolate::finalizers_offset());
- break;
- case MethodRecognizer::kFinalizerBase_setIsolateFinalizers:
- ASSERT_EQUAL(function.NumParameters(), 1);
- body += LoadIsolate();
- body += LoadLocal(parsed_function_->RawParameterVariable(0));
- body += RawStoreField(compiler::target::Isolate::finalizers_offset());
- body += NullConstant();
- break;
- case MethodRecognizer::kFinalizerBase_exchangeEntriesCollectedWithNull:
- ASSERT_EQUAL(function.NumParameters(), 1);
- ASSERT(this->optimizing_);
- // This relies on being force-optimized to do an 'atomic' exchange w.r.t.
- // the GC.
- // As an alternative design we could introduce an ExchangeNativeFieldInstr
- // that uses the same machine code as std::atomic::exchange. Or we could
- // use an FfiNative to do that in C.
- body += LoadLocal(parsed_function_->RawParameterVariable(0));
- // No GC from here til StoreNativeField.
- body += LoadNativeField(Slot::FinalizerBase_entries_collected());
- body += LoadLocal(parsed_function_->RawParameterVariable(0));
- body += NullConstant();
- body += StoreNativeField(Slot::FinalizerBase_entries_collected());
- break;
#define IL_BODY(method, slot) \
case MethodRecognizer::k##method: \
ASSERT_EQUAL(function.NumParameters(), 1); \
@@ -4028,19 +3974,6 @@
return Fragment(unbox);
}
-Fragment FlowGraphBuilder::LoadThread() {
- LoadThreadInstr* instr = new (Z) LoadThreadInstr();
- Push(instr);
- return Fragment(instr);
-}
-
-Fragment FlowGraphBuilder::LoadIsolate() {
- Fragment body;
- body += LoadThread();
- body += LoadUntagged(compiler::target::Thread::isolate_offset());
- return body;
-}
-
// TODO(http://dartbug.com/47487): Support unboxed output value.
Fragment FlowGraphBuilder::BoolToInt() {
// TODO(http://dartbug.com/36855) Build IfThenElseInstr, instead of letting
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h
index 2a92d6a..03a18f6 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.h
+++ b/runtime/vm/compiler/frontend/kernel_to_il.h
@@ -276,12 +276,6 @@
// target representation.
Fragment UnboxTruncate(Representation to);
- // Loads the (untagged) thread address.
- Fragment LoadThread();
-
- // Loads the (untagged) isolate address.
- Fragment LoadIsolate();
-
// Converts a true to 1 and false to 0.
Fragment BoolToInt();
diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h
index 1676f7c..e8a7016 100644
--- a/runtime/vm/compiler/recognized_methods_list.h
+++ b/runtime/vm/compiler/recognized_methods_list.h
@@ -110,28 +110,6 @@
V(::, _sqrt, MathSqrt, 0x03183390) \
V(::, _exp, MathExp, 0x00f4ffd0) \
V(::, _log, MathLog, 0x09ae8462) \
- V(FinalizerBase, get:_allEntries, FinalizerBase_getAllEntries, 0xf03ff26b) \
- V(FinalizerBase, set:_allEntries, FinalizerBase_setAllEntries, 0x8f0920e8) \
- V(FinalizerBase, get:_detachments, FinalizerBase_getDetachments, 0x2f650f36) \
- V(FinalizerBase, set:_detachments, FinalizerBase_setDetachments, 0x788f1df3) \
- V(FinalizerBase, _exchangeEntriesCollectedWithNull, \
- FinalizerBase_exchangeEntriesCollectedWithNull, 0x6c9124fb) \
- V(FinalizerBase, _setIsolate, FinalizerBase_setIsolate, 0xbcf7db91) \
- V(FinalizerBase, get:_isolateFinalizers, FinalizerBase_getIsolateFinalizers, \
- 0x70f53b2b) \
- V(FinalizerBase, set:_isolateFinalizers, FinalizerBase_setIsolateFinalizers, \
- 0xb3e66928) \
- V(_FinalizerImpl, get:_callback, Finalizer_getCallback, 0x6f3d56bc) \
- V(_FinalizerImpl, set:_callback, Finalizer_setCallback, 0xc6aa96f9) \
- V(FinalizerEntry, get:value, FinalizerEntry_getValue, 0xf5c9b9d7) \
- V(FinalizerEntry, set:value, FinalizerEntry_setValue, 0x5501cc54) \
- V(FinalizerEntry, get:detach, FinalizerEntry_getDetach, 0x171cd968) \
- V(FinalizerEntry, set:detach, FinalizerEntry_setDetach, 0x7654ebe5) \
- V(FinalizerEntry, set:finalizer, FinalizerEntry_setFinalizer, 0x15cfefe9) \
- V(FinalizerEntry, get:token, FinalizerEntry_getToken, 0x04915a72) \
- V(FinalizerEntry, set:token, FinalizerEntry_setToken, 0x63c96cef) \
- V(FinalizerEntry, get:next, FinalizerEntry_getNext, 0x7102d7a4) \
- V(FinalizerEntry, set:next, FinalizerEntry_setNext, 0xd0b2ee61) \
V(Float32x4, _Float32x4FromDoubles, Float32x4FromDoubles, 0x1845792b) \
V(Float32x4, Float32x4.zero, Float32x4Zero, 0xd3b64002) \
V(Float32x4, _Float32x4Splat, Float32x4Splat, 0x13a552c3) \
diff --git a/runtime/vm/compiler/runtime_api.cc b/runtime/vm/compiler/runtime_api.cc
index d9ddcb3..9cc619d 100644
--- a/runtime/vm/compiler/runtime_api.cc
+++ b/runtime/vm/compiler/runtime_api.cc
@@ -439,10 +439,6 @@
return WeakProperty::InstanceSize();
case kWeakReferenceCid:
return WeakReference::InstanceSize();
- case kFinalizerCid:
- return Finalizer::InstanceSize();
- case kFinalizerEntryCid:
- return FinalizerEntry::InstanceSize();
case kByteBufferCid:
case kByteDataViewCid:
case kPointerCid:
diff --git a/runtime/vm/compiler/runtime_api.h b/runtime/vm/compiler/runtime_api.h
index 11d0013..f502d99 100644
--- a/runtime/vm/compiler/runtime_api.h
+++ b/runtime/vm/compiler/runtime_api.h
@@ -1045,34 +1045,6 @@
FINAL_CLASS();
};
-class FinalizerBase : public AllStatic {
- public:
- static word all_entries_offset();
- static word detachments_offset();
- static word entries_collected_offset();
- static word isolate_offset();
- FINAL_CLASS();
-};
-
-class Finalizer : public AllStatic {
- public:
- static word type_arguments_offset();
- static word callback_offset();
- static word InstanceSize();
- FINAL_CLASS();
-};
-
-class FinalizerEntry : public AllStatic {
- public:
- static word value_offset();
- static word detach_offset();
- static word token_offset();
- static word next_offset();
- static word finalizer_offset();
- static word InstanceSize();
- FINAL_CLASS();
-};
-
class MirrorReference : public AllStatic {
public:
static word InstanceSize();
@@ -1270,7 +1242,6 @@
static word current_tag_offset();
static word user_tag_offset();
static word ic_miss_code_offset();
- static word finalizers_offset();
#if !defined(PRODUCT)
static word single_step_offset();
#endif // !defined(PRODUCT)
diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h
index ee0e4c2..6f1d535 100644
--- a/runtime/vm/compiler/runtime_offsets_extracted.h
+++ b/runtime/vm/compiler/runtime_offsets_extracted.h
@@ -183,7 +183,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 24;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 28;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 40;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 32;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -191,7 +190,7 @@
IsolateGroup_shared_class_table_offset = 8;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 16;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 44;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 40;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 20;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 12;
static constexpr dart::compiler::target::word
@@ -220,12 +219,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -437,22 +436,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -535,8 +518,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -773,7 +754,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 56;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 80;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 64;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -781,7 +761,7 @@
IsolateGroup_shared_class_table_offset = 16;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 32;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 88;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 80;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 24;
static constexpr dart::compiler::target::word
@@ -810,12 +790,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -1033,22 +1013,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -1132,8 +1096,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -1368,7 +1330,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 24;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 28;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 40;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 32;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -1376,7 +1337,7 @@
IsolateGroup_shared_class_table_offset = 8;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 16;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 44;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 40;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 20;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 12;
static constexpr dart::compiler::target::word
@@ -1405,12 +1366,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -1622,22 +1583,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -1717,8 +1662,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -1955,7 +1898,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 56;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 80;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 64;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -1963,7 +1905,7 @@
IsolateGroup_shared_class_table_offset = 16;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 32;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 88;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 80;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 24;
static constexpr dart::compiler::target::word
@@ -1992,12 +1934,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -2215,22 +2157,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -2315,8 +2241,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -2551,7 +2475,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 56;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 80;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 64;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -2559,7 +2482,7 @@
IsolateGroup_shared_class_table_offset = 16;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 32;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 88;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 80;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 16;
static constexpr dart::compiler::target::word
@@ -2588,12 +2511,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -2811,22 +2734,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 32;
static constexpr dart::compiler::target::word Type_type_state_offset = 34;
static constexpr dart::compiler::target::word Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 36;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 24;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 36;
@@ -2910,8 +2817,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
32;
static constexpr dart::compiler::target::word Field_InstanceSize = 64;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 32;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 96;
@@ -3146,7 +3051,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 56;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 80;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 64;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -3154,7 +3058,7 @@
IsolateGroup_shared_class_table_offset = 16;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 32;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 88;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 80;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 16;
static constexpr dart::compiler::target::word
@@ -3183,12 +3087,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -3406,22 +3310,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 32;
static constexpr dart::compiler::target::word Type_type_state_offset = 34;
static constexpr dart::compiler::target::word Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 36;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 24;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 36;
@@ -3506,8 +3394,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
32;
static constexpr dart::compiler::target::word Field_InstanceSize = 64;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 32;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 96;
@@ -3742,7 +3628,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 24;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 28;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 40;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 32;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -3750,7 +3635,7 @@
IsolateGroup_shared_class_table_offset = 8;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 16;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 44;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 40;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 20;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 12;
static constexpr dart::compiler::target::word
@@ -3779,12 +3664,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -3996,22 +3881,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -4096,8 +3965,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -4334,7 +4201,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 56;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 80;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 64;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -4342,7 +4208,7 @@
IsolateGroup_shared_class_table_offset = 16;
static constexpr dart::compiler::target::word
IsolateGroup_cached_class_table_table_offset = 32;
-static constexpr dart::compiler::target::word Isolate_single_step_offset = 88;
+static constexpr dart::compiler::target::word Isolate_single_step_offset = 80;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word LinkedHashBase_data_offset = 24;
static constexpr dart::compiler::target::word
@@ -4371,12 +4237,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -4594,22 +4460,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -4694,8 +4544,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -4927,7 +4775,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 20;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 24;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 36;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 28;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -4963,12 +4810,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -5180,22 +5027,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -5278,8 +5109,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -5511,7 +5340,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 72;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -5547,12 +5375,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -5770,22 +5598,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -5869,8 +5681,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -6100,7 +5910,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 20;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 24;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 36;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 28;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -6136,12 +5945,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -6353,22 +6162,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -6448,8 +6241,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -6681,7 +6472,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 72;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -6717,12 +6507,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -6940,22 +6730,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -7040,8 +6814,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -7271,7 +7043,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 72;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -7307,12 +7078,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -7530,22 +7301,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 32;
static constexpr dart::compiler::target::word Type_type_state_offset = 34;
static constexpr dart::compiler::target::word Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 36;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 24;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 36;
@@ -7629,8 +7384,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
32;
static constexpr dart::compiler::target::word Field_InstanceSize = 64;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 32;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 96;
@@ -7860,7 +7613,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 72;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -7896,12 +7648,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -8119,22 +7871,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 32;
static constexpr dart::compiler::target::word Type_type_state_offset = 34;
static constexpr dart::compiler::target::word Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 36;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 20;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 24;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 36;
@@ -8219,8 +7955,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
32;
static constexpr dart::compiler::target::word Field_InstanceSize = 64;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 32;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 96;
@@ -8450,7 +8184,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 20;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 24;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 36;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 28;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
20;
@@ -8486,12 +8219,12 @@
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 164;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 120;
+ 160;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 116;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 184;
+ 180;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word PointerBase_data_offset = 4;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8;
@@ -8703,22 +8436,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 20;
static constexpr dart::compiler::target::word Type_type_state_offset = 22;
static constexpr dart::compiler::target::word Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 24;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 20;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 12;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 8;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 4;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 12;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 16;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 20;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 24;
@@ -8803,8 +8520,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
28;
static constexpr dart::compiler::target::word Field_InstanceSize = 60;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 28;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 88;
@@ -9036,7 +8751,6 @@
static constexpr dart::compiler::target::word Int32x4_value_offset = 8;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
-static constexpr dart::compiler::target::word Isolate_finalizers_offset = 72;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word IsolateGroup_object_store_offset =
40;
@@ -9072,12 +8786,12 @@
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
- 328;
-static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 240;
+ 320;
+static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 232;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
- 368;
+ 360;
static constexpr dart::compiler::target::word ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word PointerBase_data_offset = 8;
static constexpr dart::compiler::target::word Pointer_type_arguments_offset =
@@ -9295,22 +9009,6 @@
static constexpr dart::compiler::target::word Type_type_class_id_offset = 40;
static constexpr dart::compiler::target::word Type_type_state_offset = 42;
static constexpr dart::compiler::target::word Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word Finalizer_type_arguments_offset =
- 48;
-static constexpr dart::compiler::target::word Finalizer_callback_offset = 40;
-static constexpr dart::compiler::target::word FinalizerBase_all_entries_offset =
- 24;
-static constexpr dart::compiler::target::word FinalizerBase_detachments_offset =
- 16;
-static constexpr dart::compiler::target::word
- FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word FinalizerBase_isolate_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_value_offset = 8;
-static constexpr dart::compiler::target::word FinalizerEntry_detach_offset = 16;
-static constexpr dart::compiler::target::word FinalizerEntry_token_offset = 24;
-static constexpr dart::compiler::target::word FinalizerEntry_finalizer_offset =
- 32;
-static constexpr dart::compiler::target::word FinalizerEntry_next_offset = 40;
static constexpr dart::compiler::target::word FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
FunctionType_named_parameter_names_offset = 48;
@@ -9395,8 +9093,6 @@
static constexpr dart::compiler::target::word FfiTrampolineData_InstanceSize =
48;
static constexpr dart::compiler::target::word Field_InstanceSize = 96;
-static constexpr dart::compiler::target::word Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word FinalizerEntry_InstanceSize = 56;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Function_InstanceSize = 128;
@@ -9649,8 +9345,6 @@
24;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
28;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 40;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
32;
static constexpr dart::compiler::target::word
@@ -9660,7 +9354,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 16;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 44;
+ 40;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 20;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
12;
@@ -9695,13 +9389,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 164;
+ AOT_ObjectStore_double_type_offset = 160;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 120;
+ 116;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 184;
+ AOT_ObjectStore_string_type_offset = 180;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
12;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4;
@@ -9932,28 +9626,6 @@
20;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 22;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 24;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 8;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 20;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 24;
@@ -10048,9 +9720,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 28;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 28;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 44;
@@ -10313,8 +9982,6 @@
48;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
56;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 80;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
64;
static constexpr dart::compiler::target::word
@@ -10324,7 +9991,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 32;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 88;
+ 80;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
24;
@@ -10359,13 +10026,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -10597,28 +10264,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -10715,9 +10360,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
@@ -10983,8 +10625,6 @@
48;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
56;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 80;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
64;
static constexpr dart::compiler::target::word
@@ -10994,7 +10634,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 32;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 88;
+ 80;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
24;
@@ -11029,13 +10669,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -11267,28 +10907,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -11386,9 +11004,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
@@ -11650,8 +11265,6 @@
48;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
56;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 80;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
64;
static constexpr dart::compiler::target::word
@@ -11661,7 +11274,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 32;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 88;
+ 80;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
16;
@@ -11696,13 +11309,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -11934,28 +11547,6 @@
32;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 34;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 36;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 32;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 12;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 20;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 24;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 36;
@@ -12052,9 +11643,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 32;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 32;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 56;
@@ -12316,8 +11904,6 @@
48;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
56;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 80;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
64;
static constexpr dart::compiler::target::word
@@ -12327,7 +11913,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 32;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 88;
+ 80;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
16;
@@ -12362,13 +11948,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -12600,28 +12186,6 @@
32;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 34;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 36;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 32;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 12;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 20;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 24;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 36;
@@ -12719,9 +12283,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 32;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 32;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 56;
@@ -12983,8 +12544,6 @@
24;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
28;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 40;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
32;
static constexpr dart::compiler::target::word
@@ -12994,7 +12553,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 16;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 44;
+ 40;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 20;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
12;
@@ -13029,13 +12588,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 164;
+ AOT_ObjectStore_double_type_offset = 160;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 120;
+ 116;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 184;
+ AOT_ObjectStore_string_type_offset = 180;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
12;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4;
@@ -13266,28 +12825,6 @@
20;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 22;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 24;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 8;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 20;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 24;
@@ -13384,9 +12921,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 28;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 28;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 44;
@@ -13649,8 +13183,6 @@
48;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
56;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 80;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
64;
static constexpr dart::compiler::target::word
@@ -13660,7 +13192,7 @@
static constexpr dart::compiler::target::word
AOT_IsolateGroup_cached_class_table_table_offset = 32;
static constexpr dart::compiler::target::word AOT_Isolate_single_step_offset =
- 88;
+ 80;
static constexpr dart::compiler::target::word AOT_Isolate_user_tag_offset = 40;
static constexpr dart::compiler::target::word AOT_LinkedHashBase_data_offset =
24;
@@ -13695,13 +13227,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -13933,28 +13465,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -14052,9 +13562,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
@@ -14313,8 +13820,6 @@
20;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
24;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 36;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
28;
static constexpr dart::compiler::target::word
@@ -14357,13 +13862,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 164;
+ AOT_ObjectStore_double_type_offset = 160;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 120;
+ 116;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 184;
+ AOT_ObjectStore_string_type_offset = 180;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
12;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4;
@@ -14594,28 +14099,6 @@
20;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 22;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 24;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 8;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 20;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 24;
@@ -14710,9 +14193,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 28;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 28;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 44;
@@ -14970,8 +14450,6 @@
40;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
48;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 72;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
56;
static constexpr dart::compiler::target::word
@@ -15014,13 +14492,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -15252,28 +14730,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -15370,9 +14826,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
@@ -15633,8 +15086,6 @@
40;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
48;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 72;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
56;
static constexpr dart::compiler::target::word
@@ -15677,13 +15128,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -15915,28 +15366,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -16034,9 +15463,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
@@ -16293,8 +15719,6 @@
40;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
48;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 72;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
56;
static constexpr dart::compiler::target::word
@@ -16337,13 +15761,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -16575,28 +15999,6 @@
32;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 34;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 36;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 32;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 12;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 20;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 24;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 36;
@@ -16693,9 +16095,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 32;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 32;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 56;
@@ -16952,8 +16351,6 @@
40;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
48;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 72;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
56;
static constexpr dart::compiler::target::word
@@ -16996,13 +16393,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -17234,28 +16631,6 @@
32;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 34;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 35;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 36;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 32;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 24;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 12;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 20;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 24;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 40;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 36;
@@ -17353,9 +16728,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 32;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 40;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 32;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 56;
@@ -17612,8 +16984,6 @@
20;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
24;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 36;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
28;
static constexpr dart::compiler::target::word
@@ -17656,13 +17026,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 164;
+ AOT_ObjectStore_double_type_offset = 160;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 120;
+ 116;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 184;
+ AOT_ObjectStore_string_type_offset = 180;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 108;
+ 104;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
12;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4;
@@ -17893,28 +17263,6 @@
20;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 22;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 23;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 24;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 20;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 8;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 4;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 12;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 20;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 28;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 24;
@@ -18011,9 +17359,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 28;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 28;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 28;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 44;
@@ -18271,8 +17616,6 @@
40;
static constexpr dart::compiler::target::word AOT_Isolate_default_tag_offset =
48;
-static constexpr dart::compiler::target::word AOT_Isolate_finalizers_offset =
- 72;
static constexpr dart::compiler::target::word AOT_Isolate_ic_miss_code_offset =
56;
static constexpr dart::compiler::target::word
@@ -18315,13 +17658,13 @@
static constexpr dart::compiler::target::word
AOT_NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_double_type_offset = 328;
+ AOT_ObjectStore_double_type_offset = 320;
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
- 240;
+ 232;
static constexpr dart::compiler::target::word
- AOT_ObjectStore_string_type_offset = 368;
+ AOT_ObjectStore_string_type_offset = 360;
static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset =
- 216;
+ 208;
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
16;
static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8;
@@ -18553,28 +17896,6 @@
40;
static constexpr dart::compiler::target::word AOT_Type_type_state_offset = 42;
static constexpr dart::compiler::target::word AOT_Type_nullability_offset = 43;
-static constexpr dart::compiler::target::word
- AOT_Finalizer_type_arguments_offset = 48;
-static constexpr dart::compiler::target::word AOT_Finalizer_callback_offset =
- 40;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_all_entries_offset = 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_detachments_offset = 16;
-static constexpr dart::compiler::target::word
- AOT_FinalizerBase_entries_collected_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerBase_isolate_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_value_offset =
- 8;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_detach_offset =
- 16;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_token_offset =
- 24;
-static constexpr dart::compiler::target::word
- AOT_FinalizerEntry_finalizer_offset = 32;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_next_offset =
- 40;
static constexpr dart::compiler::target::word AOT_FunctionType_hash_offset = 56;
static constexpr dart::compiler::target::word
AOT_FunctionType_named_parameter_names_offset = 48;
@@ -18672,9 +17993,6 @@
static constexpr dart::compiler::target::word
AOT_FfiTrampolineData_InstanceSize = 48;
static constexpr dart::compiler::target::word AOT_Field_InstanceSize = 80;
-static constexpr dart::compiler::target::word AOT_Finalizer_InstanceSize = 56;
-static constexpr dart::compiler::target::word AOT_FinalizerEntry_InstanceSize =
- 56;
static constexpr dart::compiler::target::word AOT_Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Function_InstanceSize = 80;
diff --git a/runtime/vm/compiler/runtime_offsets_list.h b/runtime/vm/compiler/runtime_offsets_list.h
index 7f4c232..cbd470c 100644
--- a/runtime/vm/compiler/runtime_offsets_list.h
+++ b/runtime/vm/compiler/runtime_offsets_list.h
@@ -149,7 +149,6 @@
FIELD(Int32x4, value_offset) \
FIELD(Isolate, current_tag_offset) \
FIELD(Isolate, default_tag_offset) \
- FIELD(Isolate, finalizers_offset) \
FIELD(Isolate, ic_miss_code_offset) \
FIELD(IsolateGroup, object_store_offset) \
FIELD(IsolateGroup, shared_class_table_offset) \
@@ -301,17 +300,6 @@
FIELD(Type, type_class_id_offset) \
FIELD(Type, type_state_offset) \
FIELD(Type, nullability_offset) \
- FIELD(Finalizer, type_arguments_offset) \
- FIELD(Finalizer, callback_offset) \
- FIELD(FinalizerBase, all_entries_offset) \
- FIELD(FinalizerBase, detachments_offset) \
- FIELD(FinalizerBase, entries_collected_offset) \
- FIELD(FinalizerBase, isolate_offset) \
- FIELD(FinalizerEntry, value_offset) \
- FIELD(FinalizerEntry, detach_offset) \
- FIELD(FinalizerEntry, token_offset) \
- FIELD(FinalizerEntry, finalizer_offset) \
- FIELD(FinalizerEntry, next_offset) \
FIELD(FunctionType, hash_offset) \
FIELD(FunctionType, named_parameter_names_offset) \
FIELD(FunctionType, nullability_offset) \
@@ -374,8 +362,6 @@
SIZEOF(ExternalTypedData, InstanceSize, UntaggedExternalTypedData) \
SIZEOF(FfiTrampolineData, InstanceSize, UntaggedFfiTrampolineData) \
SIZEOF(Field, InstanceSize, UntaggedField) \
- SIZEOF(Finalizer, InstanceSize, UntaggedFinalizer) \
- SIZEOF(FinalizerEntry, InstanceSize, UntaggedFinalizerEntry) \
SIZEOF(Float32x4, InstanceSize, UntaggedFloat32x4) \
SIZEOF(Float64x2, InstanceSize, UntaggedFloat64x2) \
SIZEOF(Function, InstanceSize, UntaggedFunction) \
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 9042281..b2fd4b3 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -370,7 +370,6 @@
Object::InitNullAndBool(vm_isolate_->group());
vm_isolate_->isolate_group_->set_object_store(new ObjectStore());
vm_isolate_->isolate_object_store()->Init();
- vm_isolate_->finalizers_ = GrowableObjectArray::null();
Object::Init(vm_isolate_->group());
OffsetsTable::Init();
ArgumentsDescriptor::Init();
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 501568e..46df59f 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -677,14 +677,18 @@
}
ObjectPtr DartLibraryCalls::LookupHandler(Dart_Port port_id) {
- Thread* const thread = Thread::Current();
- Zone* const zone = thread->zone();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
const auto& function = Function::Handle(
zone, thread->isolate_group()->object_store()->lookup_port_handler());
+ const int kNumArguments = 1;
ASSERT(!function.IsNull());
Array& args = Array::Handle(
zone, thread->isolate()->isolate_object_store()->dart_args_1());
- ASSERT(!args.IsNull());
+ if (args.IsNull()) {
+ args = Array::New(kNumArguments);
+ thread->isolate()->isolate_object_store()->set_dart_args_1(args);
+ }
args.SetAt(0, Integer::Handle(zone, Integer::New(port_id)));
const Object& result =
Object::Handle(zone, DartEntry::InvokeFunction(function, args));
@@ -702,7 +706,24 @@
return result.ptr();
}
-static void DebuggerSetResumeIfStepping(Isolate* isolate) {
+ObjectPtr DartLibraryCalls::HandleMessage(Dart_Port port_id,
+ const Instance& message) {
+ auto thread = Thread::Current();
+ auto zone = thread->zone();
+ auto isolate = thread->isolate();
+ auto object_store = thread->isolate_group()->object_store();
+ const auto& function =
+ Function::Handle(zone, object_store->handle_message_function());
+ const int kNumArguments = 2;
+ ASSERT(!function.IsNull());
+ Array& args =
+ Array::Handle(zone, isolate->isolate_object_store()->dart_args_2());
+ if (args.IsNull()) {
+ args = Array::New(kNumArguments);
+ isolate->isolate_object_store()->set_dart_args_2(args);
+ }
+ args.SetAt(0, Integer::Handle(zone, Integer::New(port_id)));
+ args.SetAt(1, message);
#if !defined(PRODUCT)
if (isolate->debugger()->IsStepping()) {
// If the isolate is being debugged and the debugger was stepping
@@ -711,47 +732,6 @@
isolate->debugger()->SetResumeAction(Debugger::kStepInto);
}
#endif
-}
-
-ObjectPtr DartLibraryCalls::HandleMessage(Dart_Port port_id,
- const Instance& message) {
- auto* const thread = Thread::Current();
- auto* const zone = thread->zone();
- auto* const isolate = thread->isolate();
- auto* const object_store = thread->isolate_group()->object_store();
- const auto& function =
- Function::Handle(zone, object_store->handle_message_function());
- ASSERT(!function.IsNull());
- Array& args =
- Array::Handle(zone, isolate->isolate_object_store()->dart_args_2());
- ASSERT(!args.IsNull());
- args.SetAt(0, Integer::Handle(zone, Integer::New(port_id)));
- args.SetAt(1, message);
- DebuggerSetResumeIfStepping(isolate);
- const Object& handler =
- Object::Handle(zone, DartEntry::InvokeFunction(function, args));
- return handler.ptr();
-}
-
-ObjectPtr DartLibraryCalls::HandleFinalizerMessage(
- const FinalizerBase& finalizer) {
- if (FLAG_trace_finalizers) {
- THR_Print("Running finalizer %p callback on isolate %p\n",
- finalizer.ptr()->untag(), finalizer.isolate());
- }
-
- auto* const thread = Thread::Current();
- auto* const zone = thread->zone();
- auto* const isolate = thread->isolate();
- auto* const object_store = thread->isolate_group()->object_store();
- const auto& function =
- Function::Handle(zone, object_store->handle_finalizer_message_function());
- ASSERT(!function.IsNull());
- Array& args =
- Array::Handle(zone, isolate->isolate_object_store()->dart_args_1());
- ASSERT(!args.IsNull());
- args.SetAt(0, finalizer);
- DebuggerSetResumeIfStepping(isolate);
const Object& handler =
Object::Handle(zone, DartEntry::InvokeFunction(function, args));
return handler.ptr();
diff --git a/runtime/vm/dart_entry.h b/runtime/vm/dart_entry.h
index c5cc2be..4f650a8 100644
--- a/runtime/vm/dart_entry.h
+++ b/runtime/vm/dart_entry.h
@@ -36,8 +36,8 @@
intptr_t TypeArgsLen() const; // 0 if no type argument vector is passed.
intptr_t FirstArgIndex() const { return TypeArgsLen() > 0 ? 1 : 0; }
intptr_t CountWithTypeArgs() const { return FirstArgIndex() + Count(); }
- intptr_t Count() const; // Excluding type arguments vector.
- intptr_t Size() const; // Excluding type arguments vector.
+ intptr_t Count() const; // Excluding type arguments vector.
+ intptr_t Size() const; // Excluding type arguments vector.
intptr_t SizeWithTypeArgs() const { return FirstArgIndex() + Size(); }
intptr_t PositionalCount() const; // Excluding type arguments vector.
intptr_t NamedCount() const { return Count() - PositionalCount(); }
@@ -292,12 +292,10 @@
// handler for this port id.
static ObjectPtr HandleMessage(Dart_Port port_id, const Instance& message);
- // Invokes the finalizer to run its callbacks.
- static ObjectPtr HandleFinalizerMessage(const FinalizerBase& finalizer);
-
// Returns a list of open ReceivePorts.
static ObjectPtr LookupOpenPorts();
+
// Returns null on success, an ErrorPtr on failure.
static ObjectPtr DrainMicrotaskQueue();
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h
index 68b49e4..1e77f74 100644
--- a/runtime/vm/flag_list.h
+++ b/runtime/vm/flag_list.h
@@ -202,7 +202,6 @@
"Generate code for a generic CPU, unknown at compile time") \
D(trace_cha, bool, false, "Trace CHA operations") \
R(trace_field_guards, false, bool, false, "Trace changes in field's cids.") \
- D(trace_finalizers, bool, false, "Traces finalizers.") \
D(trace_ic, bool, false, "Trace IC handling") \
D(trace_ic_miss_in_optimized, bool, false, \
"Trace IC miss in optimized code") \
diff --git a/runtime/vm/heap/gc_shared.cc b/runtime/vm/heap/gc_shared.cc
deleted file mode 100644
index 0941bd6..0000000
--- a/runtime/vm/heap/gc_shared.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Logic shared between the Scavenger and Marker.
-
-#include "vm/heap/gc_shared.h"
-
-#include "vm/dart_api_state.h"
-#include "vm/heap/scavenger.h"
-#include "vm/log.h"
-#include "vm/message_handler.h"
-#include "vm/object.h"
-
-namespace dart {
-
-void GCLinkedLists::Clear() {
-#define FOREACH(type, var) var.Clear();
- GC_LINKED_LIST(FOREACH)
-#undef FOREACH
-}
-
-bool GCLinkedLists::IsEmpty() {
-#define FOREACH(type, var) \
- if (!var.IsEmpty()) { \
- return false; \
- }
- GC_LINKED_LIST(FOREACH)
- return true;
-#undef FOREACH
-}
-
-void GCLinkedLists::FlushInto(GCLinkedLists* to) {
-#define FOREACH(type, var) var.FlushInto(&to->var);
- GC_LINKED_LIST(FOREACH)
-#undef FOREACH
-}
-
-} // namespace dart
diff --git a/runtime/vm/heap/gc_shared.h b/runtime/vm/heap/gc_shared.h
deleted file mode 100644
index 3320868..0000000
--- a/runtime/vm/heap/gc_shared.h
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Logic shared between the Scavenger and Marker.
-
-#ifndef RUNTIME_VM_HEAP_GC_SHARED_H_
-#define RUNTIME_VM_HEAP_GC_SHARED_H_
-
-#include "vm/compiler/runtime_api.h"
-#if defined(SHOULD_NOT_INCLUDE_RUNTIME)
-#error "Should not include runtime"
-#endif
-
-#include "vm/dart_api_state.h"
-#include "vm/heap/scavenger.h"
-#include "vm/log.h"
-#include "vm/message_handler.h"
-#include "vm/object.h"
-
-namespace dart {
-
-// These object types have a linked list chaining all pending objects when
-// processing these in the GC.
-// The field should not be visited by pointer visitors.
-// The field should only be set during a GC.
-//
-// Macro params:
-// - type
-// - variable name
-#define GC_LINKED_LIST(V) \
- V(WeakProperty, weak_properties) \
- V(WeakReference, weak_references) \
- V(FinalizerEntry, finalizer_entries)
-
-template <typename Type, typename PtrType>
-struct GCLinkedList {
- public:
- void Enqueue(PtrType ptr) {
- ptr->untag()->next_seen_by_gc_ = head;
- if (head == Type::null()) {
- tail = ptr;
- }
- head = ptr;
- }
-
- void FlushInto(GCLinkedList<Type, PtrType>* to) {
- if (to->head == Type::null()) {
- ASSERT(to->tail == Type::null());
- to->head = head;
- to->tail = tail;
- } else {
- ASSERT(to->tail != Type::null());
- ASSERT(to->tail->untag()->next_seen_by_gc() == Type::null());
- to->tail->untag()->next_seen_by_gc_ = head;
- to->tail = tail;
- }
- Clear();
- }
-
- PtrType Clear() {
- PtrType return_value = head;
- head = Type::null();
- tail = Type::null();
- return return_value;
- }
-
- bool IsEmpty() { return head == Type::null() && tail == Type::null(); }
-
- private:
- PtrType head = Type::null();
- PtrType tail = Type::null();
-};
-
-struct GCLinkedLists {
- public:
- void Clear();
- bool IsEmpty();
- void FlushInto(GCLinkedLists* to);
-
-#define FOREACH(type, var) GCLinkedList<type, type##Ptr> var;
- GC_LINKED_LIST(FOREACH)
-#undef FOREACH
-};
-
-#ifdef DEBUG
-#define TRACE_FINALIZER(format, ...) \
- if (FLAG_trace_finalizers) { \
- THR_Print("%s %p " format "\n", visitor->kName, visitor, __VA_ARGS__); \
- }
-#else
-#define TRACE_FINALIZER(format, ...)
-#endif
-
-// This function processes all finalizer entries discovered by a scavenger or
-// marker. If an entry is referencing an object that is going to die, such entry
-// is cleared and enqueued in the respective finalizer.
-//
-// Finalizer entries belonging to unreachable finalizer entries do not get
-// processed, so the callback will not be called for these finalizers.
-//
-// For more documentation see runtime/docs/gc.md.
-//
-// |GCVisitorType| is a concrete type implementing either marker or scavenger.
-// It is expected to provide |SetNullIfCollected| method for clearing fields
-// referring to dead objects and |kName| field which contains visitor name for
-// tracing output.
-template <typename GCVisitorType>
-void MournFinalized(GCVisitorType* visitor) {
- FinalizerEntryPtr current_entry = visitor->delayed_.finalizer_entries.Clear();
- while (current_entry != FinalizerEntry::null()) {
- TRACE_FINALIZER("Processing Entry %p", current_entry->untag());
- FinalizerEntryPtr next_entry =
- current_entry->untag()->next_seen_by_gc_.Decompress(
- current_entry->heap_base());
- current_entry->untag()->next_seen_by_gc_ = FinalizerEntry::null();
-
- uword heap_base = current_entry->heap_base();
- const bool value_collected_this_gc = GCVisitorType::SetNullIfCollected(
- heap_base, ¤t_entry->untag()->value_);
- GCVisitorType::SetNullIfCollected(heap_base,
- ¤t_entry->untag()->detach_);
- GCVisitorType::SetNullIfCollected(heap_base,
- ¤t_entry->untag()->finalizer_);
-
- ObjectPtr token_object = current_entry->untag()->token();
- // See sdk/lib/_internal/vm/lib/internal_patch.dart FinalizerBase.detach.
- const bool is_detached = token_object == current_entry;
-
- if (value_collected_this_gc && !is_detached) {
- FinalizerBasePtr finalizer = current_entry->untag()->finalizer();
-
- if (finalizer.IsRawNull()) {
- TRACE_FINALIZER("Value collected entry %p finalizer null",
- current_entry->untag());
-
- // Do nothing, the finalizer has been GCed.
- } else if (finalizer.IsFinalizer()) {
- TRACE_FINALIZER("Value collected entry %p finalizer %p",
- current_entry->untag(), finalizer->untag());
-
- FinalizerPtr finalizer_dart = static_cast<FinalizerPtr>(finalizer);
- // Move entry to entries collected and current head of that list as
- // the next element. Using a atomic exchange satisfies concurrency
- // between the parallel GC tasks.
- // We rely on the fact that the mutator thread is not running to avoid
- // races between GC and mutator modifying Finalizer.entries_collected.
- //
- // We only run in serial marker or in the finalize step in the marker,
- // both are in safepoint.
- // The main scavenger worker is at safepoint, the other scavenger
- // workers are are not, but they bypass safepoint because the main
- // worker is at a safepoint already.
- ASSERT(Thread::Current()->IsAtSafepoint() ||
- Thread::Current()->BypassSafepoints());
-
- FinalizerEntryPtr previous_head =
- finalizer_dart->untag()->exchange_entries_collected(current_entry);
- current_entry->untag()->set_next(previous_head);
- const bool first_entry = previous_head.IsRawNull();
- // Schedule calling Dart finalizer.
- if (first_entry) {
- Isolate* isolate = finalizer->untag()->isolate_;
- if (isolate == nullptr) {
- TRACE_FINALIZER(
- "Not scheduling finalizer %p callback on isolate null",
- finalizer->untag());
- } else {
- TRACE_FINALIZER("Scheduling finalizer %p callback on isolate %p",
- finalizer->untag(), isolate);
-
- PersistentHandle* handle =
- isolate->group()->api_state()->AllocatePersistentHandle();
- handle->set_ptr(finalizer);
- MessageHandler* message_handler = isolate->message_handler();
- message_handler->PostMessage(
- Message::New(handle, Message::kNormalPriority),
- /*before_events*/ false);
- }
- }
- } else {
- // TODO(http://dartbug.com/47777): Implement NativeFinalizer.
- UNREACHABLE();
- }
- }
-
- current_entry = next_entry;
- }
-}
-
-#undef TRACE_FINALIZER
-
-} // namespace dart
-
-#endif // RUNTIME_VM_HEAP_GC_SHARED_H_
diff --git a/runtime/vm/heap/heap_sources.gni b/runtime/vm/heap/heap_sources.gni
index a8e8d99..de6d25e 100644
--- a/runtime/vm/heap/heap_sources.gni
+++ b/runtime/vm/heap/heap_sources.gni
@@ -11,8 +11,6 @@
"compactor.h",
"freelist.cc",
"freelist.h",
- "gc_shared.cc",
- "gc_shared.h",
"heap.cc",
"heap.h",
"marker.cc",
diff --git a/runtime/vm/heap/marker.cc b/runtime/vm/heap/marker.cc
index f760b67..3309815 100644
--- a/runtime/vm/heap/marker.cc
+++ b/runtime/vm/heap/marker.cc
@@ -4,12 +4,9 @@
#include "vm/heap/marker.h"
-#include "platform/assert.h"
#include "platform/atomic.h"
#include "vm/allocation.h"
#include "vm/dart_api_state.h"
-#include "vm/flags.h"
-#include "vm/heap/gc_shared.h"
#include "vm/heap/pages.h"
#include "vm/heap/pointer_block.h"
#include "vm/isolate.h"
@@ -17,12 +14,10 @@
#include "vm/object_id_ring.h"
#include "vm/raw_object.h"
#include "vm/stack_frame.h"
-#include "vm/tagged_pointer.h"
#include "vm/thread_barrier.h"
#include "vm/thread_pool.h"
#include "vm/thread_registry.h"
#include "vm/timeline.h"
-#include "vm/token.h"
#include "vm/visitor.h"
namespace dart {
@@ -39,35 +34,34 @@
page_space_(page_space),
work_list_(marking_stack),
deferred_work_list_(deferred_marking_stack),
+ delayed_weak_properties_(WeakProperty::null()),
+ delayed_weak_properties_tail_(WeakProperty::null()),
+ delayed_weak_references_(WeakReference::null()),
+ delayed_weak_references_tail_(WeakReference::null()),
marked_bytes_(0),
marked_micros_(0) {
ASSERT(thread_->isolate_group() == isolate_group);
}
- ~MarkingVisitorBase() { ASSERT(delayed_.IsEmpty()); }
-
-#ifdef DEBUG
- const char* kName = "Marker";
-#endif
+ ~MarkingVisitorBase() {
+ ASSERT(delayed_weak_properties_ == WeakProperty::null());
+ ASSERT(delayed_weak_references_ == WeakReference::null());
+ }
uintptr_t marked_bytes() const { return marked_bytes_; }
int64_t marked_micros() const { return marked_micros_; }
void AddMicros(int64_t micros) { marked_micros_ += micros; }
- bool IsMarked(ObjectPtr raw) {
- ASSERT(raw->IsHeapObject());
- ASSERT(raw->IsOldObject());
- return raw->untag()->IsMarked();
- }
-
bool ProcessPendingWeakProperties() {
bool more_to_mark = false;
- WeakPropertyPtr cur_weak = delayed_.weak_properties.Clear();
+ WeakPropertyPtr cur_weak = delayed_weak_properties_;
+ delayed_weak_properties_tail_ = delayed_weak_properties_ =
+ WeakProperty::null();
while (cur_weak != WeakProperty::null()) {
WeakPropertyPtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
ObjectPtr raw_key = cur_weak->untag()->key();
// Reset the next pointer in the weak property.
- cur_weak->untag()->next_seen_by_gc_ = WeakProperty::null();
+ cur_weak->untag()->next_ = WeakProperty::null();
if (raw_key->IsSmiOrNewObject() || raw_key->untag()->IsMarked()) {
ObjectPtr raw_val = cur_weak->untag()->value();
if (!raw_val->IsSmiOrNewObject() && !raw_val->untag()->IsMarked()) {
@@ -79,8 +73,7 @@
cur_weak->untag()->VisitPointersNonvirtual(this);
} else {
// Requeue this weak property to be handled later.
- ASSERT(IsMarked(cur_weak));
- delayed_.weak_properties.Enqueue(cur_weak);
+ EnqueueWeakProperty(cur_weak);
}
// Advance to next weak property in the queue.
cur_weak = next_weak;
@@ -132,9 +125,6 @@
} else if (class_id == kWeakReferenceCid) {
WeakReferencePtr raw_weak = static_cast<WeakReferencePtr>(raw_obj);
size = ProcessWeakReference(raw_weak);
- } else if (class_id == kFinalizerEntryCid) {
- FinalizerEntryPtr raw_weak = static_cast<FinalizerEntryPtr>(raw_obj);
- size = ProcessFinalizerEntry(raw_weak);
} else {
size = raw_obj->untag()->VisitPointersNonvirtual(this);
}
@@ -192,6 +182,34 @@
}
}
+ void EnqueueWeakProperty(WeakPropertyPtr raw_weak) {
+ ASSERT(raw_weak->IsHeapObject());
+ ASSERT(raw_weak->IsOldObject());
+ ASSERT(raw_weak->IsWeakProperty());
+ ASSERT(raw_weak->untag()->IsMarked());
+ ASSERT(raw_weak->untag()->next_ ==
+ CompressedWeakPropertyPtr(WeakProperty::null()));
+ raw_weak->untag()->next_ = delayed_weak_properties_;
+ if (delayed_weak_properties_ == WeakProperty::null()) {
+ delayed_weak_properties_tail_ = raw_weak;
+ }
+ delayed_weak_properties_ = raw_weak;
+ }
+
+ void EnqueueWeakReference(WeakReferencePtr raw_weak) {
+ ASSERT(raw_weak->IsHeapObject());
+ ASSERT(raw_weak->IsOldObject());
+ ASSERT(raw_weak->IsWeakReference());
+ ASSERT(raw_weak->untag()->IsMarked());
+ ASSERT(raw_weak->untag()->next_ ==
+ CompressedWeakReferencePtr(WeakReference::null()));
+ raw_weak->untag()->next_ = delayed_weak_references_;
+ if (delayed_weak_references_ == WeakReference::null()) {
+ delayed_weak_references_tail_ = raw_weak;
+ }
+ delayed_weak_references_ = raw_weak;
+ }
+
intptr_t ProcessWeakProperty(WeakPropertyPtr raw_weak) {
// The fate of the weak property is determined by its key.
ObjectPtr raw_key =
@@ -200,8 +218,7 @@
if (raw_key->IsHeapObject() && raw_key->IsOldObject() &&
!raw_key->untag()->IsMarked()) {
// Key was white. Enqueue the weak property.
- ASSERT(IsMarked(raw_weak));
- delayed_.weak_properties.Enqueue(raw_weak);
+ EnqueueWeakProperty(raw_weak);
return raw_weak->untag()->HeapSize();
}
// Key is gray or black. Make the weak property black.
@@ -218,8 +235,7 @@
!raw_target->untag()->IsMarked()) {
// Target was white. Enqueue the weak reference. It is potentially dead.
// It might still be made alive by weak properties in next rounds.
- ASSERT(IsMarked(raw_weak));
- delayed_.weak_references.Enqueue(raw_weak);
+ EnqueueWeakReference(raw_weak);
}
// Always visit the type argument.
ObjectPtr raw_type_arguments =
@@ -229,17 +245,6 @@
return raw_weak->untag()->HeapSize();
}
- intptr_t ProcessFinalizerEntry(FinalizerEntryPtr raw_entry) {
- ASSERT(IsMarked(raw_entry));
- delayed_.finalizer_entries.Enqueue(raw_entry);
- // Only visit token and next.
- MarkObject(LoadCompressedPointerIgnoreRace(&raw_entry->untag()->token_)
- .Decompress(raw_entry->heap_base()));
- MarkObject(LoadCompressedPointerIgnoreRace(&raw_entry->untag()->next_)
- .Decompress(raw_entry->heap_base()));
- return raw_entry->untag()->HeapSize();
- }
-
void ProcessDeferredMarking() {
ObjectPtr raw_obj;
while ((raw_obj = deferred_work_list_.Pop()) != nullptr) {
@@ -274,15 +279,15 @@
void FinalizeMarking() {
work_list_.Finalize();
deferred_work_list_.Finalize();
- MournFinalized(this);
}
void MournWeakProperties() {
- WeakPropertyPtr cur_weak = delayed_.weak_properties.Clear();
+ WeakPropertyPtr cur_weak = delayed_weak_properties_;
+ delayed_weak_properties_ = WeakProperty::null();
while (cur_weak != WeakProperty::null()) {
WeakPropertyPtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
- cur_weak->untag()->next_seen_by_gc_ = WeakProperty::null();
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_ = WeakProperty::null();
RELEASE_ASSERT(!cur_weak->untag()->key()->untag()->IsMarked());
WeakProperty::Clear(cur_weak);
cur_weak = next_weak;
@@ -290,58 +295,72 @@
}
void MournWeakReferences() {
- WeakReferencePtr cur_weak = delayed_.weak_references.Clear();
+ WeakReferencePtr cur_weak = delayed_weak_references_;
+ delayed_weak_references_ = WeakReference::null();
while (cur_weak != WeakReference::null()) {
WeakReferencePtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
- cur_weak->untag()->next_seen_by_gc_ = WeakReference::null();
-
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_ = WeakReference::null();
// If we did not mark the target through a weak property in a later round,
// then the target is dead and we should clear it.
- SetNullIfCollected(cur_weak->heap_base(), &cur_weak->untag()->target_);
-
+ if (!cur_weak->untag()->target()->untag()->IsMarked()) {
+ WeakReference::Clear(cur_weak);
+ }
cur_weak = next_weak;
}
}
- // Returns whether the object referred to in `ptr_address` was GCed this GC.
- static bool SetNullIfCollected(uword heap_base,
- CompressedObjectPtr* ptr_address) {
- ObjectPtr raw = ptr_address->Decompress(heap_base);
- if (raw.IsRawNull()) {
- // Object already null before this GC.
- return false;
- }
- if (raw.IsNewObject()) {
- // Object not touched during this GC.
- return false;
- }
- if (raw->untag()->IsMarked()) {
- return false;
- }
- *ptr_address = Object::null();
- return true;
- }
-
bool WaitForWork(RelaxedAtomic<uintptr_t>* num_busy) {
return work_list_.WaitForWork(num_busy);
}
- void Flush(GCLinkedLists* global_list) {
+ void Flush(WeakPropertyPtr* weak_properties_head,
+ WeakPropertyPtr* weak_properties_tail,
+ WeakReferencePtr* weak_references_head,
+ WeakReferencePtr* weak_references_tail) {
work_list_.Flush();
deferred_work_list_.Flush();
- delayed_.FlushInto(global_list);
+
+ if (*weak_properties_head == WeakProperty::null()) {
+ *weak_properties_head = delayed_weak_properties_;
+ *weak_properties_tail = delayed_weak_properties_tail_;
+ } else {
+ (*weak_properties_tail)->untag()->next_ = delayed_weak_properties_;
+ *weak_properties_tail = delayed_weak_properties_tail_;
+ }
+ delayed_weak_properties_tail_ = delayed_weak_properties_ =
+ WeakProperty::null();
+
+ if (*weak_references_head == WeakReference::null()) {
+ *weak_references_head = delayed_weak_references_;
+ *weak_references_tail = delayed_weak_references_tail_;
+ } else {
+ (*weak_references_tail)->untag()->next_ = delayed_weak_references_;
+ *weak_references_tail = delayed_weak_references_tail_;
+ }
+ delayed_weak_references_tail_ = delayed_weak_references_ =
+ WeakReference::null();
}
- void Adopt(GCLinkedLists* other) {
- ASSERT(delayed_.IsEmpty());
- other->FlushInto(&delayed_);
+ void Adopt(WeakPropertyPtr weak_properties_head,
+ WeakPropertyPtr weak_properties_tail,
+ WeakReferencePtr weak_references_head,
+ WeakReferencePtr weak_references_tail) {
+ ASSERT(delayed_weak_properties_ == WeakProperty::null());
+ ASSERT(delayed_weak_properties_tail_ == WeakProperty::null());
+ ASSERT(delayed_weak_references_ == WeakReference::null());
+ ASSERT(delayed_weak_references_tail_ == WeakReference::null());
+ delayed_weak_properties_ = weak_properties_head;
+ delayed_weak_properties_tail_ = weak_properties_tail;
+ delayed_weak_references_ = weak_references_head;
+ delayed_weak_references_tail_ = weak_references_tail;
}
void AbandonWork() {
work_list_.AbandonWork();
deferred_work_list_.AbandonWork();
- delayed_.Clear();
+ delayed_weak_properties_ = WeakProperty::null();
+ delayed_weak_references_ = WeakReference::null();
}
private:
@@ -411,13 +430,13 @@
PageSpace* page_space_;
MarkerWorkList work_list_;
MarkerWorkList deferred_work_list_;
- GCLinkedLists delayed_;
+ WeakPropertyPtr delayed_weak_properties_;
+ WeakPropertyPtr delayed_weak_properties_tail_;
+ WeakReferencePtr delayed_weak_references_;
+ WeakReferencePtr delayed_weak_references_tail_;
uintptr_t marked_bytes_;
int64_t marked_micros_;
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
-
DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitorBase);
};
@@ -727,9 +746,6 @@
// Phase 3: Weak processing and statistics.
visitor_->MournWeakProperties();
visitor_->MournWeakReferences();
- // Don't MournFinalized here, do it on main thread, so that we don't have
- // to coordinate workers.
-
marker_->IterateWeakRoots(thread);
int64_t stop = OS::GetCurrentMonotonicMicros();
visitor_->AddMicros(stop - start);
@@ -968,7 +984,6 @@
visitor.FinalizeMarking();
visitor.MournWeakProperties();
visitor.MournWeakReferences();
- MournFinalized(&visitor);
IterateWeakRoots(thread);
// All marking done; detach code, etc.
int64_t stop = OS::GetCurrentMonotonicMicros();
@@ -983,7 +998,10 @@
RelaxedAtomic<uintptr_t> num_busy = 0;
// Phase 1: Iterate over roots and drain marking stack in tasks.
- GCLinkedLists global_list;
+ WeakPropertyPtr weak_properties_head = WeakProperty::null();
+ WeakPropertyPtr weak_properties_tail = WeakProperty::null();
+ WeakReferencePtr weak_references_head = WeakReference::null();
+ WeakReferencePtr weak_references_tail = WeakReference::null();
for (intptr_t i = 0; i < num_tasks; ++i) {
SyncMarkingVisitor* visitor = visitors_[i];
@@ -995,12 +1013,12 @@
&marking_stack_, &deferred_marking_stack_);
visitors_[i] = visitor;
}
-
// Move all work from local blocks to the global list. Any given
// visitor might not get to run if it fails to reach TryEnter soon
// enough, and we must fail to visit objects but they're sitting in
// such a visitor's local blocks.
- visitor->Flush(&global_list);
+ visitor->Flush(&weak_properties_head, &weak_properties_tail,
+ &weak_references_head, &weak_references_tail);
// Need to move weak property list too.
if (i < (num_tasks - 1)) {
@@ -1011,7 +1029,8 @@
ASSERT(result);
} else {
// Last worker is the main thread.
- visitor->Adopt(&global_list);
+ visitor->Adopt(weak_properties_head, weak_properties_tail,
+ weak_references_head, weak_references_tail);
ParallelMarkTask task(this, isolate_group_, &marking_stack_, barrier,
visitor, &num_busy);
task.RunEnteredIsolateGroup();
diff --git a/runtime/vm/heap/scavenger.cc b/runtime/vm/heap/scavenger.cc
index e7dcfc1..e8b433a 100644
--- a/runtime/vm/heap/scavenger.cc
+++ b/runtime/vm/heap/scavenger.cc
@@ -4,14 +4,11 @@
#include "vm/heap/scavenger.h"
-#include "platform/assert.h"
#include "platform/leak_sanitizer.h"
-#include "vm/class_id.h"
#include "vm/dart.h"
#include "vm/dart_api_state.h"
#include "vm/flag_list.h"
#include "vm/heap/become.h"
-#include "vm/heap/gc_shared.h"
#include "vm/heap/pages.h"
#include "vm/heap/pointer_block.h"
#include "vm/heap/safepoint.h"
@@ -23,7 +20,6 @@
#include "vm/object.h"
#include "vm/object_id_ring.h"
#include "vm/object_set.h"
-#include "vm/port.h"
#include "vm/stack_frame.h"
#include "vm/thread_barrier.h"
#include "vm/thread_registry.h"
@@ -135,12 +131,13 @@
freelist_(freelist),
bytes_promoted_(0),
visiting_old_object_(nullptr),
- promoted_list_(promotion_stack) {}
- ~ScavengerVisitorBase() { ASSERT(delayed_.IsEmpty()); }
-
-#ifdef DEBUG
- const char* kName = "Scavenger";
-#endif
+ promoted_list_(promotion_stack),
+ delayed_weak_properties_(WeakProperty::null()),
+ delayed_weak_references_(WeakReference::null()) {}
+ ~ScavengerVisitorBase() {
+ ASSERT(delayed_weak_properties_ == WeakProperty::null());
+ ASSERT(delayed_weak_references_ == WeakReference::null());
+ }
virtual void VisitTypedDataViewPointers(TypedDataViewPtr view,
CompressedObjectPtr* first,
@@ -302,7 +299,6 @@
MournWeakProperties();
MournOrUpdateWeakReferences();
- MournFinalized(this);
}
page_space_->ReleaseLock(freelist_);
thread_ = nullptr;
@@ -312,15 +308,13 @@
void AbandonWork() {
promoted_list_.AbandonWork();
- delayed_.Clear();
+ delayed_weak_properties_ = WeakProperty::null();
+ delayed_weak_references_ = WeakReference::null();
}
NewPage* head() const { return head_; }
NewPage* tail() const { return tail_; }
- static bool SetNullIfCollected(uword heap_base,
- CompressedObjectPtr* ptr_address);
-
private:
void UpdateStoreBuffer(ObjectPtr obj) {
ASSERT(obj->IsHeapObject());
@@ -517,13 +511,8 @@
inline void ProcessToSpace();
DART_FORCE_INLINE intptr_t ProcessCopied(ObjectPtr raw_obj);
inline void ProcessPromotedList();
-
- bool IsNotForwarding(ObjectPtr raw) {
- ASSERT(raw->IsHeapObject());
- ASSERT(raw->IsNewObject());
- return !IsForwarding(ReadHeaderRelaxed(raw));
- }
-
+ inline void EnqueueWeakProperty(WeakPropertyPtr raw_weak);
+ inline void EnqueueWeakReference(WeakReferencePtr raw_weak);
inline void MournWeakProperties();
inline void MournOrUpdateWeakReferences();
@@ -534,16 +523,15 @@
FreeList* freelist_;
intptr_t bytes_promoted_;
ObjectPtr visiting_old_object_;
+
PromotionWorkList promoted_list_;
- GCLinkedLists delayed_;
+ WeakPropertyPtr delayed_weak_properties_;
+ WeakReferencePtr delayed_weak_references_;
NewPage* head_ = nullptr;
NewPage* tail_ = nullptr; // Allocating from here.
NewPage* scan_ = nullptr; // Resolving from here.
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
-
DISALLOW_COPY_AND_ASSIGN(ScavengerVisitorBase);
};
@@ -1335,10 +1323,11 @@
// Finished this round of scavenging. Process the pending weak properties
// for which the keys have become reachable. Potentially this adds more
// objects to the to space.
- WeakPropertyPtr cur_weak = delayed_.weak_properties.Clear();
+ WeakPropertyPtr cur_weak = delayed_weak_properties_;
+ delayed_weak_properties_ = WeakProperty::null();
while (cur_weak != WeakProperty::null()) {
WeakPropertyPtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
// Promoted weak properties are not enqueued. So we can guarantee that
// we do not need to think about store barriers here.
ASSERT(cur_weak->IsNewObject());
@@ -1352,12 +1341,11 @@
ASSERT(from_->Contains(raw_addr));
uword header = ReadHeaderRelaxed(raw_key);
// Reset the next pointer in the weak property.
- cur_weak->untag()->next_seen_by_gc_ = WeakProperty::null();
+ cur_weak->untag()->next_ = WeakProperty::null();
if (IsForwarding(header)) {
cur_weak->untag()->VisitPointersNonvirtual(this);
} else {
- ASSERT(IsNotForwarding(cur_weak));
- delayed_.weak_properties.Enqueue(cur_weak);
+ EnqueueWeakProperty(cur_weak);
}
// Advance to next weak property in the queue.
cur_weak = next_weak;
@@ -1390,6 +1378,38 @@
}
template <bool parallel>
+void ScavengerVisitorBase<parallel>::EnqueueWeakProperty(
+ WeakPropertyPtr raw_weak) {
+ ASSERT(raw_weak->IsHeapObject());
+ ASSERT(raw_weak->IsNewObject());
+ ASSERT(raw_weak->IsWeakProperty());
+#if defined(DEBUG)
+ uword header = ReadHeaderRelaxed(raw_weak);
+ ASSERT(!IsForwarding(header));
+#endif // defined(DEBUG)
+ ASSERT(raw_weak->untag()->next_ ==
+ CompressedWeakPropertyPtr(WeakProperty::null()));
+ raw_weak->untag()->next_ = delayed_weak_properties_;
+ delayed_weak_properties_ = raw_weak;
+}
+
+template <bool parallel>
+void ScavengerVisitorBase<parallel>::EnqueueWeakReference(
+ WeakReferencePtr raw_weak) {
+ ASSERT(raw_weak->IsHeapObject());
+ ASSERT(raw_weak->IsNewObject());
+ ASSERT(raw_weak->IsWeakReference());
+#if defined(DEBUG)
+ uword header = ReadHeaderRelaxed(raw_weak);
+ ASSERT(!IsForwarding(header));
+#endif // defined(DEBUG)
+ ASSERT(raw_weak->untag()->next_ ==
+ CompressedWeakReferencePtr(WeakReference::null()));
+ raw_weak->untag()->next_ = delayed_weak_references_;
+ delayed_weak_references_ = raw_weak;
+}
+
+template <bool parallel>
intptr_t ScavengerVisitorBase<parallel>::ProcessCopied(ObjectPtr raw_obj) {
intptr_t class_id = raw_obj->GetClassId();
if (UNLIKELY(class_id == kWeakPropertyCid)) {
@@ -1400,8 +1420,7 @@
uword header = ReadHeaderRelaxed(raw_key);
if (!IsForwarding(header)) {
// Key is white. Enqueue the weak property.
- ASSERT(IsNotForwarding(raw_weak));
- delayed_.weak_properties.Enqueue(raw_weak);
+ EnqueueWeakProperty(raw_weak);
return raw_weak->untag()->HeapSize();
}
}
@@ -1415,8 +1434,7 @@
if (!IsForwarding(header)) {
// Target is white. Enqueue the weak reference. Always visit type
// arguments.
- ASSERT(IsNotForwarding(raw_weak));
- delayed_.weak_references.Enqueue(raw_weak);
+ EnqueueWeakReference(raw_weak);
#if !defined(DART_COMPRESSED_POINTERS)
ScavengePointer(&raw_weak->untag()->type_arguments_);
#else
@@ -1426,21 +1444,6 @@
return raw_weak->untag()->HeapSize();
}
}
- } else if (UNLIKELY(class_id == kFinalizerEntryCid)) {
- FinalizerEntryPtr raw_entry = static_cast<FinalizerEntryPtr>(raw_obj);
- ASSERT(IsNotForwarding(raw_entry));
- delayed_.finalizer_entries.Enqueue(raw_entry);
- // Only visit token and next.
-#if !defined(DART_COMPRESSED_POINTERS)
- ScavengePointer(&raw_entry->untag()->token_);
- ScavengePointer(&raw_entry->untag()->next_);
-#else
- ScavengeCompressedPointer(raw_entry->heap_base(),
- &raw_entry->untag()->token_);
- ScavengeCompressedPointer(raw_entry->heap_base(),
- &raw_entry->untag()->next_);
-#endif
- return raw_entry->untag()->HeapSize();
}
return raw_obj->untag()->VisitPointersNonvirtual(this);
}
@@ -1504,12 +1507,13 @@
// The queued weak properties at this point do not refer to reachable keys,
// so we clear their key and value fields.
- WeakPropertyPtr cur_weak = delayed_.weak_properties.Clear();
+ WeakPropertyPtr cur_weak = delayed_weak_properties_;
+ delayed_weak_properties_ = WeakProperty::null();
while (cur_weak != WeakProperty::null()) {
WeakPropertyPtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
// Reset the next pointer in the weak property.
- cur_weak->untag()->next_seen_by_gc_ = WeakProperty::null();
+ cur_weak->untag()->next_ = WeakProperty::null();
#if defined(DEBUG)
ObjectPtr raw_key = cur_weak->untag()->key();
@@ -1533,48 +1537,31 @@
// The queued weak references at this point either should have their target
// updated or should be cleared.
- WeakReferencePtr cur_weak = delayed_.weak_references.Clear();
+ WeakReferencePtr cur_weak = delayed_weak_references_;
+ delayed_weak_references_ = WeakReference::null();
while (cur_weak != WeakReference::null()) {
WeakReferencePtr next_weak =
- cur_weak->untag()->next_seen_by_gc_.Decompress(cur_weak->heap_base());
+ cur_weak->untag()->next_.Decompress(cur_weak->heap_base());
// Reset the next pointer in the weak reference.
- cur_weak->untag()->next_seen_by_gc_ = WeakReference::null();
+ cur_weak->untag()->next_ = WeakReference::null();
- // If we did not mark the target through a weak property in a later round,
- // then the target is dead and we should clear it.
- SetNullIfCollected(cur_weak->heap_base(), &cur_weak->untag()->target_);
+ ObjectPtr raw_target = cur_weak->untag()->target();
+ uword raw_addr = UntaggedObject::ToAddr(raw_target);
+ uword header = *reinterpret_cast<uword*>(raw_addr);
+ if (IsForwarding(header)) {
+ // Get the new location of the object.
+ cur_weak->untag()->target_ = ForwardedObj(header);
+ } else {
+ ASSERT(raw_target->IsHeapObject());
+ ASSERT(raw_target->IsNewObject());
+ WeakReference::Clear(cur_weak);
+ }
// Advance to next weak reference in the queue.
cur_weak = next_weak;
}
}
-// Returns whether the object referred to in `ptr_address` was GCed this GC.
-template <bool parallel>
-bool ScavengerVisitorBase<parallel>::SetNullIfCollected(
- uword heap_base,
- CompressedObjectPtr* ptr_address) {
- ObjectPtr raw = ptr_address->Decompress(heap_base);
- if (raw.IsRawNull()) {
- // Object already null before this GC.
- return false;
- }
- if (raw.IsOldObject()) {
- // Object not touched during this GC.
- return false;
- }
- uword header = *reinterpret_cast<uword*>(UntaggedObject::ToAddr(raw));
- if (IsForwarding(header)) {
- // Get the new location of the object.
- *ptr_address = ForwardedObj(header);
- return false;
- }
- ASSERT(raw->IsHeapObject());
- ASSERT(raw->IsNewObject());
- *ptr_address = Object::null();
- return true;
-}
-
void Scavenger::VisitObjectPointers(ObjectPointerVisitor* visitor) const {
ASSERT(Thread::Current()->IsAtSafepoint() ||
(Thread::Current()->task_kind() == Thread::kMarkerTask) ||
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 1190825..2f8c8cc 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1388,15 +1388,6 @@
}
}
}
- } else if (message->IsFinalizerInvocationRequest()) {
- const Object& msg_handler = Object::Handle(
- zone,
- DartLibraryCalls::HandleFinalizerMessage(FinalizerBase::Cast(msg)));
- if (msg_handler.IsError()) {
- status = ProcessUnhandledException(Error::Cast(msg_handler));
- } else {
- // The handler closure which was used to successfully handle the message.
- }
} else if (message->dest_port() == Message::kIllegalPort) {
// Check whether this is a delayed OOB message which needed handling as
// part of the regular message dispatch. All other messages are dropped on
@@ -1695,7 +1686,6 @@
default_tag_(UserTag::null()),
ic_miss_code_(Code::null()),
field_table_(new FieldTable(/*isolate=*/this)),
- finalizers_(GrowableObjectArray::null()),
isolate_group_(isolate_group),
isolate_object_store_(new IsolateObjectStore()),
#if !defined(DART_PRECOMPILED_RUNTIME)
@@ -2475,34 +2465,6 @@
}
}
- // Set live finalizers isolate to null, before deleting the message handler.
- // TODO(http://dartbug.com/47777): How to detect if the isolate field was ever
- // initialized beyond RAW_NULL?
- const auto& finalizers =
- GrowableObjectArray::Handle(stack_zone.GetZone(), finalizers_);
- if (!finalizers.IsNull()) {
- const intptr_t num_finalizers = finalizers.Length();
- auto& weak_reference = WeakReference::Handle(stack_zone.GetZone());
- auto& finalizer = FinalizerBase::Handle(stack_zone.GetZone());
- for (int i = 0; i < num_finalizers; i++) {
- weak_reference ^= finalizers.At(i);
- finalizer ^= weak_reference.target();
- if (!finalizer.IsNull()) {
- if (finalizer.isolate() == this) {
- if (FLAG_trace_finalizers) {
- THR_Print("Isolate %p Setting finalizer %p isolate to null\n", this,
- finalizer.ptr()->untag());
- }
- // Finalizer was not sent to another isolate with send and exit.
- finalizer.set_isolate(nullptr);
- } else {
- // TODO(http://dartbug.com/47777): Send and exit support.
- UNREACHABLE();
- }
- }
- }
- }
-
// Close all the ports owned by this isolate.
PortMap::ClosePorts(message_handler());
@@ -2609,6 +2571,7 @@
"--check-reloaded is enabled.\n");
}
}
+
#endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
// Then, proceed with low-level teardown.
@@ -2758,7 +2721,6 @@
visitor->VisitPointer(reinterpret_cast<ObjectPtr*>(&ic_miss_code_));
visitor->VisitPointer(reinterpret_cast<ObjectPtr*>(&tag_table_));
visitor->VisitPointer(reinterpret_cast<ObjectPtr*>(&sticky_error_));
- visitor->VisitPointer(reinterpret_cast<ObjectPtr*>(&finalizers_));
#if !defined(PRODUCT)
visitor->VisitPointer(
reinterpret_cast<ObjectPtr*>(&pending_service_extension_calls_));
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index bd1e9fb..e714838 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -1065,10 +1065,6 @@
void set_init_callback_data(void* value) { init_callback_data_ = value; }
void* init_callback_data() const { return init_callback_data_; }
- static intptr_t finalizers_offset() {
- return OFFSET_OF(Isolate, finalizers_);
- }
-
#if !defined(DART_PRECOMPILED_RUNTIME)
NativeCallbackTrampolines* native_callback_trampolines() {
return &native_callback_trampolines_;
@@ -1544,9 +1540,6 @@
UserTagPtr default_tag_;
CodePtr ic_miss_code_;
FieldTable* field_table_ = nullptr;
- // Used to clear out `UntaggedFinalizerBase::isolate_` pointers on isolate
- // shutdown to prevent usage of dangling pointers.
- GrowableObjectArrayPtr finalizers_;
bool single_step_ = false;
bool is_system_isolate_ = false;
// End accessed from generated code.
@@ -1658,7 +1651,7 @@
Dart_EnvironmentCallback environment_callback_ = nullptr;
Random random_;
Simulator* simulator_ = nullptr;
- Mutex mutex_; // Protects compiler stats.
+ Mutex mutex_; // Protects compiler stats.
MessageHandler* message_handler_ = nullptr;
intptr_t defer_finalization_count_ = 0;
DeoptContext* deopt_context_ = nullptr;
@@ -1734,7 +1727,7 @@
friend class ServiceIsolate;
friend class Thread;
friend class Timeline;
- friend class IsolateGroup; // reload_context_
+ friend class IsolateGroup; // reload_context_
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index f5e8986..0b1eb10 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -1300,8 +1300,7 @@
}
if (!Api::IsFfiEnabled() &&
target_library.url() == Symbols::DartFfi().ptr() &&
- library->url() != Symbols::DartCore().ptr() &&
- library->url() != Symbols::DartInternal().ptr()) {
+ library->url() != Symbols::DartCore().ptr()) {
H.ReportError(
"import of dart:ffi is not supported in the current Dart runtime");
}
diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
index d9d0680..0f2d2e4 100644
--- a/runtime/vm/message.cc
+++ b/runtime/vm/message.cc
@@ -45,20 +45,12 @@
ASSERT(IsPersistentHandle());
}
-Message::Message(PersistentHandle* handle, Priority priority)
- : dest_port_(ILLEGAL_PORT),
- payload_(handle),
- snapshot_length_(kFinalizerSnapshotLen),
- priority_(priority) {
- ASSERT(IsFinalizerInvocationRequest());
-}
-
Message::~Message() {
if (IsSnapshot()) {
free(payload_.snapshot_);
}
delete finalizable_data_;
- if (IsPersistentHandle() || IsFinalizerInvocationRequest()) {
+ if (IsPersistentHandle()) {
auto isolate_group = IsolateGroup::Current();
isolate_group->api_state()->FreePersistentHandle(
payload_.persistent_handle_);
diff --git a/runtime/vm/message.h b/runtime/vm/message.h
index 46064a9..4c82bdf 100644
--- a/runtime/vm/message.h
+++ b/runtime/vm/message.h
@@ -62,13 +62,8 @@
// the VM heap. This is indicated by setting the len_ field to 0.
Message(Dart_Port dest_port, ObjectPtr raw_obj, Priority priority);
- // A message sent from SendPort.send or SendPort.sendAndExit where sender and
- // receiver are in the same isolate group.
Message(Dart_Port dest_port, PersistentHandle* handle, Priority priority);
- // A message sent from GC to run a finalizer.
- Message(PersistentHandle* handle, Priority priority);
-
~Message();
template <typename... Args>
@@ -99,7 +94,7 @@
return payload_.raw_obj_;
}
PersistentHandle* persistent_handle() const {
- ASSERT(IsPersistentHandle() || IsFinalizerInvocationRequest());
+ ASSERT(IsPersistentHandle());
return payload_.persistent_handle_;
}
Priority priority() const { return priority_; }
@@ -108,9 +103,7 @@
// of at the top of the message loop. Control messages from dart:isolate or
// vm-service requests.
bool IsOOB() const { return priority_ == Message::kOOBPriority; }
- bool IsSnapshot() const {
- return !IsRaw() && !IsPersistentHandle() && !IsFinalizerInvocationRequest();
- }
+ bool IsSnapshot() const { return !IsRaw() && !IsPersistentHandle(); }
// A message whose object is an immortal object from the vm-isolate's heap.
bool IsRaw() const { return snapshot_length_ == 0; }
// A message sent from SendPort.send or SendPort.sendAndExit where sender and
@@ -118,10 +111,6 @@
bool IsPersistentHandle() const {
return snapshot_length_ == kPersistentHandleSnapshotLen;
}
- // A message sent from GC to run a finalizer.
- bool IsFinalizerInvocationRequest() const {
- return snapshot_length_ == kFinalizerSnapshotLen;
- }
void DropFinalizers() {
if (finalizable_data_ != nullptr) {
@@ -135,7 +124,6 @@
private:
static intptr_t const kPersistentHandleSnapshotLen = -1;
- static intptr_t const kFinalizerSnapshotLen = -2;
friend class MessageQueue;
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index 228c745..715641b 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -211,8 +211,6 @@
Thread* thread() const { return Thread::Current(); }
private:
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
friend class PortMap;
friend class MessageHandlerTestPeer;
friend class MessageHandlerTask;
diff --git a/runtime/vm/message_snapshot.cc b/runtime/vm/message_snapshot.cc
index a5e5d7a..22de126 100644
--- a/runtime/vm/message_snapshot.cc
+++ b/runtime/vm/message_snapshot.cc
@@ -3916,11 +3916,6 @@
ObjectPtr ReadMessage(Thread* thread, Message* message) {
if (message->IsRaw()) {
return message->raw_obj();
- } else if (message->IsFinalizerInvocationRequest()) {
- PersistentHandle* handle = message->persistent_handle();
- Object& msg_obj = Object::Handle(thread->zone(), handle->ptr());
- ASSERT(msg_obj.IsFinalizer());
- return msg_obj.ptr();
} else if (message->IsPersistentHandle()) {
return ReadObjectGraphCopyMessage(thread, message->persistent_handle());
} else {
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6a96faf..fe33347 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -118,7 +118,7 @@
cpp_vtable Object::builtin_vtables_[kNumPredefinedCids] = {};
-// These are initialized to a value that will force an illegal memory access if
+// These are initialized to a value that will force a illegal memory access if
// they are being used.
#if defined(RAW_NULL)
#error RAW_NULL should not be defined.
@@ -2341,14 +2341,6 @@
pending_classes.Add(cls);
RegisterClass(cls, Symbols::FfiDynamicLibrary(), lib);
- cls = Class::New<Finalizer, RTN::Finalizer>(isolate_group);
- cls.set_type_arguments_field_offset(
- Finalizer::type_arguments_offset(),
- RTN::Finalizer::type_arguments_offset());
- cls.set_num_type_arguments_unsafe(1);
- object_store->set_finalizer_class(cls);
- RegisterPrivateClass(cls, Symbols::_FinalizerImpl(), core_lib);
-
// Pre-register the internal library so we can place the vm class
// FinalizerEntry there rather than the core library.
lib = Library::LookupLibrary(thread, Symbols::DartInternal());
@@ -2361,10 +2353,6 @@
ASSERT(!lib.IsNull());
ASSERT(lib.ptr() == Library::InternalLibrary());
- cls = Class::New<FinalizerEntry, RTN::FinalizerEntry>(isolate_group);
- object_store->set_finalizer_entry_class(cls);
- RegisterClass(cls, Symbols::FinalizerEntry(), lib);
-
// Finish the initialization by compiling the bootstrap scripts containing
// the base interfaces and the implementation of the internal classes.
const Error& error = Error::Handle(
@@ -2532,10 +2520,6 @@
object_store->set_weak_property_class(cls);
cls = Class::New<WeakReference, RTN::WeakReference>(isolate_group);
object_store->set_weak_reference_class(cls);
- cls = Class::New<Finalizer, RTN::Finalizer>(isolate_group);
- object_store->set_finalizer_class(cls);
- cls = Class::New<FinalizerEntry, RTN::FinalizerEntry>(isolate_group);
- object_store->set_finalizer_entry_class(cls);
cls = Class::New<MirrorReference, RTN::MirrorReference>(isolate_group);
cls = Class::New<UserTag, RTN::UserTag>(isolate_group);
@@ -26021,50 +26005,14 @@
space, WeakReference::ContainsCompressedPointers());
return static_cast<WeakReferencePtr>(raw);
}
+
const char* WeakReference::ToCString() const {
TypeArguments& type_args = TypeArguments::Handle(GetTypeArguments());
String& type_args_name = String::Handle(type_args.UserVisibleName());
- return OS::SCreate(Thread::Current()->zone(), "_WeakReference%s",
+ return OS::SCreate(Thread::Current()->zone(), "WeakReference%s",
type_args_name.ToCString());
}
-const char* FinalizerBase::ToCString() const {
- return "FinalizerBase";
-}
-
-FinalizerPtr Finalizer::New(Heap::Space space) {
- ASSERT(IsolateGroup::Current()->object_store()->finalizer_class() !=
- Class::null());
- ObjectPtr raw =
- Object::Allocate(Finalizer::kClassId, Finalizer::InstanceSize(), space,
- Finalizer::ContainsCompressedPointers());
- return static_cast<FinalizerPtr>(raw);
-}
-
-const char* Finalizer::ToCString() const {
- TypeArguments& type_args = TypeArguments::Handle(GetTypeArguments());
- String& type_args_name = String::Handle(type_args.UserVisibleName());
- return OS::SCreate(Thread::Current()->zone(), "_FinalizerImpl%s",
- type_args_name.ToCString());
-}
-
-FinalizerEntryPtr FinalizerEntry::New(Heap::Space space) {
- ASSERT(IsolateGroup::Current()->object_store()->finalizer_entry_class() !=
- Class::null());
- ObjectPtr raw =
- Object::Allocate(FinalizerEntry::kClassId, FinalizerEntry::InstanceSize(),
- space, FinalizerEntry::ContainsCompressedPointers());
- return static_cast<FinalizerEntryPtr>(raw);
-}
-
-void FinalizerEntry::set_finalizer(const FinalizerBase& value) const {
- untag()->set_finalizer(value.ptr());
-}
-
-const char* FinalizerEntry::ToCString() const {
- return "FinalizerEntry";
-}
-
AbstractTypePtr MirrorReference::GetAbstractTypeReferent() const {
ASSERT(Object::Handle(referent()).IsAbstractType());
return AbstractType::Cast(Object::Handle(referent())).ptr();
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index cb4eb7d..668b201 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3177,29 +3177,7 @@
bool ForceOptimize() const {
return IsFfiFromAddress() || IsFfiGetAddress() || IsFfiLoad() ||
IsFfiStore() || IsFfiTrampoline() || IsFfiAsExternalTypedData() ||
- IsTypedDataViewFactory() || IsUtf8Scan() || IsGetNativeField() ||
- IsFinalizerForceOptimized();
- }
-
- bool IsFinalizerForceOptimized() const {
- // Either because of unboxed/untagged data, or because we don't want the GC
- // to trigger in between.
- switch (recognized_kind()) {
- case MethodRecognizer::kFinalizerBase_getIsolateFinalizers:
- case MethodRecognizer::kFinalizerBase_setIsolate:
- case MethodRecognizer::kFinalizerBase_setIsolateFinalizers:
- // Unboxed/untagged representation not supported in unoptimized.
- return true;
- case MethodRecognizer::kFinalizerBase_exchangeEntriesCollectedWithNull:
- // Prevent the GC from running so that the operation is atomic from
- // a GC point of view. Always double check implementation in
- // kernel_to_il.cc that no GC can happen in between the relevant IL
- // instructions.
- // TODO(https://dartbug.com/48527): Support inlining.
- return true;
- default:
- return false;
- }
+ IsTypedDataViewFactory() || IsUtf8Scan() || IsGetNativeField();
}
bool CanBeInlined() const;
@@ -5942,7 +5920,9 @@
static intptr_t UnroundedSize(intptr_t length) {
return HeaderSize() + length;
}
- static intptr_t InstanceSize() { return 0; }
+ static intptr_t InstanceSize() {
+ return 0;
+ }
static intptr_t InstanceSize(intptr_t length) {
return RoundedAllocationSize(UnroundedSize(length));
}
@@ -12000,7 +11980,7 @@
}
static void Clear(WeakPropertyPtr raw_weak) {
- ASSERT(raw_weak->untag()->next_seen_by_gc_ ==
+ ASSERT(raw_weak->untag()->next_ ==
CompressedWeakPropertyPtr(WeakProperty::null()));
// This action is performed by the GC. No barrier.
raw_weak->untag()->key_ = Object::null();
@@ -12032,112 +12012,18 @@
return RoundedAllocationSize(sizeof(UntaggedWeakReference));
}
+ static void Clear(WeakReferencePtr raw_weak) {
+ ASSERT(raw_weak->untag()->next_ ==
+ CompressedWeakReferencePtr(WeakReference::null()));
+ // This action is performed by the GC. No barrier.
+ raw_weak->untag()->target_ = Object::null();
+ }
+
private:
FINAL_HEAP_OBJECT_IMPLEMENTATION(WeakReference, Instance);
friend class Class;
};
-class FinalizerEntry : public Instance {
- public:
- ObjectPtr value() const { return untag()->value(); }
- void set_value(const Object& value) const { untag()->set_value(value.ptr()); }
- static intptr_t value_offset() {
- return OFFSET_OF(UntaggedFinalizerEntry, value_);
- }
-
- ObjectPtr detach() const { return untag()->detach(); }
- void set_detach(const Object& value) const {
- untag()->set_detach(value.ptr());
- }
- static intptr_t detach_offset() {
- return OFFSET_OF(UntaggedFinalizerEntry, detach_);
- }
-
- ObjectPtr token() const { return untag()->token(); }
- void set_token(const Object& value) const { untag()->set_token(value.ptr()); }
- static intptr_t token_offset() {
- return OFFSET_OF(UntaggedFinalizerEntry, token_);
- }
-
- FinalizerBasePtr finalizer() const { return untag()->finalizer(); }
- void set_finalizer(const FinalizerBase& value) const;
- static intptr_t finalizer_offset() {
- return OFFSET_OF(UntaggedFinalizerEntry, finalizer_);
- }
-
- FinalizerEntryPtr next() const { return untag()->next(); }
- void set_next(const FinalizerEntry& value) const {
- untag()->set_next(value.ptr());
- }
- static intptr_t next_offset() {
- return OFFSET_OF(UntaggedFinalizerEntry, next_);
- }
-
- static intptr_t InstanceSize() {
- return RoundedAllocationSize(sizeof(UntaggedFinalizerEntry));
- }
-
- static FinalizerEntryPtr New(Heap::Space space = Heap::kNew);
-
- private:
- FINAL_HEAP_OBJECT_IMPLEMENTATION(FinalizerEntry, Instance);
- friend class Class;
-};
-
-class FinalizerBase : public Instance {
- public:
- static intptr_t isolate_offset() {
- return OFFSET_OF(UntaggedFinalizerBase, isolate_);
- }
- Isolate* isolate() const { return untag()->isolate_; }
- void set_isolate(Isolate* value) const { untag()->isolate_ = value; }
-
- static intptr_t detachments_offset() {
- return OFFSET_OF(UntaggedFinalizerBase, detachments_);
- }
-
- LinkedHashSetPtr all_entries() const { return untag()->all_entries(); }
- static intptr_t all_entries_offset() {
- return OFFSET_OF(UntaggedFinalizerBase, all_entries_);
- }
-
- FinalizerEntryPtr entries_collected() const {
- return untag()->entries_collected();
- }
- void set_entries_collected(const FinalizerEntry& value) const {
- untag()->set_entries_collected(value.ptr());
- }
- static intptr_t entries_collected_offset() {
- return OFFSET_OF(UntaggedFinalizer, entries_collected_);
- }
-
- private:
- HEAP_OBJECT_IMPLEMENTATION(FinalizerBase, Instance);
- friend class Class;
-};
-
-class Finalizer : public FinalizerBase {
- public:
- static intptr_t type_arguments_offset() {
- return OFFSET_OF(UntaggedFinalizer, type_arguments_);
- }
-
- ObjectPtr callback() const { return untag()->callback(); }
- static intptr_t callback_offset() {
- return OFFSET_OF(UntaggedFinalizer, callback_);
- }
-
- static intptr_t InstanceSize() {
- return RoundedAllocationSize(sizeof(UntaggedFinalizer));
- }
-
- static FinalizerPtr New(Heap::Space space = Heap::kNew);
-
- private:
- FINAL_HEAP_OBJECT_IMPLEMENTATION(Finalizer, FinalizerBase);
- friend class Class;
-};
-
class MirrorReference : public Instance {
public:
ObjectPtr referent() const { return untag()->referent(); }
diff --git a/runtime/vm/object_graph_copy.cc b/runtime/vm/object_graph_copy.cc
index ede344d..638febe 100644
--- a/runtime/vm/object_graph_copy.cc
+++ b/runtime/vm/object_graph_copy.cc
@@ -35,9 +35,6 @@
V(ExceptionHandlers) \
V(FfiTrampolineData) \
V(Field) \
- V(Finalizer) \
- V(FinalizerBase) \
- V(FinalizerEntry) \
V(Function) \
V(FunctionType) \
V(FutureOr) \
@@ -603,7 +600,6 @@
// those are the only non-abstract classes (so we avoid checking more cids
// here that cannot happen in reality)
HANDLE_ILLEGAL_CASE(DynamicLibrary)
- HANDLE_ILLEGAL_CASE(Finalizer)
HANDLE_ILLEGAL_CASE(MirrorReference)
HANDLE_ILLEGAL_CASE(Pointer)
HANDLE_ILLEGAL_CASE(ReceivePort)
@@ -1366,8 +1362,8 @@
Object::null());
// To satisfy some ASSERT()s in GC we'll use Object:null() explicitly here.
Base::StoreCompressedPointerNoBarrier(
- Types::GetWeakPropertyPtr(to),
- OFFSET_OF(UntaggedWeakProperty, next_seen_by_gc_), Object::null());
+ Types::GetWeakPropertyPtr(to), OFFSET_OF(UntaggedWeakProperty, next_),
+ Object::null());
Base::EnqueueWeakProperty(from);
}
@@ -1384,8 +1380,8 @@
from, to, OFFSET_OF(UntaggedWeakReference, type_arguments_));
// To satisfy some ASSERT()s in GC we'll use Object:null() explicitly here.
Base::StoreCompressedPointerNoBarrier(
- Types::GetWeakReferencePtr(to),
- OFFSET_OF(UntaggedWeakReference, next_seen_by_gc_), Object::null());
+ Types::GetWeakReferencePtr(to), OFFSET_OF(UntaggedWeakReference, next_),
+ Object::null());
Base::EnqueueWeakReference(from);
}
@@ -1819,7 +1815,7 @@
// We force the GC to compact, which is more likely to discover
// untracked pointers (and other issues, like incorrect class table).
thread_->heap()->CollectAllGarbage(GCReason::kDebugging,
- /*compact=*/true);
+ /*compact=*/ true);
}
// Fast copy failed due to
diff --git a/runtime/vm/object_service.cc b/runtime/vm/object_service.cc
index 59245d6..210f508 100644
--- a/runtime/vm/object_service.cc
+++ b/runtime/vm/object_service.cc
@@ -1700,29 +1700,6 @@
jsobj.AddProperty("target", target_handle);
}
-void FinalizerBase::PrintJSONImpl(JSONStream* stream, bool ref) const {
- UNREACHABLE();
-}
-
-void Finalizer::PrintJSONImpl(JSONStream* stream, bool ref) const {
- JSONObject jsobj(stream);
- PrintSharedInstanceJSON(&jsobj, ref);
- jsobj.AddProperty("kind", "Finalizer");
- jsobj.AddServiceId(*this);
- if (ref) {
- return;
- }
-
- const Object& finalizer_callback = Object::Handle(callback());
- jsobj.AddProperty("callback", finalizer_callback);
-
- // Not exposing entries.
-}
-
-void FinalizerEntry::PrintJSONImpl(JSONStream* stream, bool ref) const {
- UNREACHABLE();
-}
-
void MirrorReference::PrintJSONImpl(JSONStream* stream, bool ref) const {
JSONObject jsobj(stream);
PrintSharedInstanceJSON(&jsobj, ref);
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index bdbc4a1..23f9b4d 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -78,8 +78,6 @@
resume_capabilities_ = GrowableObjectArray::New();
exit_listeners_ = GrowableObjectArray::New();
error_listeners_ = GrowableObjectArray::New();
- dart_args_1_ = Array::New(1);
- dart_args_2_ = Array::New(2);
// Allocate pre-allocated unhandled exception object initialized with the
// pre-allocated OutOfMemoryError.
@@ -469,24 +467,7 @@
auto* const thread = Thread::Current();
SafepointWriteRwLocker locker(thread,
thread->isolate_group()->program_lock());
- if (handle_finalizer_message_function_.load() == Function::null()) {
- auto* const zone = thread->zone();
- auto& cls = Class::Handle(zone);
- auto& function = Function::Handle(zone);
- auto& error = Error::Handle(zone);
-
- const auto& ffi_lib = Library::Handle(zone, Library::FfiLibrary());
- ASSERT(!ffi_lib.IsNull());
-
- cls = finalizer_class();
- ASSERT(!cls.IsNull());
- error = cls.EnsureIsFinalized(thread);
- ASSERT(error.IsNull());
- function =
- cls.LookupFunctionAllowPrivate(Symbols::_handleFinalizerMessage());
- ASSERT(!function.IsNull());
- handle_finalizer_message_function_.store(function.ptr());
- }
+ // TODO(http://dartbug.com/47777): Implement finalizers.
}
void ObjectStore::LazyInitIsolateMembers() {
@@ -531,14 +512,13 @@
auto* const zone = thread->zone();
auto& cls = Class::Handle(zone);
auto& field = Field::Handle(zone);
- auto& error = Error::Handle(zone);
const auto& internal_lib =
Library::Handle(zone, Library::InternalLibrary());
cls = internal_lib.LookupClass(Symbols::Symbol());
ASSERT(!cls.IsNull());
- error = cls.EnsureIsFinalized(thread);
- ASSERT(error.IsNull());
+ const auto& error = cls.EnsureIsFinalized(thread);
+ ASSERT(error == Error::null());
symbol_class_.store(cls.ptr());
field = cls.LookupInstanceFieldAllowPrivate(Symbols::_name());
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 26bce63..f86b8c5 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -55,7 +55,6 @@
LAZY_CORE(Function, _object_to_string_function) \
LAZY_INTERNAL(Class, symbol_class) \
LAZY_INTERNAL(Field, symbol_name_field) \
- LAZY_FFI(Function, handle_finalizer_message_function) \
LAZY_ASYNC(Type, non_nullable_future_rare_type) \
LAZY_ASYNC(Type, non_nullable_future_never_type) \
LAZY_ASYNC(Type, nullable_future_null_type) \
@@ -127,9 +126,6 @@
RW(Class, expando_class) \
RW(Class, weak_property_class) \
RW(Class, weak_reference_class) \
- RW(Class, finalizer_class) \
- RW(Class, finalizer_entry_class) \
- RW(Class, finalizer_native_class) \
ARW_AR(Array, symbol_table) \
RW(Array, canonical_types) \
RW(Array, canonical_function_types) \
@@ -319,8 +315,8 @@
RW(UnhandledException, preallocated_unhandled_exception) \
RW(StackTrace, preallocated_stack_trace) \
RW(UnwindError, preallocated_unwind_error) \
- R_(Array, dart_args_1) \
- R_(Array, dart_args_2) \
+ RW(Array, dart_args_1) \
+ RW(Array, dart_args_2) \
R_(GrowableObjectArray, resume_capabilities) \
R_(GrowableObjectArray, exit_listeners) \
R_(GrowableObjectArray, error_listeners)
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 8a647cb..237ffb0 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
#include <limits>
-#include <memory>
#include "include/dart_api.h"
@@ -17,15 +16,12 @@
#include "vm/code_descriptors.h"
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/compiler_state.h"
-#include "vm/compiler/runtime_api.h"
#include "vm/dart_api_impl.h"
#include "vm/dart_entry.h"
#include "vm/debugger.h"
#include "vm/debugger_api_impl_test.h"
-#include "vm/flags.h"
#include "vm/isolate.h"
#include "vm/malloc_hooks.h"
-#include "vm/message_handler.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/resolver.h"
@@ -4009,1037 +4005,6 @@
WeakReference_Preserve_ReachableThroughWeakProperty(thread, Heap::kOld);
}
-static int NumEntries(const FinalizerEntry& entry, intptr_t acc = 0) {
- if (entry.IsNull()) {
- return acc;
- }
- return NumEntries(FinalizerEntry::Handle(entry.next()), acc + 1);
-}
-
-static void Finalizer_PreserveOne(Thread* thread,
- Heap::Space space,
- bool with_detach) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- {
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-
- const auto& finalizer = Finalizer::Handle(Finalizer::New(space));
- finalizer.set_isolate(thread->isolate());
- const auto& entry = FinalizerEntry::Handle(FinalizerEntry::New(space));
- entry.set_finalizer(finalizer);
- const auto& value = String::Handle(OneByteString::New("value", space));
- entry.set_value(value);
- auto& detach = Object::Handle();
- if (with_detach) {
- detach = OneByteString::New("detach", space);
- } else {
- detach = Object::null();
- }
- entry.set_detach(detach);
- const auto& token = String::Handle(OneByteString::New("token", space));
- entry.set_token(token);
-
- if (space == Heap::kNew) {
- GCTestHelper::CollectNewSpace();
- } else {
- GCTestHelper::CollectAllGarbage();
- }
-
- // Nothing in the entry should have been collected.
- EXPECT_NE(Object::null(), entry.value());
- EXPECT((entry.detach() == Object::null()) ^ with_detach);
- EXPECT_NE(Object::null(), entry.token());
-
- // The entry should not have moved to the collected list.
- EXPECT_EQ(0,
- NumEntries(FinalizerEntry::Handle(finalizer.entries_collected())));
-
- // We should have no messages.
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveNoDetachOne_NewSpace) {
- Finalizer_PreserveOne(thread, Heap::kNew, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveNoDetachOne_OldSpace) {
- Finalizer_PreserveOne(thread, Heap::kOld, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveWithDetachOne_NewSpace) {
- Finalizer_PreserveOne(thread, Heap::kNew, true);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveWithDetachOne_OldSpace) {
- Finalizer_PreserveOne(thread, Heap::kOld, true);
-}
-
-static void Finalizer_ClearDetachOne(Thread* thread, Heap::Space space) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- {
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-
- const auto& finalizer = Finalizer::Handle(Finalizer::New(space));
- finalizer.set_isolate(thread->isolate());
- const auto& entry = FinalizerEntry::Handle(FinalizerEntry::New(space));
- entry.set_finalizer(finalizer);
- const auto& value = String::Handle(OneByteString::New("value", space));
- entry.set_value(value);
- const auto& token = String::Handle(OneByteString::New("token", space));
- entry.set_token(token);
-
- {
- HANDLESCOPE(thread);
- const auto& detach = String::Handle(OneByteString::New("detach", space));
- entry.set_detach(detach);
- }
-
- if (space == Heap::kNew) {
- GCTestHelper::CollectNewSpace();
- } else {
- GCTestHelper::CollectAllGarbage();
- }
-
- // Detach should have been collected.
- EXPECT_NE(Object::null(), entry.value());
- EXPECT_EQ(Object::null(), entry.detach());
- EXPECT_NE(Object::null(), entry.token());
-
- // The entry should not have moved to the collected list.
- EXPECT_EQ(0,
- NumEntries(FinalizerEntry::Handle(finalizer.entries_collected())));
-
- // We should have no messages.
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearDetachOne_NewSpace) {
- Finalizer_ClearDetachOne(thread, Heap::kNew);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearDetachOne_OldSpace) {
- Finalizer_ClearDetachOne(thread, Heap::kOld);
-}
-
-static void Finalizer_ClearValueOne(Thread* thread,
- Heap::Space space,
- bool null_token) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- {
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-
- const auto& finalizer = Finalizer::Handle(Finalizer::New(space));
- finalizer.set_isolate(thread->isolate());
- const auto& entry = FinalizerEntry::Handle(FinalizerEntry::New(space));
- entry.set_finalizer(finalizer);
- const auto& detach = String::Handle(OneByteString::New("detach", space));
- auto& token = Object::Handle();
- if (null_token) {
- // Null is a valid token in Dart finalizers.
- token = Object::null();
- } else {
- token = OneByteString::New("token", space);
- }
- entry.set_token(token);
- entry.set_detach(detach);
-
- {
- HANDLESCOPE(thread);
- const auto& value = String::Handle(OneByteString::New("value", space));
- entry.set_value(value);
- }
-
- if (space == Heap::kNew) {
- GCTestHelper::CollectNewSpace();
- } else {
- GCTestHelper::CollectAllGarbage();
- }
-
- // Value should have been collected.
- EXPECT_EQ(Object::null(), entry.value());
- EXPECT_NE(Object::null(), entry.detach());
-
- // The entry should have moved to the collected list.
- EXPECT_EQ(1,
- NumEntries(FinalizerEntry::Handle(finalizer.entries_collected())));
-
- // We should have 1 message.
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(1, aq.queue()->Length());
- }
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueOne_NewSpace) {
- Finalizer_ClearValueOne(thread, Heap::kNew, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueOne_OldSpace) {
- Finalizer_ClearValueOne(thread, Heap::kOld, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueNullTokenOne_NewSpace) {
- Finalizer_ClearValueOne(thread, Heap::kNew, true);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueNullTokenOne_OldSpace) {
- Finalizer_ClearValueOne(thread, Heap::kOld, true);
-}
-
-static void Finalizer_DetachOne(Thread* thread,
- Heap::Space space,
- bool clear_value) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- {
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-
- const auto& finalizer = Finalizer::Handle(Finalizer::New(space));
- finalizer.set_isolate(thread->isolate());
- const auto& entry = FinalizerEntry::Handle(FinalizerEntry::New(space));
- entry.set_finalizer(finalizer);
- const auto& detach = String::Handle(OneByteString::New("detach", space));
- entry.set_detach(detach);
-
- // Simulate calling detach, setting the token of the entry to the entry.
- entry.set_token(entry);
-
- auto& value = String::Handle();
- {
- HANDLESCOPE(thread);
-
- const auto& object = String::Handle(OneByteString::New("value", space));
- entry.set_value(object);
- if (!clear_value) {
- value = object.ptr();
- }
- }
-
- if (space == Heap::kNew) {
- GCTestHelper::CollectNewSpace();
- } else {
- GCTestHelper::CollectAllGarbage();
- }
-
- EXPECT((entry.value() == Object::null()) ^ !clear_value);
- EXPECT_NE(Object::null(), entry.detach());
- EXPECT_EQ(entry.ptr(), entry.token());
-
- // The entry should have been removed entirely
- EXPECT_EQ(0,
- NumEntries(FinalizerEntry::Handle(finalizer.entries_collected())));
-
- // We should have no message.
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_DetachOne_NewSpace) {
- Finalizer_DetachOne(thread, Heap::kNew, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_DetachOne_OldSpace) {
- Finalizer_DetachOne(thread, Heap::kOld, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_DetachAndClearValueOne_NewSpace) {
- Finalizer_DetachOne(thread, Heap::kNew, true);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_DetachAndClearValueOne_OldSpace) {
- Finalizer_DetachOne(thread, Heap::kOld, true);
-}
-
-static void Finalizer_GcFinalizer(Thread* thread, Heap::Space space) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- {
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-
- const auto& detach = String::Handle(OneByteString::New("detach", space));
- const auto& token = String::Handle(OneByteString::New("token", space));
-
- {
- HANDLESCOPE(thread);
- const auto& finalizer = Finalizer::Handle(Finalizer::New(space));
- finalizer.set_isolate(thread->isolate());
- const auto& entry = FinalizerEntry::Handle(FinalizerEntry::New(space));
- entry.set_finalizer(finalizer);
- entry.set_detach(detach);
- entry.set_token(token);
- const auto& value = String::Handle(OneByteString::New("value", space));
- entry.set_value(value);
- }
-
- if (space == Heap::kNew) {
- GCTestHelper::CollectNewSpace();
- } else {
- GCTestHelper::CollectAllGarbage();
- }
-
- // We should have no message, the Finalizer itself has been GCed.
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(0, aq.queue()->Length());
- }
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_GcFinalizer_NewSpace) {
- Finalizer_GcFinalizer(thread, Heap::kNew);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_GcFinalizer_OldSpace) {
- Finalizer_GcFinalizer(thread, Heap::kOld);
-}
-
-static void Finalizer_TwoEntriesCrossGen(
- Thread* thread,
- Heap::Space* spaces,
- bool collect_old_space,
- bool collect_new_space,
- bool evacuate_new_space_and_collect_old_space,
- bool clear_value_1,
- bool clear_value_2,
- bool clear_detach_1,
- bool clear_detach_2) {
-#ifdef DEBUG
- SetFlagScope<bool> sfs(&FLAG_trace_finalizers, true);
-#endif
-
- MessageHandler* handler = thread->isolate()->message_handler();
- // We're reusing the isolate in a loop, so there are messages from previous
- // runs of this test.
- intptr_t queue_length_start = 0;
- {
- MessageHandler::AcquiredQueues aq(handler);
- queue_length_start = aq.queue()->Length();
- }
-
- const auto& finalizer = Finalizer::Handle(Finalizer::New(spaces[0]));
- finalizer.set_isolate(thread->isolate());
- const auto& entry1 = FinalizerEntry::Handle(FinalizerEntry::New(spaces[1]));
- entry1.set_finalizer(finalizer);
- const auto& entry2 = FinalizerEntry::Handle(FinalizerEntry::New(spaces[2]));
- entry2.set_finalizer(finalizer);
-
- auto& value1 = String::Handle();
- auto& detach1 = String::Handle();
- const auto& token1 = String::Handle(OneByteString::New("token1", spaces[3]));
- entry1.set_token(token1);
-
- auto& value2 = String::Handle();
- auto& detach2 = String::Handle();
- const auto& token2 = String::Handle(OneByteString::New("token2", spaces[4]));
- entry2.set_token(token2);
- entry2.set_detach(detach2);
-
- {
- HANDLESCOPE(thread);
- auto& object = String::Handle();
-
- object ^= OneByteString::New("value1", spaces[5]);
- entry1.set_value(object);
- if (!clear_value_1) {
- value1 = object.ptr();
- }
-
- object ^= OneByteString::New("detach", spaces[6]);
- entry1.set_detach(object);
- if (!clear_detach_1) {
- detach1 = object.ptr();
- }
-
- object ^= OneByteString::New("value2", spaces[7]);
- entry2.set_value(object);
- if (!clear_value_2) {
- value2 = object.ptr();
- }
-
- object ^= OneByteString::New("detach", spaces[8]);
- entry2.set_detach(object);
- if (!clear_detach_2) {
- detach2 = object.ptr();
- }
- }
-
- if (collect_old_space) {
- GCTestHelper::CollectOldSpace();
- }
- if (collect_new_space) {
- GCTestHelper::CollectNewSpace();
- }
- if (evacuate_new_space_and_collect_old_space) {
- GCTestHelper::CollectAllGarbage();
- }
-
- EXPECT((entry1.value() == Object::null()) ^ !clear_value_1);
- EXPECT((entry2.value() == Object::null()) ^ !clear_value_2);
- EXPECT((entry1.detach() == Object::null()) ^ !clear_detach_1);
- EXPECT((entry2.detach() == Object::null()) ^ !clear_detach_2);
- EXPECT_NE(Object::null(), entry1.token());
- EXPECT_NE(Object::null(), entry2.token());
-
- const intptr_t expect_num_cleared =
- (clear_value_1 ? 1 : 0) + (clear_value_2 ? 1 : 0);
- EXPECT_EQ(expect_num_cleared,
- NumEntries(FinalizerEntry::Handle(finalizer.entries_collected())));
-
- const intptr_t expect_num_messages = expect_num_cleared == 0 ? 0 : 1;
- {
- // Acquire ownership of message handler queues.
- MessageHandler::AcquiredQueues aq(handler);
- EXPECT_EQ(expect_num_messages + queue_length_start, aq.queue()->Length());
- }
-}
-
-const intptr_t kFinalizerTwoEntriesNumObjects = 9;
-
-static void Finalizer_TwoEntries(Thread* thread,
- Heap::Space space,
- bool clear_value_1,
- bool clear_value_2,
- bool clear_detach_1,
- bool clear_detach_2) {
- const bool collect_old_space = true;
- const bool collect_new_space = space == Heap::kNew;
- const bool evacuate_new_space_and_collect_old_space = !collect_new_space;
-
- Heap::Space spaces[kFinalizerTwoEntriesNumObjects];
- for (intptr_t i = 0; i < kFinalizerTwoEntriesNumObjects; i++) {
- spaces[i] = space;
- }
- Finalizer_TwoEntriesCrossGen(
- thread, spaces, collect_old_space, collect_new_space,
- evacuate_new_space_and_collect_old_space, clear_value_1, clear_value_2,
- clear_detach_1, clear_detach_2);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueTwo_NewSpace) {
- Finalizer_TwoEntries(thread, Heap::kNew, true, true, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearValueTwo_OldSpace) {
- Finalizer_TwoEntries(thread, Heap::kOld, true, true, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearFirstValue_NewSpace) {
- Finalizer_TwoEntries(thread, Heap::kNew, true, false, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearFirstValue_OldSpace) {
- Finalizer_TwoEntries(thread, Heap::kOld, true, false, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearSecondValue_NewSpace) {
- Finalizer_TwoEntries(thread, Heap::kNew, false, true, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearSecondValue_OldSpace) {
- Finalizer_TwoEntries(thread, Heap::kOld, false, true, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveTwo_NewSpace) {
- Finalizer_TwoEntries(thread, Heap::kNew, false, false, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_PreserveTwo_OldSpace) {
- Finalizer_TwoEntries(thread, Heap::kOld, false, false, false, false);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearDetachTwo_NewSpace) {
- Finalizer_TwoEntries(thread, Heap::kNew, false, false, true, true);
-}
-
-ISOLATE_UNIT_TEST_CASE(Finalizer_ClearDetachTwo_OldSpace) {
- Finalizer_TwoEntries(thread, Heap::kOld, false, false, true, true);
-}
-
-static void Finalizer_TwoEntriesCrossGen(Thread* thread, intptr_t test_i) {
- ASSERT(test_i < (1 << kFinalizerTwoEntriesNumObjects));
- Heap::Space spaces[kFinalizerTwoEntriesNumObjects];
- for (intptr_t i = 0; i < kFinalizerTwoEntriesNumObjects; i++) {
- spaces[i] = ((test_i >> i) & 0x1) == 0x1 ? Heap::kOld : Heap::kNew;
- }
- // Either collect or evacuate new space.
- for (const bool collect_new_space : {false, true}) {
- // Always run old space collection first.
- const bool collect_old_space = true;
- // Always run old space collection after new space.
- const bool evacuate_new_space_and_collect_old_space = true;
- for (intptr_t test_j = 0; test_j < 16; test_j++) {
- const bool clear_value_1 = (test_j >> 0 & 0x1) == 0x1;
- const bool clear_value_2 = (test_j >> 1 & 0x1) == 0x1;
- const bool clear_detach_1 = (test_j >> 2 & 0x1) == 0x1;
- const bool clear_detach_2 = (test_j >> 3 & 0x1) == 0x1;
- Finalizer_TwoEntriesCrossGen(
- thread, spaces, collect_old_space, collect_new_space,
- evacuate_new_space_and_collect_old_space, clear_value_1,
- clear_value_2, clear_detach_1, clear_detach_2);
- }
- }
-}
-#define FINALIZER_CROSS_GEN_TEST_CASE(n) \
- ISOLATE_UNIT_TEST_CASE(Finalizer_CrossGen_##n) { \
- Finalizer_TwoEntriesCrossGen(thread, n); \
- }
-
-#define REPEAT_512(V) \
- V(0) \
- V(1) \
- V(2) \
- V(3) \
- V(4) \
- V(5) \
- V(6) \
- V(7) \
- V(8) \
- V(9) \
- V(10) \
- V(11) \
- V(12) \
- V(13) \
- V(14) \
- V(15) \
- V(16) \
- V(17) \
- V(18) \
- V(19) \
- V(20) \
- V(21) \
- V(22) \
- V(23) \
- V(24) \
- V(25) \
- V(26) \
- V(27) \
- V(28) \
- V(29) \
- V(30) \
- V(31) \
- V(32) \
- V(33) \
- V(34) \
- V(35) \
- V(36) \
- V(37) \
- V(38) \
- V(39) \
- V(40) \
- V(41) \
- V(42) \
- V(43) \
- V(44) \
- V(45) \
- V(46) \
- V(47) \
- V(48) \
- V(49) \
- V(50) \
- V(51) \
- V(52) \
- V(53) \
- V(54) \
- V(55) \
- V(56) \
- V(57) \
- V(58) \
- V(59) \
- V(60) \
- V(61) \
- V(62) \
- V(63) \
- V(64) \
- V(65) \
- V(66) \
- V(67) \
- V(68) \
- V(69) \
- V(70) \
- V(71) \
- V(72) \
- V(73) \
- V(74) \
- V(75) \
- V(76) \
- V(77) \
- V(78) \
- V(79) \
- V(80) \
- V(81) \
- V(82) \
- V(83) \
- V(84) \
- V(85) \
- V(86) \
- V(87) \
- V(88) \
- V(89) \
- V(90) \
- V(91) \
- V(92) \
- V(93) \
- V(94) \
- V(95) \
- V(96) \
- V(97) \
- V(98) \
- V(99) \
- V(100) \
- V(101) \
- V(102) \
- V(103) \
- V(104) \
- V(105) \
- V(106) \
- V(107) \
- V(108) \
- V(109) \
- V(110) \
- V(111) \
- V(112) \
- V(113) \
- V(114) \
- V(115) \
- V(116) \
- V(117) \
- V(118) \
- V(119) \
- V(120) \
- V(121) \
- V(122) \
- V(123) \
- V(124) \
- V(125) \
- V(126) \
- V(127) \
- V(128) \
- V(129) \
- V(130) \
- V(131) \
- V(132) \
- V(133) \
- V(134) \
- V(135) \
- V(136) \
- V(137) \
- V(138) \
- V(139) \
- V(140) \
- V(141) \
- V(142) \
- V(143) \
- V(144) \
- V(145) \
- V(146) \
- V(147) \
- V(148) \
- V(149) \
- V(150) \
- V(151) \
- V(152) \
- V(153) \
- V(154) \
- V(155) \
- V(156) \
- V(157) \
- V(158) \
- V(159) \
- V(160) \
- V(161) \
- V(162) \
- V(163) \
- V(164) \
- V(165) \
- V(166) \
- V(167) \
- V(168) \
- V(169) \
- V(170) \
- V(171) \
- V(172) \
- V(173) \
- V(174) \
- V(175) \
- V(176) \
- V(177) \
- V(178) \
- V(179) \
- V(180) \
- V(181) \
- V(182) \
- V(183) \
- V(184) \
- V(185) \
- V(186) \
- V(187) \
- V(188) \
- V(189) \
- V(190) \
- V(191) \
- V(192) \
- V(193) \
- V(194) \
- V(195) \
- V(196) \
- V(197) \
- V(198) \
- V(199) \
- V(200) \
- V(201) \
- V(202) \
- V(203) \
- V(204) \
- V(205) \
- V(206) \
- V(207) \
- V(208) \
- V(209) \
- V(210) \
- V(211) \
- V(212) \
- V(213) \
- V(214) \
- V(215) \
- V(216) \
- V(217) \
- V(218) \
- V(219) \
- V(220) \
- V(221) \
- V(222) \
- V(223) \
- V(224) \
- V(225) \
- V(226) \
- V(227) \
- V(228) \
- V(229) \
- V(230) \
- V(231) \
- V(232) \
- V(233) \
- V(234) \
- V(235) \
- V(236) \
- V(237) \
- V(238) \
- V(239) \
- V(240) \
- V(241) \
- V(242) \
- V(243) \
- V(244) \
- V(245) \
- V(246) \
- V(247) \
- V(248) \
- V(249) \
- V(250) \
- V(251) \
- V(252) \
- V(253) \
- V(254) \
- V(255) \
- V(256) \
- V(257) \
- V(258) \
- V(259) \
- V(260) \
- V(261) \
- V(262) \
- V(263) \
- V(264) \
- V(265) \
- V(266) \
- V(267) \
- V(268) \
- V(269) \
- V(270) \
- V(271) \
- V(272) \
- V(273) \
- V(274) \
- V(275) \
- V(276) \
- V(277) \
- V(278) \
- V(279) \
- V(280) \
- V(281) \
- V(282) \
- V(283) \
- V(284) \
- V(285) \
- V(286) \
- V(287) \
- V(288) \
- V(289) \
- V(290) \
- V(291) \
- V(292) \
- V(293) \
- V(294) \
- V(295) \
- V(296) \
- V(297) \
- V(298) \
- V(299) \
- V(300) \
- V(301) \
- V(302) \
- V(303) \
- V(304) \
- V(305) \
- V(306) \
- V(307) \
- V(308) \
- V(309) \
- V(310) \
- V(311) \
- V(312) \
- V(313) \
- V(314) \
- V(315) \
- V(316) \
- V(317) \
- V(318) \
- V(319) \
- V(320) \
- V(321) \
- V(322) \
- V(323) \
- V(324) \
- V(325) \
- V(326) \
- V(327) \
- V(328) \
- V(329) \
- V(330) \
- V(331) \
- V(332) \
- V(333) \
- V(334) \
- V(335) \
- V(336) \
- V(337) \
- V(338) \
- V(339) \
- V(340) \
- V(341) \
- V(342) \
- V(343) \
- V(344) \
- V(345) \
- V(346) \
- V(347) \
- V(348) \
- V(349) \
- V(350) \
- V(351) \
- V(352) \
- V(353) \
- V(354) \
- V(355) \
- V(356) \
- V(357) \
- V(358) \
- V(359) \
- V(360) \
- V(361) \
- V(362) \
- V(363) \
- V(364) \
- V(365) \
- V(366) \
- V(367) \
- V(368) \
- V(369) \
- V(370) \
- V(371) \
- V(372) \
- V(373) \
- V(374) \
- V(375) \
- V(376) \
- V(377) \
- V(378) \
- V(379) \
- V(380) \
- V(381) \
- V(382) \
- V(383) \
- V(384) \
- V(385) \
- V(386) \
- V(387) \
- V(388) \
- V(389) \
- V(390) \
- V(391) \
- V(392) \
- V(393) \
- V(394) \
- V(395) \
- V(396) \
- V(397) \
- V(398) \
- V(399) \
- V(400) \
- V(401) \
- V(402) \
- V(403) \
- V(404) \
- V(405) \
- V(406) \
- V(407) \
- V(408) \
- V(409) \
- V(410) \
- V(411) \
- V(412) \
- V(413) \
- V(414) \
- V(415) \
- V(416) \
- V(417) \
- V(418) \
- V(419) \
- V(420) \
- V(421) \
- V(422) \
- V(423) \
- V(424) \
- V(425) \
- V(426) \
- V(427) \
- V(428) \
- V(429) \
- V(430) \
- V(431) \
- V(432) \
- V(433) \
- V(434) \
- V(435) \
- V(436) \
- V(437) \
- V(438) \
- V(439) \
- V(440) \
- V(441) \
- V(442) \
- V(443) \
- V(444) \
- V(445) \
- V(446) \
- V(447) \
- V(448) \
- V(449) \
- V(450) \
- V(451) \
- V(452) \
- V(453) \
- V(454) \
- V(455) \
- V(456) \
- V(457) \
- V(458) \
- V(459) \
- V(460) \
- V(461) \
- V(462) \
- V(463) \
- V(464) \
- V(465) \
- V(466) \
- V(467) \
- V(468) \
- V(469) \
- V(470) \
- V(471) \
- V(472) \
- V(473) \
- V(474) \
- V(475) \
- V(476) \
- V(477) \
- V(478) \
- V(479) \
- V(480) \
- V(481) \
- V(482) \
- V(483) \
- V(484) \
- V(485) \
- V(486) \
- V(487) \
- V(488) \
- V(489) \
- V(490) \
- V(491) \
- V(492) \
- V(493) \
- V(494) \
- V(495) \
- V(496) \
- V(497) \
- V(498) \
- V(499) \
- V(500) \
- V(501) \
- V(502) \
- V(503) \
- V(504) \
- V(505) \
- V(506) \
- V(507) \
- V(508) \
- V(509) \
- V(510) \
- V(511)
-
-REPEAT_512(FINALIZER_CROSS_GEN_TEST_CASE)
-
ISOLATE_UNIT_TEST_CASE(MirrorReference) {
const MirrorReference& reference =
MirrorReference::Handle(MirrorReference::New(Object::Handle()));
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 82e1bf8..eb83d68 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -552,8 +552,6 @@
COMPRESSED_VISITOR(RegExp)
COMPRESSED_VISITOR(WeakProperty)
COMPRESSED_VISITOR(WeakReference)
-COMPRESSED_VISITOR(Finalizer)
-COMPRESSED_VISITOR(FinalizerEntry)
COMPRESSED_VISITOR(MirrorReference)
COMPRESSED_VISITOR(UserTag)
REGULAR_VISITOR(SubtypeTestCache)
@@ -596,7 +594,6 @@
UNREACHABLE_VISITOR(CallSiteData)
UNREACHABLE_VISITOR(TypedDataBase)
UNREACHABLE_VISITOR(Error)
-UNREACHABLE_VISITOR(FinalizerBase)
UNREACHABLE_VISITOR(Number)
UNREACHABLE_VISITOR(Integer)
UNREACHABLE_VISITOR(String)
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 2142cd4..5a084c5 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -623,20 +623,6 @@
}
}
- template <typename type,
- typename compressed_type,
- std::memory_order order = std::memory_order_relaxed>
- type ExchangeCompressedPointer(compressed_type const* addr, type value) {
- compressed_type previous_value =
- reinterpret_cast<std::atomic<compressed_type>*>(
- const_cast<compressed_type*>(addr))
- ->exchange(static_cast<compressed_type>(value), order);
- if (value.IsHeapObject()) {
- CheckHeapPointerStore(value, Thread::Current());
- }
- return static_cast<type>(previous_value.Decompress(heap_base()));
- }
-
template <std::memory_order order = std::memory_order_relaxed>
SmiPtr LoadSmi(SmiPtr const* addr) const {
return reinterpret_cast<std::atomic<SmiPtr>*>(const_cast<SmiPtr*>(addr))
@@ -3279,7 +3265,7 @@
class UntaggedWeakProperty : public UntaggedInstance {
RAW_HEAP_OBJECT_IMPLEMENTATION(WeakProperty);
- COMPRESSED_POINTER_FIELD(ObjectPtr, key) // Weak reference.
+ COMPRESSED_POINTER_FIELD(ObjectPtr, key)
VISIT_FROM(key)
COMPRESSED_POINTER_FIELD(ObjectPtr, value)
VISIT_TO(value)
@@ -3287,10 +3273,8 @@
// Linked list is chaining all pending weak properties. Not visited by
// pointer visitors.
- COMPRESSED_POINTER_FIELD(WeakPropertyPtr, next_seen_by_gc)
+ CompressedWeakPropertyPtr next_;
- template <typename Type, typename PtrType>
- friend struct GCLinkedList;
friend class GCMarker;
template <bool>
friend class MarkingVisitorBase;
@@ -3304,7 +3288,7 @@
class UntaggedWeakReference : public UntaggedInstance {
RAW_HEAP_OBJECT_IMPLEMENTATION(WeakReference);
- COMPRESSED_POINTER_FIELD(ObjectPtr, target) // Weak reference.
+ COMPRESSED_POINTER_FIELD(ObjectPtr, target)
VISIT_FROM(target)
COMPRESSED_POINTER_FIELD(TypeArgumentsPtr, type_arguments)
VISIT_TO(type_arguments)
@@ -3312,10 +3296,8 @@
// Linked list is chaining all pending weak properties. Not visited by
// pointer visitors.
- COMPRESSED_POINTER_FIELD(WeakReferencePtr, next_seen_by_gc)
+ CompressedWeakReferencePtr next_;
- template <typename Type, typename PtrType>
- friend struct GCLinkedList;
friend class GCMarker;
template <bool>
friend class MarkingVisitorBase;
@@ -3326,92 +3308,6 @@
friend class SlowObjectCopy; // For OFFSET_OF
};
-class UntaggedFinalizerBase : public UntaggedInstance {
- RAW_HEAP_OBJECT_IMPLEMENTATION(FinalizerBase);
-
- // The isolate this finalizer belongs to. Updated on sent and exit and set
- // to null on isolate shutdown. See Isolate::finalizers_.
- Isolate* isolate_;
-
- COMPRESSED_POINTER_FIELD(ObjectPtr, detachments)
- VISIT_FROM(detachments)
- COMPRESSED_POINTER_FIELD(LinkedHashSetPtr, all_entries)
- COMPRESSED_POINTER_FIELD(FinalizerEntryPtr, entries_collected)
-
-// With compressed pointers, the first field in a subclass is at offset 28.
-// If the fields would be public, the first field in a subclass is at offset 32.
-// On Windows, it is always at offset 32, no matter public/private.
-// This makes it 32 for all OSes.
-// We can't use ALIGN8 on the first fields of the subclasses because they use
-// the COMPRESSED_POINTER_FIELD macro to define it.
-#ifdef DART_COMPRESSED_POINTERS
- uint32_t align_next_field;
-#endif
-
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
- friend class GCMarker;
- template <bool>
- friend class MarkingVisitorBase;
- friend class Scavenger;
- template <bool>
- friend class ScavengerVisitorBase;
-};
-
-class UntaggedFinalizer : public UntaggedFinalizerBase {
- RAW_HEAP_OBJECT_IMPLEMENTATION(Finalizer);
-
- COMPRESSED_POINTER_FIELD(ClosurePtr, callback)
- COMPRESSED_POINTER_FIELD(TypeArgumentsPtr, type_arguments)
- VISIT_TO(type_arguments)
-
- template <std::memory_order order = std::memory_order_relaxed>
- FinalizerEntryPtr exchange_entries_collected(FinalizerEntryPtr value) {
- return ExchangeCompressedPointer<FinalizerEntryPtr,
- CompressedFinalizerEntryPtr, order>(
- &entries_collected_, value);
- }
-
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
- friend class GCMarker;
- template <bool>
- friend class MarkingVisitorBase;
- friend class Scavenger;
- template <bool>
- friend class ScavengerVisitorBase;
-};
-
-class UntaggedFinalizerEntry : public UntaggedInstance {
- RAW_HEAP_OBJECT_IMPLEMENTATION(FinalizerEntry);
-
- COMPRESSED_POINTER_FIELD(ObjectPtr, value) // Weak reference.
- VISIT_FROM(value)
- COMPRESSED_POINTER_FIELD(ObjectPtr, detach) // Weak reference.
- COMPRESSED_POINTER_FIELD(ObjectPtr, token)
- COMPRESSED_POINTER_FIELD(FinalizerBasePtr, finalizer) // Weak reference.
- // Used for the linked list in Finalizer::entries_collected_. That cannot be
- // an ordinary list because we need to add elements during a GC so we cannot
- // modify the heap.
- COMPRESSED_POINTER_FIELD(FinalizerEntryPtr, next)
- VISIT_TO(next)
-
- // Linked list is chaining all pending. Not visited by pointer visitors.
- // Only populated during the GC, otherwise null.
- COMPRESSED_POINTER_FIELD(FinalizerEntryPtr, next_seen_by_gc)
-
- template <typename Type, typename PtrType>
- friend struct GCLinkedList;
- template <typename GCVisitorType>
- friend void MournFinalized(GCVisitorType* visitor);
- friend class GCMarker;
- template <bool>
- friend class MarkingVisitorBase;
- friend class Scavenger;
- template <bool>
- friend class ScavengerVisitorBase;
-};
-
// MirrorReferences are used by mirrors to hold reflectees that are VM
// internal objects, such as libraries, classes, functions or types.
class UntaggedMirrorReference : public UntaggedInstance {
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 7953a1f..7784041 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -137,8 +137,6 @@
V(FfiVoid, "Void") \
V(FfiHandle, "Handle") \
V(Field, "Field") \
- V(FinalizerBase, "FinalizerBase") \
- V(FinalizerEntry, "FinalizerEntry") \
V(FinallyRetVal, ":finally_ret_val") \
V(FirstArg, "x") \
V(Float32List, "Float32List") \
@@ -310,7 +308,6 @@
V(_ExternalUint64Array, "_ExternalUint64Array") \
V(_ExternalUint8Array, "_ExternalUint8Array") \
V(_ExternalUint8ClampedArray, "_ExternalUint8ClampedArray") \
- V(_FinalizerImpl, "_FinalizerImpl") \
V(_Float32ArrayFactory, "Float32List.") \
V(_Float32ArrayView, "_Float32ArrayView") \
V(_Float32List, "_Float32List") \
@@ -410,7 +407,6 @@
V(_ensureScheduleImmediate, "_ensureScheduleImmediate") \
V(_future, "_future") \
V(_handleMessage, "_handleMessage") \
- V(_handleFinalizerMessage, "_handleFinalizerMessage") \
V(_instanceOf, "_instanceOf") \
V(_listGetAt, "_listGetAt") \
V(_listLength, "_listLength") \
diff --git a/runtime/vm/tagged_pointer.h b/runtime/vm/tagged_pointer.h
index 5a0b99f..0f53fe7 100644
--- a/runtime/vm/tagged_pointer.h
+++ b/runtime/vm/tagged_pointer.h
@@ -413,9 +413,6 @@
DEFINE_TAGGED_POINTER(RegExp, Instance)
DEFINE_TAGGED_POINTER(WeakProperty, Instance)
DEFINE_TAGGED_POINTER(WeakReference, Instance)
-DEFINE_TAGGED_POINTER(FinalizerBase, Instance)
-DEFINE_TAGGED_POINTER(Finalizer, Instance)
-DEFINE_TAGGED_POINTER(FinalizerEntry, Instance)
DEFINE_TAGGED_POINTER(MirrorReference, Instance)
DEFINE_TAGGED_POINTER(UserTag, Instance)
DEFINE_TAGGED_POINTER(FutureOr, Instance)
diff --git a/sdk/lib/_internal/vm/lib/core_patch.dart b/sdk/lib/_internal/vm/lib/core_patch.dart
index 79ff4aa..78b3bab 100644
--- a/sdk/lib/_internal/vm/lib/core_patch.dart
+++ b/sdk/lib/_internal/vm/lib/core_patch.dart
@@ -13,14 +13,10 @@
show
allocateOneByteString,
allocateTwoByteString,
- checkValidWeakTarget,
ClassID,
CodeUnits,
copyRangeFromUint8ListToOneByteString,
EfficientLengthIterable,
- FinalizerBase,
- FinalizerBaseMembers,
- FinalizerEntry,
FixedLengthListBase,
IterableElementError,
ListIterator,
@@ -32,12 +28,11 @@
makeFixedListUnmodifiable,
makeListFixedLength,
patch,
- reachabilityFence,
unsafeCast,
writeIntoOneByteString,
writeIntoTwoByteString;
-import "dart:async" show Completer, DeferredLoadException, Future, Timer, Zone;
+import "dart:async" show Completer, DeferredLoadException, Future, Timer;
import "dart:collection"
show
@@ -54,9 +49,9 @@
import "dart:convert" show ascii, Encoding, json, latin1, utf8;
-import "dart:ffi" show Pointer, Struct, Union, NativePort;
+import "dart:ffi" show Pointer, Struct, Union;
-import "dart:isolate" show Isolate, RawReceivePort;
+import "dart:isolate" show Isolate;
import "dart:typed_data"
show Endian, Uint8List, Int64List, Uint16List, Uint32List;
diff --git a/sdk/lib/_internal/vm/lib/expando_patch.dart b/sdk/lib/_internal/vm/lib/expando_patch.dart
index fd5bd93..cf34b7f 100644
--- a/sdk/lib/_internal/vm/lib/expando_patch.dart
+++ b/sdk/lib/_internal/vm/lib/expando_patch.dart
@@ -28,8 +28,7 @@
@patch
T? operator [](Object object) {
- // TODO(http://dartbug.com/48634): Rename to `key`.
- checkValidWeakTarget(object, 'object');
+ _checkType(object);
var mask = _size - 1;
var idx = object._identityHashCode & mask;
@@ -51,8 +50,7 @@
@patch
void operator []=(Object object, T? value) {
- // TODO(http://dartbug.com/48634): Rename to `key`.
- checkValidWeakTarget(object, 'object');
+ _checkType(object);
var mask = _size - 1;
var idx = object._identityHashCode & mask;
@@ -149,6 +147,19 @@
}
}
+ static _checkType(object) {
+ if ((object == null) ||
+ (object is bool) ||
+ (object is num) ||
+ (object is String) ||
+ (object is Pointer) ||
+ (object is Struct) ||
+ (object is Union)) {
+ throw new ArgumentError.value(object,
+ "Expandos are not allowed on strings, numbers, booleans, null, Pointers, Structs or Unions.");
+ }
+ }
+
int get _size => _data.length;
int get _limit => (3 * (_size ~/ 4));
@@ -159,14 +170,14 @@
@patch
class WeakReference<T extends Object> {
@patch
- factory WeakReference(T target) = _WeakReferenceImpl<T>;
+ factory WeakReference(T object) = _WeakReferenceImpl<T>;
}
@pragma("vm:entry-point")
class _WeakReferenceImpl<T extends Object> implements WeakReference<T> {
- _WeakReferenceImpl(T target) {
- checkValidWeakTarget(target, 'target');
- _target = target;
+ _WeakReferenceImpl(T object) {
+ Expando._checkType(object);
+ _target = object;
}
@pragma("vm:recognized", "other")
@@ -179,3 +190,11 @@
@pragma("vm:external-name", "WeakReference_setTarget")
external set _target(T? value);
}
+
+@patch
+class Finalizer<T> {
+ @patch
+ factory Finalizer(void Function(T) object) {
+ throw UnimplementedError("Finalizer");
+ }
+}
diff --git a/sdk/lib/_internal/vm/lib/finalizer_patch.dart b/sdk/lib/_internal/vm/lib/finalizer_patch.dart
index a9db853..aec537b 100644
--- a/sdk/lib/_internal/vm/lib/finalizer_patch.dart
+++ b/sdk/lib/_internal/vm/lib/finalizer_patch.dart
@@ -4,83 +4,5 @@
// part of "core_patch.dart";
-@patch
-@pragma("vm:entry-point")
-abstract class Finalizer<T> {
- @patch
- factory Finalizer(void Function(T) callback) = _FinalizerImpl<T>;
-}
-
-@pragma("vm:entry-point")
-class _FinalizerImpl<T> extends FinalizerBase implements Finalizer<T> {
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external void Function(T) get _callback;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set _callback(void Function(T) value);
-
- /// Constructs a finalizer.
- ///
- /// This is fine as a non-atomic operation, because the GC only looks at
- /// finalizer instances when it process their entries. By preventing inlining
- /// we ensure the the finalizer to have been fully initialized by the time
- /// any [attach] on it is called.
- ///
- /// Alternatively, we could make it a recognized method and add a reachability
- /// fence on the relevant members.
- @pragma('vm:never-inline')
- _FinalizerImpl(void Function(T) callback) {
- allEntries = <FinalizerEntry>{};
- _callback = Zone.current.bindUnaryCallbackGuarded(callback);
- setIsolate();
- isolateRegisterFinalizer();
- }
-
- void attach(Object value, T token, {Object? detach}) {
- checkValidWeakTarget(value, 'value');
- if (detach != null) {
- checkValidWeakTarget(detach, 'detach');
- }
-
- // Initializing the entry in a non-atomic way should be fine.
- // The only interesting step in the GC is when value is collected.
- // If the entry gets processed before initializing value, it will be null,
- // and this is fine. We will not consider it as being collected that GC.
- final entry = FinalizerEntry()
- ..value = value
- ..token = token
- ..detach = detach
- ..finalizer = this;
- allEntries.add(entry);
- // Ensure value stays reachable until after having initialized the entry.
- // This ensures the token and finalizer are set.
- reachabilityFence(value);
-
- if (detach != null) {
- (detachments[detach] ??= <FinalizerEntry>{}).add(entry);
- }
- }
-
- void _runFinalizers() {
- FinalizerEntry? entry = exchangeEntriesCollectedWithNull();
- while (entry != null) {
- final token = entry.token;
- // Check token for identical, detach might have been called.
- if (!identical(token, entry)) {
- _callback(unsafeCast<T>(token));
- }
- allEntries.remove(entry);
- final detach = entry.detach;
- if (detach != null) {
- detachments[detach]?.remove(entry);
- }
- entry = entry.next;
- }
- }
-
- @pragma("vm:entry-point", "call")
- static _handleFinalizerMessage(_FinalizerImpl finalizer) {
- finalizer._runFinalizers();
- }
-}
+// This is a placeholder file which will shortly contain a Finalizer
+// implementation.
diff --git a/sdk/lib/_internal/vm/lib/internal_patch.dart b/sdk/lib/_internal/vm/lib/internal_patch.dart
index 547835c..4c0fa92 100644
--- a/sdk/lib/_internal/vm/lib/internal_patch.dart
+++ b/sdk/lib/_internal/vm/lib/internal_patch.dart
@@ -9,7 +9,7 @@
import "dart:async" show Timer;
import "dart:core" hide Symbol;
-import "dart:ffi" show Pointer, Struct, Union;
+
import "dart:isolate" show SendPort;
import "dart:typed_data" show Int32List, Uint8List;
@@ -209,225 +209,3 @@
throw new LateError.localADI(localName);
}
}
-
-void checkValidWeakTarget(object, name) {
- if ((object == null) ||
- (object is bool) ||
- (object is num) ||
- (object is String) ||
- (object is Pointer) ||
- (object is Struct) ||
- (object is Union)) {
- throw new ArgumentError.value(object, name,
- "Cannot be a string, number, boolean, null, Pointer, Struct or Union");
- }
-}
-
-@pragma("vm:entry-point")
-class FinalizerBase {
- /// The list of finalizers of this isolate.
- ///
- /// Reuses [WeakReference] so that we don't have to implement yet another
- /// mechanism to hold on weakly to things.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external static List<WeakReference<FinalizerBase>>? get _isolateFinalizers;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external static set _isolateFinalizers(
- List<WeakReference<FinalizerBase>>? value);
-
- static int _isolateFinalizersPurgeCollectedAt = 1;
-
- /// Amortizes the cost for purging nulled out entries.
- ///
- /// Similar to how Expandos purge their nulled out entries on a rehash when
- /// resizing.
- static void _isolateFinalizersEnsureCapacity() {
- _isolateFinalizers ??= <WeakReference<FinalizerBase>>[];
- if (_isolateFinalizers!.length < _isolateFinalizersPurgeCollectedAt) {
- return;
- }
- // retainWhere does a single traversal.
- _isolateFinalizers!.retainWhere((weak) => weak.target != null);
- // We might have dropped most finalizers, trigger next resize at 2x.
- _isolateFinalizersPurgeCollectedAt = _isolateFinalizers!.length * 2;
- }
-
- /// Registers this [FinalizerBase] to the isolate.
- ///
- /// This is used to prevent sending messages from the GC to the isolate after
- /// isolate shutdown.
- void _isolateRegisterFinalizer() {
- _isolateFinalizersEnsureCapacity();
- _isolateFinalizers!.add(WeakReference(this));
- }
-
- /// The isolate this [FinalizerBase] belongs to.
- ///
- /// This is used to send finalizer messages to `_handleFinalizerMessage`
- /// without a Dart_Port.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external _setIsolate();
-
- /// All active attachments.
- ///
- /// This keeps the [FinalizerEntry]s belonging to this finalizer alive. If an
- /// entry gets collected, the finalizer is not run when the
- /// [FinalizerEntry.value] is collected.
- ///
- /// TODO(http://dartbug.com/47777): For native finalizers, what data structure
- /// can we use that we can modify in the VM. So that we don't have to send a
- /// message to Dart to clean up entries for which the GC has run.
- ///
- /// Requirements for data structure:
- /// 1. Keeps entries reachable. Entries that are collected will never run
- /// the GC.
- /// 2. Atomic insert in Dart on `attach`. GC should not run in between.
- /// 3. Atomic remove in Dart on `detach`. multiple GC tasks run in parallel.
- /// 4. Atomic remove in C++ on value being collected. Multiple GC tasks run in
- /// parallel.
- ///
- /// For Dart finalizers we execute the remove in Dart, much simpler.
- @pragma("vm:recognized", "other")
- @pragma('vm:prefer-inline')
- external Set<FinalizerEntry> get _allEntries;
- @pragma("vm:recognized", "other")
- @pragma('vm:prefer-inline')
- external set _allEntries(Set<FinalizerEntry> entries);
-
- /// Entries of which the value has been collected.
- ///
- /// This is a linked list, with [FinalizerEntry.next].
- ///
- /// Atomic exchange: The GC cannot run between reading the value and storing
- /// `null`. Atomicity guaranteed by force optimizing the function.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external FinalizerEntry? _exchangeEntriesCollectedWithNull();
-
- /// A weak map from `detach` keys to [FinalizerEntry]s.
- ///
- /// Using the [FinalizerEntry.detach] keys as keys in an [Expando] ensures
- /// they can be GCed.
- ///
- /// [FinalizerEntry]s do not get GCed themselves when their
- /// [FinalizerEntry.detach] is unreachable, in contrast to `WeakProperty`s
- /// which are GCed themselves when their `key` is no longer reachable.
- /// To prevent [FinalizerEntry]s staying around in [_detachments] forever,
- /// we reuse `WeakProperty`s.
- /// To avoid code duplication, we do not inline the code but use an [Expando]
- /// here instead.
- ///
- /// We cannot eagerly purge entries from the map (in the Expando) when GCed.
- /// The map is indexed on detach, and doesn't enable finding the entries
- /// based on their identity.
- /// Instead we rely on the WeakProperty being nulled out (assuming the
- /// `detach` key gets GCed) and then reused.
- @pragma("vm:recognized", "other")
- @pragma('vm:prefer-inline')
- external Expando<Set<FinalizerEntry>>? get _detachments;
- @pragma("vm:recognized", "other")
- @pragma('vm:prefer-inline')
- external set _detachments(Expando<Set<FinalizerEntry>>? value);
-
- void detach(Object detach) {
- final entries = detachments[detach];
- if (entries != null) {
- for (final entry in entries) {
- entry.token = entry;
- _allEntries.remove(entry);
- }
- detachments[detach] = null;
- }
- }
-}
-
-// Extension so that the members can be accessed from other libs.
-extension FinalizerBaseMembers on FinalizerBase {
- /// See documentation on [_allEntries].
- @pragma('vm:prefer-inline')
- Set<FinalizerEntry> get allEntries => _allEntries;
- @pragma('vm:prefer-inline')
- set allEntries(Set<FinalizerEntry> value) => _allEntries = value;
-
- /// See documentation on [_exchangeEntriesCollectedWithNull].
- FinalizerEntry? exchangeEntriesCollectedWithNull() =>
- _exchangeEntriesCollectedWithNull();
-
- /// See documentation on [_detachments].
- @pragma('vm:prefer-inline')
- Expando<Set<FinalizerEntry>> get detachments {
- _detachments ??= Expando<Set<FinalizerEntry>>();
- return unsafeCast<Expando<Set<FinalizerEntry>>>(_detachments);
- }
-
- /// See documentation on [_isolateRegisterFinalizer].
- isolateRegisterFinalizer() => _isolateRegisterFinalizer();
-
- /// See documentation on [_setIsolate].
- setIsolate() => _setIsolate();
-}
-
-/// Contains the informatation of an active [Finalizer.attach].
-///
-/// It holds on to the [value], optional [detach], and [token]. In addition, it
-/// also keeps a reference the [finalizer] it belings to and a [next] field for
-/// when being used in a linked list.
-///
-/// This is being kept alive by [FinalizerBase._allEntries] until either (1)
-/// [Finalizer.detach] detaches it, or (2) [value] is collected and the
-/// `callback` has been invoked.
-///
-/// Note that the GC itself uses an extra hidden field `next_seen_by_gc` to keep a
-/// linked list of pending entries while running the GC.
-@pragma("vm:entry-point")
-class FinalizerEntry {
- /// The [value] the [FinalizerBase] is attached to.
- ///
- /// Set to `null` by GC when unreachable.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external Object? get value;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set value(Object? value);
-
- /// The [detach] object can be passed to [FinalizerBase] to detach
- /// the finalizer.
- ///
- /// Set to `null` by GC when unreachable.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external Object? get detach;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set detach(Object? value);
-
- /// The [token] is passed to [FinalizerBase] when the finalizer is run.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external Object? get token;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set token(Object? value);
-
- /// The [finalizer] this [FinalizerEntry] belongs to.
- ///
- /// Set to `null` by GC when unreachable.
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set finalizer(FinalizerBase? finalizer);
-
- /// The [next] entry in a linked list.
- ///
- /// Used in for the linked list starting from
- /// [FinalizerBase._exchangeEntriesCollectedWithNull].
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external FinalizerEntry? get next;
- @pragma("vm:recognized", "other")
- @pragma("vm:prefer-inline")
- external set next(FinalizerEntry? value);
-}
diff --git a/sdk/lib/_internal/wasm/lib/internal_patch.dart b/sdk/lib/_internal/wasm/lib/internal_patch.dart
index 3cd8846..444a8ad 100644
--- a/sdk/lib/_internal/wasm/lib/internal_patch.dart
+++ b/sdk/lib/_internal/wasm/lib/internal_patch.dart
@@ -84,6 +84,12 @@
// Important: this is unsafe and must be used with care.
external T unsafeCast<T>(Object? v);
+// This function can be used to keep an object alive till that point.
+void reachabilityFence(Object? object) {}
+
+// This function can be used to encode native side effects.
+external void _nativeEffect(Object object);
+
// Thomas Wang 64-bit mix.
// https://gist.github.com/badboy/6267743
int mix64(int n) {
diff --git a/sdk/lib/core/weak.dart b/sdk/lib/core/weak.dart
index 3c8f968..01ef31c 100644
--- a/sdk/lib/core/weak.dart
+++ b/sdk/lib/core/weak.dart
@@ -207,15 +207,15 @@
/// with different, or the same, finalization token.
void attach(Object value, T finalizationToken, {Object? detach});
- /// Detaches this finalizer from values attached with [detach].
+ /// Detaches the finalizer from values attached with [detachToken].
///
/// Each attachment between this finalizer and a value,
- /// which was created by calling [attach] with the [detach] object as
+ /// which was created by calling [attach] with the [detachToken] object as
/// `detach` argument, is removed.
///
/// If the finalizer was attached multiple times to the same value
/// with different detachment keys,
- /// only those attachments which used [detach] are removed.
+ /// only those attachments which used [detachToken] are removed.
///
/// After detaching, an attachment won't cause any callbacks to happen
/// if the object become inaccessible.
@@ -242,5 +242,5 @@
/// }
/// }
/// ```
- void detach(Object detach);
+ void detach(Object detachToken);
}
diff --git a/sdk/lib/ffi/ffi.dart b/sdk/lib/ffi/ffi.dart
index 968c555..0d4d5b7 100644
--- a/sdk/lib/ffi/ffi.dart
+++ b/sdk/lib/ffi/ffi.dart
@@ -39,6 +39,7 @@
/// Represents a pointer into the native C memory. Cannot be extended.
@pragma('vm:entry-point')
+@pragma("wasm:entry-point")
class Pointer<T extends NativeType> extends NativeType {
/// Construction from raw integer.
external factory Pointer.fromAddress(int ptr);
diff --git a/sdk/lib/ffi/struct.dart b/sdk/lib/ffi/struct.dart
index 0a249f8..c02a059 100644
--- a/sdk/lib/ffi/struct.dart
+++ b/sdk/lib/ffi/struct.dart
@@ -8,6 +8,7 @@
///
/// FFI struct types should extend [Struct]. For more information see the
/// documentation on this class.
+@pragma("wasm:entry-point")
abstract class _Compound extends NativeType {
@pragma("vm:entry-point")
final Object _typedDataBase;
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 6b2b940..96ef3e5 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -723,7 +723,6 @@
/// therefore not be sent.
/// - [ReceivePort]
/// - [DynamicLibrary]
- /// - [Finalizer]
/// - [Pointer]
/// - [UserTag]
/// - `MirrorReference`
diff --git a/sdk/lib/libraries.json b/sdk/lib/libraries.json
index b05ae57..6e19316 100644
--- a/sdk/lib/libraries.json
+++ b/sdk/lib/libraries.json
@@ -215,6 +215,20 @@
"_internal/wasm/lib/developer.dart"
]
},
+ "ffi": {
+ "uri": "ffi/ffi.dart",
+ "patches": [
+ "_internal/vm/lib/ffi_patch.dart",
+ "_internal/vm/lib/ffi_allocation_patch.dart",
+ "_internal/vm/lib/ffi_dynamic_library_patch.dart",
+ "_internal/vm/lib/ffi_native_finalizer_patch.dart",
+ "_internal/vm/lib/ffi_native_type_patch.dart",
+ "_internal/vm/lib/ffi_struct_patch.dart"
+ ]
+ },
+ "nativewrappers": {
+ "uri": "html/dartium/nativewrappers.dart"
+ },
"isolate": {
"uri": "isolate/isolate.dart"
},
diff --git a/sdk/lib/libraries.yaml b/sdk/lib/libraries.yaml
index d4e109f..5c55e5a 100644
--- a/sdk/lib/libraries.yaml
+++ b/sdk/lib/libraries.yaml
@@ -203,6 +203,17 @@
uri: developer/developer.dart
patches:
- _internal/wasm/lib/developer.dart
+ ffi:
+ uri: "ffi/ffi.dart"
+ patches:
+ - "_internal/vm/lib/ffi_patch.dart"
+ - "_internal/vm/lib/ffi_allocation_patch.dart"
+ - "_internal/vm/lib/ffi_dynamic_library_patch.dart"
+ - "_internal/vm/lib/ffi_native_finalizer_patch.dart"
+ - "_internal/vm/lib/ffi_native_type_patch.dart"
+ - "_internal/vm/lib/ffi_struct_patch.dart"
+ nativewrappers:
+ uri: "html/dartium/nativewrappers.dart"
isolate:
uri: isolate/isolate.dart
math:
diff --git a/tools/VERSION b/tools/VERSION
index 74cb2d0..3c727f4 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 227
+PRERELEASE 228
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/experimental_features.yaml b/tools/experimental_features.yaml
index 0fd686d..012b604 100644
--- a/tools/experimental_features.yaml
+++ b/tools/experimental_features.yaml
@@ -125,6 +125,9 @@
macros:
help: "Static meta-programming"
+ inference-update-1:
+ help: "Enhanced type inference"
+
# Experiment flag only used for testing.
test-experiment:
help: >-