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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart

Issue 2992863002: Support forEachClassMember on closure classes (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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 | « pkg/compiler/lib/src/kernel/env.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
index c75d0ff1ee32ee02e70eab49983d1b2dfc039e81..1e86e83263f75ebd8e72b4fd93475d332be248e5 100644
--- a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
@@ -7,6 +7,7 @@ library dart2js.kernel.backend_strategy;
import 'package:kernel/ast.dart' as ir;
import '../backend_strategy.dart';
+import '../common.dart';
import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
import '../common/tasks.dart';
import '../compiler.dart';
@@ -203,13 +204,12 @@ class KernelSorter implements Sorter {
return utils.compareLibrariesUris(a.canonicalUri, b.canonicalUri);
}
- int _compareLocations(Entity entity1, ir.Location location1, Entity entity2,
- ir.Location location2) {
- int r = utils.compareSourceUris(
- Uri.parse(location1.file), Uri.parse(location2.file));
+ int _compareSourceSpans(Entity entity1, SourceSpan sourceSpan1,
+ Entity entity2, SourceSpan sourceSpan2) {
+ int r = utils.compareSourceUris(sourceSpan1.uri, sourceSpan2.uri);
if (r != 0) return r;
- return utils.compareEntities(entity1, location1.line, location1.column,
- entity2, location2.line, location2.column);
+ return utils.compareEntities(
+ entity1, sourceSpan1.begin, null, entity2, sourceSpan2.begin, null);
}
@override
@@ -225,7 +225,7 @@ class KernelSorter implements Sorter {
if (r != 0) return r;
MemberDefinition definition1 = elementMap.getMemberDefinition(member1);
MemberDefinition definition2 = elementMap.getMemberDefinition(member2);
- return _compareLocations(
+ return _compareSourceSpans(
member1, definition1.location, member2, definition2.location);
});
}
@@ -238,7 +238,7 @@ class KernelSorter implements Sorter {
if (r != 0) return r;
ClassDefinition definition1 = elementMap.getClassDefinition(cls1);
ClassDefinition definition2 = elementMap.getClassDefinition(cls2);
- return _compareLocations(
+ return _compareSourceSpans(
cls1, definition1.location, cls2, definition2.location);
});
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/env.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698