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

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

Issue 2537553002: Handle top level fields with Kernel. (Closed)
Patch Set: . Created 4 years 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 | tests/compiler/dart2js/kernel/literals_test.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 45f6914ae8e806bf84ee0bebfa1787bfee4f91b3..f9219301782e9ef20526457aa762016079ec4a13 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -152,6 +152,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));
}
@@ -1050,7 +1054,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();
@@ -1062,7 +1065,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 | tests/compiler/dart2js/kernel/literals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698