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

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

Issue 1153603006: dart2js cps: Type casts and related changes to type propagation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Another typo in SExpression unstrngifier Created 5 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
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart » ('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 211d52659ecfba53a2f05928e52d322d43af0f8c..491a930641732a68649842c994b84e3a381a6765 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -135,9 +135,10 @@ class SExpressionUnstringifier {
static const String LET_CONT = "LetCont";
static const String LET_MUTABLE = "LetMutable";
static const String SET_MUTABLE_VARIABLE = "SetMutableVariable";
- static const String TYPE_OPERATOR = "TypeOperator";
+ static const String TYPE_CAST = "TypeCast";
static const String SET_STATIC = "SetStatic";
static const String GET_LAZY_STATIC = "GetLazyStatic";
+ static const String UNREACHABLE = "Unreachable";
// Primitives
static const String CONSTANT = "Constant";
@@ -147,6 +148,7 @@ class SExpressionUnstringifier {
static const String LITERAL_MAP = "LiteralMap";
static const String REIFY_TYPE_VAR = "ReifyTypeVar";
static const String GET_STATIC = "GetStatic";
+ static const String TYPE_TEST = "TypeTest";
// Other
static const String FUNCTION_DEFINITION = "FunctionDefinition";
@@ -247,12 +249,14 @@ class SExpressionUnstringifier {
return parseLetMutable();
case SET_MUTABLE_VARIABLE:
return parseSetMutableVariable();
- case TYPE_OPERATOR:
- return parseTypeOperator();
+ case TYPE_CAST:
+ return parseTypeCast();
case SET_STATIC:
return parseSetStatic();
case GET_LAZY_STATIC:
return parseGetLazyStatic();
+ case UNREACHABLE:
+ return parseUnreachable();
default:
assert(false);
}
@@ -553,14 +557,12 @@ class SExpressionUnstringifier {
..plug(body);
}
- /// (TypeOperator operator recv type cont)
- TypeOperator parseTypeOperator() {
- tokens.consumeStart(TYPE_OPERATOR);
+ /// (TypeCast value type args cont)
+ TypeCast parseTypeCast() {
+ tokens.consumeStart(TYPE_CAST);
- String operator = tokens.read();
-
- Primitive recv = name2variable[tokens.read()];
- assert(recv != null);
+ Primitive value = name2variable[tokens.read()];
+ assert(value != null);
dart_types.DartType type = new DummyNamedType(tokens.read());
@@ -570,8 +572,22 @@ class SExpressionUnstringifier {
assert(cont != null);
tokens.consumeEnd();
- return new TypeOperator(recv, type, typeArguments, cont,
- isTypeTest: operator == 'is');
+ return new TypeCast(value, type, typeArguments, cont);
+ }
+
+ /// (TypeTest value type args)
+ TypeTest parseTypeTest() {
+ tokens.consumeStart(TYPE_TEST);
+
+ Primitive value = name2variable[tokens.read()];
+ assert(value != null);
+
+ dart_types.DartType type = new DummyNamedType(tokens.read());
+
+ List<ir.Primitive> typeArguments = parsePrimitiveList();
+
+ tokens.consumeEnd();
+ return new TypeTest(value, type, typeArguments);
}
/// (SetStatic field value body)
@@ -599,6 +615,13 @@ class SExpressionUnstringifier {
return new GetLazyStatic(fieldElement, cont, null);
}
+ /// (Unreachable)
+ Unreachable parseUnreachable() {
+ tokens.consumeStart(UNREACHABLE);
+ tokens.consumeEnd();
+ return new Unreachable();
+ }
+
/// (LetPrim (name primitive) body)
LetPrim parseLetPrim() {
tokens.consumeStart(LET_PRIM);
@@ -637,6 +660,8 @@ class SExpressionUnstringifier {
return parseReifyTypeVar();
case GET_STATIC:
return parseGetStatic();
+ case TYPE_TEST:
+ return parseTypeTest();
default:
assert(false);
}
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698