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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 60293003: Version 0.8.10.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 29908)
+++ dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -2912,13 +2912,16 @@
} else if ("as" == op.source) {
visit(node.receiver);
HInstruction expression = pop();
- Node argument = node.arguments.head;
- TypeAnnotation typeAnnotation = argument.asTypeAnnotation();
- DartType type = elements.getType(typeAnnotation);
- HInstruction converted = buildTypeConversion(
- expression, type, HTypeConversion.CAST_TYPE_CHECK);
- if (converted != expression) add(converted);
- stack.add(converted);
+ DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ ErroneousElement element = type.element;
+ generateTypeError(node, element.message);
+ } else {
+ HInstruction converted = buildTypeConversion(
+ expression, type, HTypeConversion.CAST_TYPE_CHECK);
+ if (converted != expression) add(converted);
+ stack.add(converted);
+ }
} else {
visit(node.receiver);
visit(node.argumentsNode);
@@ -3023,6 +3026,11 @@
pushInvokeStatic(node, helper, inputs, backend.boolType);
HInstruction call = pop();
return new HIs.compound(type, expression, call, backend.boolType);
+ } else if (type.kind == TypeKind.MALFORMED_TYPE) {
+ ErroneousElement element = type.element;
+ generateTypeError(node, element.message);
+ HInstruction call = pop();
+ return new HIs.compound(type, expression, call, backend.boolType);
} else {
if (backend.hasDirectCheckFor(type)) {
return new HIs.direct(type, expression, backend.boolType);
@@ -4171,7 +4179,10 @@
// TODO(5346): Try to avoid the need for calling [declaration] before
// creating an [HStatic].
List<HInstruction> inputs = <HInstruction>[];
- if (backend.isInterceptedSelector(selector)) {
+ if (backend.isInterceptedSelector(selector) &&
+ // Fields don't need an interceptor; consider generating HFieldGet/Set
+ // instead.
+ element.kind != ElementKind.FIELD) {
inputs.add(invokeInterceptor(receiver));
}
inputs.add(receiver);

Powered by Google App Engine
This is Rietveld 408576698