Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 2975433002: Assert that we don't mix K and J elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 44fcc597ac039edf58f5376b60500ac5a9568348..6404feae50fcd27f7b3f1b969fa400154eb10c5e 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -17,6 +17,7 @@ import 'elements/resolution_types.dart';
import 'elements/types.dart';
import 'elements/visitor.dart' show ElementVisitor;
import 'js_backend/js_backend.dart' show JavaScriptBackend;
+import 'js_backend/runtime_types.dart';
import 'resolution/tree_elements.dart' show TreeElements;
import 'package:front_end/src/fasta/scanner.dart' show Token;
import 'tree/tree.dart';
@@ -868,6 +869,8 @@ class ClosureTranslator extends Visitor {
DiagnosticReporter get reporter => compiler.reporter;
+ RuntimeTypesNeed get rtiNeed => closedWorldRefiner.closedWorld.rtiNeed;
+
/// Generate a unique name for the [id]th closure field, with proposed name
/// [name].
///
@@ -1201,8 +1204,7 @@ class ClosureTranslator extends Visitor {
// TODO(johnniwinther): Find out why this can be null.
if (type == null) return;
if (outermostElement.isClassMember &&
- compiler.backend.rtiNeed
- .classNeedsRti(outermostElement.enclosingClass)) {
+ rtiNeed.classNeedsRti(outermostElement.enclosingClass)) {
if (outermostElement.isConstructor || outermostElement.isField) {
analyzeTypeVariables(type);
} else if (outermostElement.isInstanceMember) {
@@ -1395,7 +1397,7 @@ class ClosureTranslator extends Visitor {
closures.add(closure);
closureData = globalizeClosure(node, closure);
needsRti = compiler.options.enableTypeAssertions ||
- compiler.backend.rtiNeed.localFunctionNeedsRti(closure);
+ rtiNeed.localFunctionNeedsRti(closure);
} else {
outermostElement = element;
ThisLocal thisElement = null;
@@ -1406,7 +1408,7 @@ class ClosureTranslator extends Visitor {
closureData = new ClosureClassMap(null, null, null, thisElement);
if (element is MethodElement) {
needsRti = compiler.options.enableTypeAssertions ||
- compiler.backend.rtiNeed.methodNeedsRti(element);
+ rtiNeed.methodNeedsRti(element);
}
}
closureMappingCache[element] = closureData;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698