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

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

Issue 2514833003: Fix dart2js/analyze_unused_dart2js_test. (Closed)
Patch Set: . Created 4 years, 1 month 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 | no next file » | 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 1c922e588b2fe72a419162e15ca7ff77c7b30b37..af0193a51325fabdfcd864560c899661b374f537 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -125,6 +125,10 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
openFunction();
if (field.initializer != null) {
field.initializer.accept(this);
+ HInstruction fieldValue = pop();
+ HInstruction checkInstruction = typeBuilder.potentiallyCheckOrTrustType(
+ fieldValue, astAdapter.getDartType(field.type));
+ stack.add(checkInstruction);
} else {
stack.add(graph.addConstantNull(compiler));
}
@@ -926,7 +930,6 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
HInstruction initialValue = graph.addConstantNull(compiler);
localsHandler.updateLocal(local, initialValue);
} else {
- // TODO(het): handle case where the variable is top-level or static
declaration.initializer.accept(this);
HInstruction initialValue = pop();
@@ -938,7 +941,6 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
void _visitLocalSetter(ir.VariableDeclaration variable, HInstruction value) {
- // TODO(het): handle case where the variable is top-level or static
LocalElement local = astAdapter.getElement(variable);
// Give the value a name if it doesn't have one already.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698