Version 2.14.0-382.0.dev
Merge commit 'f9c8f3c920ecad0f982715966bc230630c500069' into 'dev'
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index 29f4fe2..819f901 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -2871,7 +2871,7 @@
*/
static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
- "The class '{0}' doesn't have a default constant constructor.",
+ "The class '{0}' doesn't have an unnamed constant constructor.",
correction: "Try calling a different constructor.");
static const CompileTimeErrorCode CONTINUE_LABEL_ON_SWITCH =
@@ -3227,7 +3227,7 @@
static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT =
CompileTimeErrorCode(
'DUPLICATE_CONSTRUCTOR',
- "The default constructor is already defined.",
+ "The unnamed constructor is already defined.",
correction: "Try giving one of the constructors a name.",
hasPublishedDocs: true,
uniqueName: 'DUPLICATE_CONSTRUCTOR_DEFAULT',
@@ -8848,7 +8848,7 @@
// ```
static const CompileTimeErrorCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
CompileTimeErrorCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
- "The class '{0}' doesn't have a default constructor.",
+ "The class '{0}' doesn't have an unnamed constructor.",
correction:
"Try using one of the named constructors defined in '{0}'.",
hasPublishedDocs: true);
@@ -9955,8 +9955,8 @@
static const CompileTimeErrorCode NON_GENERATIVE_IMPLICIT_CONSTRUCTOR =
CompileTimeErrorCode(
'NON_GENERATIVE_IMPLICIT_CONSTRUCTOR',
- "The default constructor of superclass '{0}' (called by the implicit "
- "default constructor of '{1}') must be a generative constructor, "
+ "The unnamed constructor of superclass '{0}' (called by the default "
+ "constructor of '{1}') must be a generative constructor, "
"but factory found.",
correction: "Try adding an explicit constructor that has a different "
"superinitializer or changing the superclass constructor '{2}' "
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index 0cdb816..3d568e4 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -3352,7 +3352,7 @@
_The constructor with name '{0}' is already defined._
-_The default constructor is already defined._
+_The unnamed constructor is already defined._
#### Description
@@ -8738,7 +8738,7 @@
### new_with_undefined_constructor_default
-_The class '{0}' doesn't have a default constructor._
+_The class '{0}' doesn't have an unnamed constructor._
#### Description
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 1639290..65e627a 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -10,8 +10,6 @@
constructor_tearoffs/call_instantiation: TypeCheckError
constructor_tearoffs/const_tear_off: RuntimeError
-constructor_tearoffs/redirecting_constructors: RuntimeError
-constructor_tearoffs/redirecting_factory_tear_off: RuntimeError
extension_types/extension_on_nullable: ExpectationFileMismatchSerialized # Expected.
extension_types/issue45775: ExpectationFileMismatchSerialized # Expected.
extension_types/simple: ExpectationFileMismatchSerialized # Expected.
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index 4f9feaa..9803b19 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -8,8 +8,6 @@
constructor_tearoffs/call_instantiation: TypeCheckError
constructor_tearoffs/const_tear_off: RuntimeError
-constructor_tearoffs/redirecting_constructors: RuntimeError
-constructor_tearoffs/redirecting_factory_tear_off: RuntimeError
extension_types/extension_on_nullable: ExpectationFileMismatchSerialized # Expected.
extension_types/issue45775: ExpectationFileMismatchSerialized # Expected.
extension_types/simple: ExpectationFileMismatchSerialized # Expected.
diff --git a/pkg/front_end/testcases/weak.status b/pkg/front_end/testcases/weak.status
index 264d1d2..60c84f44 100644
--- a/pkg/front_end/testcases/weak.status
+++ b/pkg/front_end/testcases/weak.status
@@ -13,8 +13,6 @@
constructor_tearoffs/call_instantiation: TypeCheckError
constructor_tearoffs/const_tear_off: RuntimeError
-constructor_tearoffs/redirecting_constructors: RuntimeError
-constructor_tearoffs/redirecting_factory_tear_off: RuntimeError
extension_types/extension_on_nullable: ExpectationFileMismatchSerialized # Expected.
extension_types/issue45775: ExpectationFileMismatchSerialized # Expected.
extension_types/simple: ExpectationFileMismatchSerialized # Expected.
diff --git a/pkg/vm/lib/transformations/type_flow/native_code.dart b/pkg/vm/lib/transformations/type_flow/native_code.dart
index 0611379..d41fa98 100644
--- a/pkg/vm/lib/transformations/type_flow/native_code.dart
+++ b/pkg/vm/lib/transformations/type_flow/native_code.dart
@@ -8,8 +8,6 @@
import 'package:kernel/ast.dart';
import 'package:kernel/library_index.dart' show LibraryIndex;
-import 'package:front_end/src/api_unstable/vm.dart'
- show getRedirectingFactoryBody;
import 'calls.dart';
import 'types.dart';
@@ -74,26 +72,6 @@
var type = _annotationsDefineRoot(proc.annotations);
if (type == null) return;
- if (proc.isRedirectingFactory) {
- if (type != PragmaEntryPointType.CallOnly &&
- type != PragmaEntryPointType.Default) {
- throw "Error: factory $proc doesn't have a setter or getter";
- }
- Member target = proc;
- while (target is Procedure && target.isRedirectingFactory) {
- target = getRedirectingFactoryBody(target)!.target!;
- assert(
- (target is Procedure && target.isFactory) || target is Constructor);
- }
- entryPoints
- .addRawCall(new DirectSelector(target, callKind: CallKind.Method));
- if (target is Constructor) {
- entryPoints.addAllocatedClass(target.enclosingClass);
- }
- nativeCodeOracle.setMemberReferencedFromNativeCode(target);
- return;
- }
-
void addSelector(CallKind ck) {
entryPoints.addRawCall(proc.isInstanceMember
? new InterfaceSelector(proc, callKind: ck)
diff --git a/pkg/vm/lib/transformations/type_flow/summary_collector.dart b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
index 9905fcc..5715f1b 100644
--- a/pkg/vm/lib/transformations/type_flow/summary_collector.dart
+++ b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
@@ -608,7 +608,6 @@
"${member}${fieldSummaryType == FieldSummaryType.kFieldGuard ? " (guard)" : ""}";
debugPrint("===== $summaryName =====");
assert(!member.isAbstract);
- assert(!(member is Procedure && member.isRedirectingFactory));
_protobufHandler?.beforeSummaryCreation(member);
@@ -2477,17 +2476,7 @@
return new ConcreteType(resultClass.cls, null, constant);
}
- @override
- Type visitStaticTearOffConstant(StaticTearOffConstant constant) {
- final Procedure member = constant.target;
- summaryCollector._entryPointsListener
- .addRawCall(new DirectSelector(member));
- summaryCollector._entryPointsListener.recordTearOff(member);
- return _getStaticType(constant);
- }
-
- @override
- Type visitConstructorTearOffConstant(ConstructorTearOffConstant constant) {
+ Type _visitTearOffConstant(TearOffConstant constant) {
final Member member = constant.target;
summaryCollector._entryPointsListener
.addRawCall(new DirectSelector(member));
@@ -2500,6 +2489,19 @@
}
@override
+ Type visitStaticTearOffConstant(StaticTearOffConstant constant) =>
+ _visitTearOffConstant(constant);
+
+ @override
+ Type visitConstructorTearOffConstant(ConstructorTearOffConstant constant) =>
+ _visitTearOffConstant(constant);
+
+ @override
+ Type visitRedirectingFactoryTearOffConstant(
+ RedirectingFactoryTearOffConstant constant) =>
+ _visitTearOffConstant(constant);
+
+ @override
Type visitInstantiationConstant(InstantiationConstant constant) {
constant.tearOffConstant.accept(this);
return _getStaticType(constant);
diff --git a/pkg/vm/lib/transformations/type_flow/transformer.dart b/pkg/vm/lib/transformations/type_flow/transformer.dart
index e964f61..cf136cc 100644
--- a/pkg/vm/lib/transformations/type_flow/transformer.dart
+++ b/pkg/vm/lib/transformations/type_flow/transformer.dart
@@ -1944,6 +1944,12 @@
}
@override
+ visitRedirectingFactoryTearOffConstant(
+ RedirectingFactoryTearOffConstant constant) {
+ shaker.addUsedMember(constant.target);
+ }
+
+ @override
visitInstantiationConstant(InstantiationConstant constant) {
analyzeConstant(constant.tearOffConstant);
}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter57213.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter57213.dart.expect
index a079cbe..30e6574 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter57213.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter57213.dart.expect
@@ -7,6 +7,9 @@
constructor •() → self::A
: super core::Object::•()
;
+ @#C3
+ static factory foo() → self::A
+ return new self::B::•();
}
class B extends self::A {
constructor •() → self::B
@@ -17,11 +20,16 @@
constructor •() → self::C
: super core::Object::•()
;
+ @#C3
+ static factory bar() → self::C
+ return [@vm.inferred-type.metadata=#lib::E] self::D::baz();
}
abstract class D extends self::C {
constructor •() → self::D
: super self::C::•()
;
+ static factory baz() → self::D
+ return new self::E::•();
}
class E extends self::D {
constructor •() → self::E
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index 53ff1e6..eebce6d 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -50,24 +50,28 @@
}
// Closures that are not implicit instance closures are unique.
const auto& func_a = Function::Handle(zone, receiver.function());
- if (!func_a.IsImplicitInstanceClosureFunction()) {
+ if (!func_a.IsImplicitClosureFunction()) {
return false;
}
const auto& func_b = Function::Handle(zone, other_closure.function());
- if (!func_b.IsImplicitInstanceClosureFunction()) {
+ if (!func_b.IsImplicitClosureFunction()) {
return false;
}
// If the closure functions are not the same, check the function's name and
// owner, as multiple function objects could exist for the same function due
// to hot reload.
if (func_a.ptr() != func_b.ptr() &&
- (func_a.name() != func_b.name() || func_a.Owner() != func_b.Owner())) {
+ (func_a.name() != func_b.name() || func_a.Owner() != func_b.Owner() ||
+ func_a.is_static() != func_b.is_static())) {
return false;
}
- // Check that the both receiver instances are the same.
- const Context& context_a = Context::Handle(zone, receiver.context());
- const Context& context_b = Context::Handle(zone, other_closure.context());
- return context_a.At(0) == context_b.At(0);
+ if (!func_a.is_static()) {
+ // Check that the both receiver instances are the same.
+ const Context& context_a = Context::Handle(zone, receiver.context());
+ const Context& context_b = Context::Handle(zone, other_closure.context());
+ return context_a.At(0) == context_b.At(0);
+ }
+ return true;
}
DEFINE_NATIVE_ENTRY(Closure_equals, 0, 2) {
diff --git a/runtime/tests/vm/dart/redirection_type_shuffling_test.dart b/runtime/tests/vm/dart/redirection_type_shuffling_test.dart
index 0567a24..d937ba1 100644
--- a/runtime/tests/vm/dart/redirection_type_shuffling_test.dart
+++ b/runtime/tests/vm/dart/redirection_type_shuffling_test.dart
@@ -7,14 +7,14 @@
class G<A extends int, B extends String> {
G();
- factory G.swap() = G<B,A>; //# 00: compile-time error
- factory G.retain() = G<A,B>;
+ factory G.swap() = G<B, A>; //# 00: compile-time error
+ factory G.retain() = G<A, B>;
}
main() {
ClassMirror cm = reflect(new G<int, String>()).type;
- Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int,String>);
+ Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int, String>);
- Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String,int>); //# 00: dynamic type error
+ Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String, int>); //# 00: continued
}
diff --git a/runtime/tests/vm/dart_2/redirection_type_shuffling_test.dart b/runtime/tests/vm/dart_2/redirection_type_shuffling_test.dart
index 409bc98..7df8ad7 100644
--- a/runtime/tests/vm/dart_2/redirection_type_shuffling_test.dart
+++ b/runtime/tests/vm/dart_2/redirection_type_shuffling_test.dart
@@ -9,14 +9,14 @@
class G<A extends int, B extends String> {
G();
- factory G.swap() = G<B,A>; //# 00: compile-time error
- factory G.retain() = G<A,B>;
+ factory G.swap() = G<B, A>; //# 00: compile-time error
+ factory G.retain() = G<A, B>;
}
main() {
ClassMirror cm = reflect(new G<int, String>()).type;
- Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int,String>);
+ Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int, String>);
- Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String,int>); //# 00: dynamic type error
+ Expect.isTrue(cm.newInstance(#swap, []).reflectee is G<String, int>); //# 00: continued
}
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 41a7490..2105623 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -71,18 +71,11 @@
dart_2/trigger_gc_in_native_test: Skip # This test crashes on the bot, but not locally, and infrastructure repeatly fails to locate its coredump.
[ $compiler == app_jitk ]
-dart/redirection_type_shuffling_test/none: RuntimeError
dart/snapshot_version_test: RuntimeError
-dart_2/redirection_type_shuffling_test/none: RuntimeError
dart_2/snapshot_version_test: RuntimeError
[ $compiler == dartk ]
-cc/DartAPI_New: Fail # Issue #33041
cc/IsolateReload_LibraryLookup: Fail, Crash # Issue 32190
-dart/redirection_type_shuffling_test/00: RuntimeError, Pass
-dart/redirection_type_shuffling_test/none: RuntimeError
-dart_2/redirection_type_shuffling_test/00: RuntimeError, Pass
-dart_2/redirection_type_shuffling_test/none: RuntimeError
[ $compiler != dartk ]
cc/IsolateReload_KernelIncrementalCompile: SkipByDesign
@@ -100,10 +93,12 @@
[ $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/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.
dart_2/causal_stacks/async_throws_stack_no_causal_non_symbolic_test: SkipByDesign # --no-lazy... does nothing on precompiler.
dart_2/causal_stacks/async_throws_stack_no_causal_test: SkipByDesign # --no-lazy... does nothing on precompiler.
+dart_2/redirection_type_shuffling_test: SkipByDesign # Uses dart:mirrors.
dart_2/scavenger_abort_test: SkipSlow
dart_2/v8_snapshot_profile_writer_test: Pass, Slow # Can be slow due to re-invoking the precompiler.
@@ -141,9 +136,7 @@
cc/CreateMirrorSystem: SkipByDesign # Imports dart:mirrors
cc/StandaloneSnapshotSize: SkipByDesign # Imports dart:mirrors
dart/gen_snapshot_include_resolved_urls_test: SkipByDesign # Script URLs not included in product gen_snapshot
-dart/redirection_type_shuffling_test: SkipByDesign # Imports dart:mirrors
dart_2/gen_snapshot_include_resolved_urls_test: SkipByDesign # Script URLs not included in product gen_snapshot
-dart_2/redirection_type_shuffling_test: SkipByDesign # Imports dart:mirrors
[ $nnbd == legacy ]
dart/*: SkipByDesign # Migrated tests are not supposed to run on non-NNBD bots.
@@ -242,10 +235,6 @@
[ $compiler == dartk && $system == windows ]
cc/IsolateReload_LibraryLookup: Fail, Crash
-[ $compiler == dartk && $checked ]
-dart/redirection_type_shuffling_test/00: Pass # Works in --checked mode but not in --strong mode.
-dart_2/redirection_type_shuffling_test/00: Pass # Works in --checked mode but not in --strong mode.
-
[ $compiler == dartk && ($arch == simarm || $arch == simarm64 || $arch == simarm64c) ]
dart/appjit*: SkipSlow # DFE too slow
dart/b162922506_test: SkipSlow # Generates large input file
@@ -287,9 +276,7 @@
dart_2/regress_45898_test: Pass, Slow
[ $compiler == dartkp && ($runtime == dart_precompiled || $runtime == vm) ]
-dart/redirection_type_shuffling_test: SkipByDesign # Includes dart:mirrors.
dart/spawn_shutdown_test: SkipSlow
-dart_2/redirection_type_shuffling_test: SkipByDesign # Includes dart:mirrors.
dart_2/spawn_shutdown_test: SkipSlow
[ $mode == debug && $system == windows ]
diff --git a/runtime/vm/compiler/frontend/constant_reader.cc b/runtime/vm/compiler/frontend/constant_reader.cc
index 6040fb1..22efe3c 100644
--- a/runtime/vm/compiler/frontend/constant_reader.cc
+++ b/runtime/vm/compiler/frontend/constant_reader.cc
@@ -345,15 +345,9 @@
type_arguments, function, context, Heap::kOld);
break;
}
- case kStaticTearOffConstant: {
- const NameIndex index = reader.ReadCanonicalNameReference();
- Function& function =
- Function::Handle(Z, H.LookupStaticMethodByKernelProcedure(index));
- function = function.ImplicitClosureFunction();
- instance = function.ImplicitStaticClosure();
- break;
- }
- case kConstructorTearOffConstant: {
+ case kStaticTearOffConstant:
+ case kConstructorTearOffConstant:
+ case kRedirectingFactoryTearOffConstant: {
const NameIndex index = reader.ReadCanonicalNameReference();
Function& function = Function::Handle(Z);
if (H.IsConstructor(index)) {
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index a45e80c..cd29703 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -1946,8 +1946,7 @@
// additional functions can cause strain on the VM. They are therefore skipped
// in jit mode and their associated origin function is used instead as
// interface call target.
- if (procedure_helper.IsRedirectingFactory() ||
- (!FLAG_precompiled_mode && procedure_helper.IsMemberSignature())) {
+ if (!FLAG_precompiled_mode && procedure_helper.IsMemberSignature()) {
helper_.SetOffset(procedure_end);
return;
}
diff --git a/tools/VERSION b/tools/VERSION
index 58a7755..2e10b12 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 381
+PRERELEASE 382
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 6120112..8faa484 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -1497,7 +1497,8 @@
"vm-kernel-precomp-linux-debug-x64",
"vm-kernel-precomp-linux-debug-x64c",
"vm-kernel-precomp-linux-debug-simarm64",
- "vm-kernel-precomp-linux-debug-simarm64c"
+ "vm-kernel-precomp-linux-debug-simarm64c",
+ "vm-kernel-precomp-win-debug-x64c"
],
"meta": {
"description": "This configuration is used by the vm kernel precomp debug builders. It uses 15 shards for testing to avoid 1 hour shard timeouts."