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

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

Issue 11413219: Canonicalize raw type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 8 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: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index b397568913861727b4e025a242f7565cd9c8f769..b3778465137137e10f9fc1613555cea6f6bc4da3 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2390,15 +2390,19 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
use(node.typeInfoCall);
int index = RuntimeTypeInformation.getTypeVariableIndex(typeVariable);
js.PropertyAccess field = new js.PropertyAccess.indexed(pop(), index);
- RuntimeTypeInformation rti = backend.rti;
- String typeName = rti.getStringRepresentation(arguments.head);
- js.Expression genericName = new js.LiteralString("'$typeName'");
- js.Binary eqTest = new js.Binary('===', field, genericName);
// Also test for 'undefined' in case the object does not have
// any type variable.
js.Prefix undefinedTest = new js.Prefix('!', field);
- result = new js.Binary(
- '&&', result, new js.Binary('||', undefinedTest, eqTest));
+ if (arguments.head == compiler.types.dynamicType) {
+ result = new js.Binary('&&', result, undefinedTest);
+ } else {
+ RuntimeTypeInformation rti = backend.rti;
+ String typeName = rti.getStringRepresentation(arguments.head);
+ js.Expression genericName = new js.LiteralString("'$typeName'");
+ js.Binary eqTest = new js.Binary('===', field, genericName);
+ result = new js.Binary(
+ '&&', result, new js.Binary('||', undefinedTest, eqTest));
+ }
arguments = arguments.tail;
}
push(result, node);

Powered by Google App Engine
This is Rietveld 408576698