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

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

Issue 11360228: Simplify runtime type support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove test again. 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 7fc524781d516a914caceee4409a96f31febae3c..dfb53704fba8a79fbc49a62cce2bf6e77bf6b77e 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2471,11 +2471,8 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
js.Expression result = pop();
for (TypeVariableType typeVariable in cls.typeVariables) {
use(node.typeInfoCall);
- // TODO(johnniwinther): Retrieve the type name properly and not through
- // [toString]. Note: Two cases below [typeVariable] and
- // [arguments.head].
- js.PropertyAccess field =
- new js.PropertyAccess.field(pop(), typeVariable.toString());
+ int index = RuntimeTypeInformation.getTypeVariableIndex(typeVariable);
+ js.PropertyAccess field = new js.PropertyAccess.indexed(pop(), index);
js.Expression genericName = new js.LiteralString("'${arguments.head}'");
js.Binary eqTest = new js.Binary('===', field, genericName);
// Also test for 'undefined' in case the object does not have
@@ -2483,6 +2480,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
js.Prefix undefinedTest = new js.Prefix('!', field);
result = new js.Binary(
'&&', result, new js.Binary('||', undefinedTest, eqTest));
+ arguments = arguments.tail;
ngeoffray 2012/11/15 08:58:09 Was it not tested before?
karlklose 2012/11/16 13:37:19 It was, but the tests were marked as failing.
}
push(result, node);
}

Powered by Google App Engine
This is Rietveld 408576698