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

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

Issue 2614983004: Reapply 0c78abd0900d (Closed)
Patch Set: . Created 3 years, 11 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/resolved_uri_translator.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 a61c7e85a864347de4ce36d1b7388961e747cf7a..1ab19ec36e4760693a82839af6baf454e44bf46e 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -116,7 +116,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
JavaScriptBackend get backend => compiler.backend;
@override
- TreeElements get elements => resolvedAst.elements;
+ TreeElements get elements => astAdapter.elements;
SourceInformationBuilder sourceInformationBuilder;
KernelAstAdapter astAdapter;
@@ -298,8 +298,12 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
if (field.initializer == null) {
fieldValues[field] = graph.addConstantNull(closedWorld);
} else {
+ // Gotta update the resolvedAst when we're looking at field values
+ // outside the constructor.
+ astAdapter.pushResolvedAst(field);
field.initializer.accept(this);
fieldValues[field] = pop();
+ astAdapter.popResolvedAstStack();
}
}
@@ -386,7 +390,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return builtArguments;
}
- /// Inlines the given super [constructor]'s initializers by collecting it's
+ /// Inlines the given super [constructor]'s initializers by collecting its
/// field values and building its constructor initializers. We visit super
/// constructors all the way up to the [Object] constructor.
void _buildInlinedInitializers(ir.Constructor constructor,
@@ -793,8 +797,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
HLoopInformation loopInfo = current.loopInformation;
HBasicBlock loopEntryBlock = current;
HBasicBlock bodyEntryBlock = current;
- JumpTarget target =
- elements.getTargetDefinition(astAdapter.getNode(doStatement));
+ JumpTarget target = astAdapter.elements
+ .getTargetDefinition(astAdapter.getNode(doStatement));
bool hasContinues = target != null && target.isContinueTarget;
if (hasContinues) {
// Add extra block to hang labels on.
@@ -906,8 +910,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
// Since the body of the loop has a break, we attach a synthesized label
// to the body.
SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
- JumpTarget target =
- elements.getTargetDefinition(astAdapter.getNode(doStatement));
+ JumpTarget target = astAdapter.elements
+ .getTargetDefinition(astAdapter.getNode(doStatement));
LabelDefinition label = target.addLabel(null, 'loop');
label.setBreakTarget();
HLabeledBlockInformation info = new HLabeledBlockInformation(
« no previous file with comments | « pkg/compiler/lib/src/resolved_uri_translator.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