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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart

Issue 1134063002: dart2js cps: Introduce GetStatic/SetStatic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix SExpression parsing/unparsing Created 5 years, 7 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
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index 6ec2d1cb31de692824c56335d5a14d054c3e1e3f..9c5861f28e53bcf7bfa4c8b1f34450464d118abe 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -136,6 +136,7 @@ class SExpressionUnstringifier {
static const String LET_MUTABLE = "LetMutable";
static const String SET_MUTABLE_VARIABLE = "SetMutableVariable";
static const String TYPE_OPERATOR = "TypeOperator";
+ static const String SET_STATIC = "SetStatic";
// Primitives
static const String CONSTANT = "Constant";
@@ -144,6 +145,7 @@ class SExpressionUnstringifier {
static const String LITERAL_LIST = "LiteralList";
static const String LITERAL_MAP = "LiteralMap";
static const String REIFY_TYPE_VAR = "ReifyTypeVar";
+ static const String GET_STATIC = "GetStatic";
// Other
static const String FUNCTION_DEFINITION = "FunctionDefinition";
@@ -246,6 +248,8 @@ class SExpressionUnstringifier {
return parseSetMutableVariable();
case TYPE_OPERATOR:
return parseTypeOperator();
+ case SET_STATIC:
+ return parseSetStatic();
default:
assert(false);
}
@@ -564,6 +568,20 @@ class SExpressionUnstringifier {
return new TypeOperator(recv, type, cont, isTypeTest: operator == 'is');
}
+ /// (SetStatic field value body)
+ SetStatic parseSetStatic() {
+ tokens.consumeStart(SET_STATIC);
+ Element fieldElement = new DummyElement(tokens.read());
+
+ Primitive value = name2variable[tokens.read()];
+ assert(value != null);
+
+ Expression body = parseExpression();
+
+ tokens.consumeEnd();
+ return new SetStatic(fieldElement, value, null).plug(body);
+ }
+
/// (LetPrim (name primitive) body)
LetPrim parseLetPrim() {
tokens.consumeStart(LET_PRIM);
@@ -600,6 +618,8 @@ class SExpressionUnstringifier {
return parseLiteralMap();
case REIFY_TYPE_VAR:
return parseReifyTypeVar();
+ case GET_STATIC:
+ return parseGetStatic();
default:
assert(false);
}
@@ -726,4 +746,14 @@ class SExpressionUnstringifier {
tokens.consumeEnd();
return new ReifyTypeVar(type);
}
+
+ /// (GetStatic field)
+ GetStatic parseGetStatic() {
+ tokens.consumeStart(GET_STATIC);
+
+ Element field = new DummyElement(tokens.read());
+
+ tokens.consumeEnd();
+ return new GetStatic(field, null);
+ }
}
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698