diff --git a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart index 4b49cea8efd..e4394e1f7cd 100644 --- a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart +++ b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart @@ -18,9 +18,12 @@ import 'package:ffi/ffi.dart'; import 'fast_object_copy_test.dart' show UserObject, SendReceiveTestBase, notAllocatableInTLAB; +typedef TypeLiteral = T; + topLevelClosure(a, b) {} topLevelClosureG(T a, T b) {} Type getType() => T; +Type invokeWithType(Type Function() fun) => fun(); class A { dynamic m(T a, H b) => this; @@ -67,8 +70,27 @@ final sharableObjects = [ final Function(int, int) partialInstantiatedInnerClosure = topLevelClosureG; return partialInstantiatedInnerClosure; }(), + + // Types: Type literal constants + getType(), + getType<(int, double, Object)>(), getType(), getType(int, double, T)>(), + + // Types: Instantiated & canonicalized types. + invokeWithType(() => getType()), + invokeWithType(() => getType<(T, T)>()), + invokeWithType(() => getType>()), + invokeWithType(() => getType()), + invokeWithType(() => getType(T, T)>()), + + // Types: Instantiated but non-canonicalized types. + invokeWithType(() => TypeLiteral), + invokeWithType(() => TypeLiteral<(T, T)>), + invokeWithType(() => TypeLiteral>), + invokeWithType(() => TypeLiteral), + invokeWithType(() => TypeLiteral(T, T)>), + const [1, 2, 3], const {1: 1, 2: 2, 3: 2}, const {1, 2, 3}, diff --git a/runtime/vm/class_id.h b/runtime/vm/class_id.h index c0939851c35..38c5f10e82b 100644 --- a/runtime/vm/class_id.h +++ b/runtime/vm/class_id.h @@ -475,7 +475,8 @@ inline bool ShouldHaveImmutabilityBitSet(intptr_t index) { index == kFloat32x4Cid || index == kFloat64x2Cid || index == kInt32x4Cid || index == kSendPortCid || index == kCapabilityCid || index == kRegExpCid || index == kBoolCid || - index == kNullCid || index == kPointerCid; + index == kNullCid || index == kPointerCid || index == kTypeCid || + index == kRecordTypeCid || index == kFunctionTypeCid; } inline bool IsFfiTypeClassId(intptr_t index) {