Version 2.13.0-142.0.dev

Merge commit 'e8f57b66058287fb5243928341f1dde517dc249a' into 'dev'
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index aac827c..d0d6737 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -881,10 +881,3 @@
   static const int DEFAULT = 50;
   static const int IN_FILE = 40;
 }
-
-/// An enumeration of quick fix kinds for the errors found in an Android
-/// manifest file.
-class ManifestFixKind {}
-
-/// An enumeration of quick fix kinds for the errors found in a pubspec file.
-class PubspecFixKind {}
diff --git a/pkg/analysis_server/lib/src/services/correction/namespace.dart b/pkg/analysis_server/lib/src/services/correction/namespace.dart
index f80cee9..30c5494 100644
--- a/pkg/analysis_server/lib/src/services/correction/namespace.dart
+++ b/pkg/analysis_server/lib/src/services/correction/namespace.dart
@@ -138,9 +138,3 @@
   return internal_getImportElement(
       libraryElement, prefix, usedElement, importElementsMap);
 }
-
-/// Information about [ImportElement] and place where it is referenced using
-/// [PrefixElement].
-class ImportElementInfo {
-  ImportElement element;
-}
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 9438324..08ac90a 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -248,15 +248,3 @@
     super.createProject(packageRoots: packageRoots);
   }
 }
-
-mixin WithNullSafetyMixin on AbstractAnalysisTest {
-  @override
-  void createProject({Map<String, String> packageRoots}) {
-    addAnalysisOptionsFile('''
-analyzer:
-  enable-experiment:
-    - non-nullable
-''');
-    super.createProject(packageRoots: packageRoots);
-  }
-}
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
index 2090cf6..07e6752 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
@@ -19,12 +19,6 @@
 
 import '../../../abstract_context.dart';
 
-int suggestionComparator(CompletionSuggestion s1, CompletionSuggestion s2) {
-  var c1 = s1.completion.toLowerCase();
-  var c2 = s2.completion.toLowerCase();
-  return c1.compareTo(c2);
-}
-
 SuggestionMatcher suggestionHas(
         {@required String completion,
         ElementKind element,
diff --git a/pkg/analysis_server/test/src/services/correction/fix/manifest/test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/manifest/test_support.dart
deleted file mode 100644
index f071ec8..0000000
--- a/pkg/analysis_server/test/src/services/correction/fix/manifest/test_support.dart
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2019, 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:analysis_server/plugin/edit/fix/fix_core.dart';
-import 'package:analysis_server/src/protocol_server.dart' show SourceEdit;
-import 'package:analysis_server/src/services/correction/fix/manifest/fix_generator.dart';
-import 'package:analyzer/src/manifest/manifest_validator.dart';
-import 'package:analyzer/src/manifest/manifest_values.dart';
-import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
-import 'package:analyzer_plugin/protocol/protocol_common.dart';
-import 'package:html/parser.dart';
-import 'package:test/test.dart';
-
-/// A base class providing utility methods for tests of fixes associated with
-/// errors in Android manifest files.
-class ManifestFixTest with ResourceProviderMixin {
-  Future<void> assertHasFix(
-      String initialContent, String expectedContent) async {
-    var fixes = await _getFixes(initialContent);
-    expect(fixes, hasLength(1));
-    var fileEdits = fixes[0].change.edits;
-    expect(fileEdits, hasLength(1));
-
-    var actualContent =
-        SourceEdit.applySequence(initialContent, fileEdits[0].edits);
-    expect(actualContent, expectedContent);
-  }
-
-  Future<void> assertHasNoFix(String initialContent) async {
-    var fixes = await _getFixes(initialContent);
-    expect(fixes, hasLength(0));
-  }
-
-  Future<List<Fix>> _getFixes(String content) {
-    var manifestFile = getFile('/package/AndroidManifest.xml');
-    var document =
-        parseFragment(content, container: MANIFEST_TAG, generateSpans: true);
-    expect(document, isNotNull);
-    var validator = ManifestValidator(manifestFile.createSource());
-    var errors = validator.validate(content, true);
-    expect(errors, hasLength(1));
-    var error = errors[0];
-    var generator = ManifestFixGenerator(error, content, document);
-    return generator.computeFixes();
-  }
-}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart
deleted file mode 100644
index 6fc913e..0000000
--- a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2019, 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:analysis_server/plugin/edit/fix/fix_core.dart';
-import 'package:analysis_server/src/protocol_server.dart' show SourceEdit;
-import 'package:analysis_server/src/services/correction/fix/pubspec/fix_generator.dart';
-import 'package:analyzer/src/pubspec/pubspec_validator.dart';
-import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
-import 'package:analyzer_plugin/protocol/protocol_common.dart';
-import 'package:test/test.dart';
-import 'package:yaml/yaml.dart';
-
-/// A base class providing utility methods for tests of fixes associated with
-/// errors in pubspec files.
-class PubspecFixTest with ResourceProviderMixin {
-  Future<void> assertHasFix(
-      String initialContent, String expectedContent) async {
-    var fixes = await _getFixes(initialContent);
-    expect(fixes, hasLength(1));
-    var fileEdits = fixes[0].change.edits;
-    expect(fileEdits, hasLength(1));
-
-    var actualContent =
-        SourceEdit.applySequence(initialContent, fileEdits[0].edits);
-    expect(actualContent, expectedContent);
-  }
-
-  Future<void> assertHasNoFix(String initialContent) async {
-    var fixes = await _getFixes(initialContent);
-    expect(fixes, hasLength(0));
-  }
-
-  Future<List<Fix>> _getFixes(String content) {
-    var pubspecFile = getFile('/package/pubspec.yaml');
-    var pubspec = _parseYaml(content);
-    expect(pubspec, isNotNull);
-    var validator =
-        PubspecValidator(resourceProvider, pubspecFile.createSource());
-    var errors = validator.validate(pubspec.nodes);
-    expect(errors, hasLength(1));
-    var error = errors[0];
-    var generator = PubspecFixGenerator(error, content, pubspec);
-    return generator.computeFixes();
-  }
-
-  YamlMap _parseYaml(String content) {
-    if (content == null) {
-      return YamlMap();
-    }
-    try {
-      var doc = loadYamlNode(content);
-      if (doc is YamlMap) {
-        return doc;
-      }
-      return YamlMap();
-    } catch (exception) {
-      return null;
-    }
-  }
-}
diff --git a/pkg/vm/lib/transformations/type_flow/transformer.dart b/pkg/vm/lib/transformations/type_flow/transformer.dart
index ff602a2..221cb64 100644
--- a/pkg/vm/lib/transformations/type_flow/transformer.dart
+++ b/pkg/vm/lib/transformations/type_flow/transformer.dart
@@ -1185,9 +1185,11 @@
     if (_isUnreachable(node)) {
       return _makeUnreachableInitializer([node.value]);
     } else {
-      assert(shaker.isMemberBodyReachable(node.field),
-          "Field should be reachable: ${node.field}");
-      if (!shaker.retainField(node.field)) {
+      final field =
+          fieldMorpher.getOriginalMember(node.fieldReference.asMember) as Field;
+      assert(shaker.isMemberBodyReachable(field),
+          "Field should be reachable: ${field}");
+      if (!shaker.retainField(field)) {
         if (mayHaveSideEffects(node.value)) {
           return LocalInitializer(
               VariableDeclaration(null, initializer: node.value));
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart b/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart
new file mode 100644
index 0000000..6c4d972
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, 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.12
+
+class A {
+  void doTest(Z a) {
+    print(a.appName);
+  }
+}
+
+class Z {
+  final String? appName;
+  Z({this.appName});
+}
+
+class X extends Base implements Z {}
+
+class Base {
+  String get appName => 'x';
+}
+
+void main() {
+  Z();
+  A().doTest(X());
+}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart.expect
new file mode 100644
index 0000000..2ef7c98
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart.expect
@@ -0,0 +1,34 @@
+library #lib /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    : super core::Object::•()
+    ;
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method doTest([@vm.inferred-type.metadata=#lib::X] self::Z a) → void {
+    core::print([@vm.direct-call.metadata=#lib::Base.appName] [@vm.inferred-type.metadata=dart.core::_OneByteString (value: "x")] a.{self::Z::appName});
+  }
+}
+class Z extends core::Object {
+  constructor •() → self::Z
+    : super core::Object::•()
+    ;
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:3]  abstract get /*isLegacy*/ appName() → core::String?;
+}
+class X extends self::Base implements self::Z {
+  synthetic constructor •() → self::X
+    : super self::Base::•()
+    ;
+}
+abstract class Base extends core::Object {
+  synthetic constructor •() → self::Base
+    : super core::Object::•()
+    ;
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:3]  get appName() → core::String
+    return "x";
+}
+static method main() → void {
+  new self::Z::•();
+  [@vm.direct-call.metadata=#lib::A.doTest] [@vm.inferred-type.metadata=!? (skip check)] new self::A::•().{self::A::doTest}(new self::X::•());
+}
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index 9bb72df..5b562ac 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -222,7 +222,7 @@
 
   const intptr_t kMaxSlotsCollected = 5;
   const auto slots = reinterpret_cast<ObjectPtr*>(caller_frame->sp());
-  const auto num_slots_in_frame =
+  const intptr_t num_slots_in_frame =
       reinterpret_cast<ObjectPtr*>(caller_frame->fp()) - slots;
   const auto num_slots_to_collect =
       Utils::Maximum(kMaxSlotsCollected, num_slots_in_frame);
diff --git a/runtime/vm/virtual_memory_compressed.h b/runtime/vm/virtual_memory_compressed.h
index 95f4d52..4201018 100644
--- a/runtime/vm/virtual_memory_compressed.h
+++ b/runtime/vm/virtual_memory_compressed.h
@@ -12,7 +12,7 @@
 namespace dart {
 
 #if defined(DART_COMPRESSED_POINTERS)
-static constexpr intptr_t kCompressedHeapSize = 2 * GB;
+static constexpr intptr_t kCompressedHeapSize = 4 * GB;
 static constexpr intptr_t kCompressedHeapAlignment = 4 * GB;
 static constexpr intptr_t kCompressedHeapPageSize = kOldPageSize;
 static constexpr intptr_t kCompressedHeapNumPages =
diff --git a/tools/VERSION b/tools/VERSION
index d053d5c..fce1429 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 13
 PATCH 0
-PRERELEASE 141
+PRERELEASE 142
 PRERELEASE_PATCH 0
\ No newline at end of file