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

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

Issue 2931153002: Support field initializers and static/top-level fields in compile_with_dill_test (Closed)
Patch Set: Created 3 years, 6 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
Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 9ca821b66d4d2e83218b6ebabd495f6adb829e3f..94fb3f53d68140e28b9819b04f20caee0b7e7bae 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -99,6 +99,15 @@ class KernelAstAdapter extends KernelToElementMapMixin
return value;
}
+ @override
+ ConstantValue getFieldConstantValue(ir.Field field) {
+ FieldElement element = getField(field);
+ if (element.constant != null) {
+ return computeConstantValue(element.constant);
+ }
+ return null;
+ }
+
/// Called to find the corresponding Kernel element for a particular Element
/// before traversing over it with a Kernel visitor.
ir.Node getInitialKernelNode(MemberElement originTarget) {
@@ -219,15 +228,6 @@ class KernelAstAdapter extends KernelToElementMapMixin
return getElement(variable) as LocalElement;
}
- // Is the member a lazy initialized static or top-level member?
- bool isLazyStatic(ir.Member member) {
- if (member is ir.Field) {
- FieldElement field = _nodeToElement[member];
- return field.constant == null;
- }
- return false;
- }
-
KernelJumpTarget getJumpTarget(ir.TreeNode node,
{bool isContinueTarget: false}) {
return _jumpTargets.putIfAbsent(node, () {
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698