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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2746293006: Pulling the element model out of global type inference. (Closed)
Patch Set: . Created 3 years, 9 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/options.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 2cdab32ea4443545fb165ea710850adbec231420..db3d6eefb43f861c1039acf7b2bd56cbbe33378e 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -153,28 +153,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
this.localsHandler = new LocalsHandler(this, targetElement, null, compiler);
this.astAdapter = new KernelAstAdapter(kernel, compiler.backend,
resolvedAst, kernel.nodeToAst, kernel.nodeToElement);
- Element originTarget = targetElement;
- if (originTarget.isPatch) {
- originTarget = originTarget.origin;
- }
- if (originTarget is FunctionElement) {
- if (originTarget is ConstructorBodyElement) {
- ConstructorBodyElement body = originTarget;
- _targetIsConstructorBody = true;
- originTarget = body.constructor;
- }
- target = kernel.functions[originTarget];
- // Closures require a lookup one level deeper in the closure class mapper.
- if (target == null) {
- FunctionElement originTargetFunction = originTarget;
- ClosureClassMap classMap = compiler.closureToClassMapper
- .getClosureToClassMapping(originTargetFunction.resolvedAst);
- if (classMap.closureElement != null) {
- target = kernel.localFunctions[classMap.closureElement];
- }
- }
- } else if (originTarget is FieldElement) {
- target = kernel.fields[originTarget];
+ target = astAdapter.getInitialKernelNode(targetElement);
+ if (targetElement is ConstructorBodyElement) {
+ _targetIsConstructorBody = true;
}
}
@@ -866,7 +847,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
// Generate a structure equivalent to:
// Iterator<E> $iter = <iterable>.iterator;
// while ($iter.moveNext()) {
- // <declaredIdentifier> = $iter.current;
+ // <variable> = $iter.current;
// <body>
// }
« no previous file with comments | « pkg/compiler/lib/src/options.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698