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

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

Issue 2526123002: dart2js-kernel: Implement Let and PropertySet. (Closed)
Patch Set: dartfmt 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 | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/kernel/lib/frontend/accessors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5f89b8e73d1a4b1c3af2bdc2a681669a2a2afe79..6d8943de579119ce2f1695bd85298ff815273a91 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -96,7 +96,8 @@ class KernelAstAdapter {
ast.Node getNode(ir.Node node) {
ast.Node result = _nodeToAst[node];
- assert(result != null);
+ assert(invariant(CURRENT_ELEMENT_SPANNABLE, result != null,
+ message: "No node found for $node"));
return result;
}
@@ -144,6 +145,7 @@ class KernelAstAdapter {
Selector getSelector(ir.Expression node) {
if (node is ir.PropertyGet) return getGetterSelector(node);
+ if (node is ir.PropertySet) return getSetterSelector(node);
if (node is ir.InvocationExpression) return getInvocationSelector(node);
_compiler.reporter.internalError(getNode(node),
"Can only get the selector for a property get or an invocation.");
@@ -174,7 +176,18 @@ class KernelAstAdapter {
return new Selector.getter(name);
}
+ Selector getSetterSelector(ir.PropertySet setter) {
+ ir.Name irName = setter.name;
+ Name name = new Name(
+ irName.name, irName.isPrivate ? getElement(irName.library) : null);
+ return new Selector.setter(name);
+ }
+
TypeMask typeOfInvocation(ir.Expression send) {
+ ast.Node operatorNode = kernel.nodeToAstOperator[send];
+ if (operatorNode != null) {
+ return _resultOf(_target).typeOfOperator(operatorNode);
+ }
return _resultOf(_target).typeOfSend(getNode(send));
}
@@ -182,6 +195,10 @@ class KernelAstAdapter {
return _resultOf(_target).typeOfSend(getNode(getter));
}
+ TypeMask typeOfSet(ir.PropertySet setter) {
+ return _compiler.closedWorld.commonMasks.dynamicType;
+ }
+
TypeMask typeOfSend(ir.Expression send) {
assert(send is ir.InvocationExpression || send is ir.PropertyGet);
return _resultOf(_target).typeOfSend(getNode(send));
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/kernel/lib/frontend/accessors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698