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

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

Issue 2541753002: Use precomputed constant for determining if static is lazy-init (Closed)
Patch Set: fix type 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 | 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 c05772eb6a5ec7278f612276169e05f60af7e3b5..4c3e52956ef8d01515794c580b893b868a748c65 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -941,11 +941,20 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
stack.add(graph.addConstant(
astAdapter.getConstantFor(staticTarget.initializer), compiler));
} else {
- push(new HStatic(astAdapter.getMember(staticTarget),
- astAdapter.inferredTypeOf(staticTarget)));
+ if (_isLazyStatic(staticTarget)) {
+ push(new HLazyStatic(astAdapter.getField(staticTarget),
+ astAdapter.inferredTypeOf(staticTarget)));
+ } else {
+ push(new HStatic(astAdapter.getMember(staticTarget),
+ astAdapter.inferredTypeOf(staticTarget)));
+ }
}
}
+ bool _isLazyStatic(ir.Member target) {
+ return astAdapter.isLazyStatic(target);
+ }
+
@override
void visitStaticSet(ir.StaticSet staticSet) {
staticSet.value.accept(this);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698