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); |
} |