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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10905234: Fix for issue 4921: ad the generic type info to a List when we create it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 6
7 final JavaScriptBackend backend; 7 final JavaScriptBackend backend;
8 8
9 SsaCodeGeneratorTask(JavaScriptBackend backend) 9 SsaCodeGeneratorTask(JavaScriptBackend backend)
10 : this.backend = backend, 10 : this.backend = backend,
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 js.Expression result = pop(); 2370 js.Expression result = pop();
2371 for (TypeVariableType typeVariable in cls.typeVariables) { 2371 for (TypeVariableType typeVariable in cls.typeVariables) {
2372 use(node.typeInfoCall); 2372 use(node.typeInfoCall);
2373 // TODO(johnniwinther): Retrieve the type name properly and not through 2373 // TODO(johnniwinther): Retrieve the type name properly and not through
2374 // [toString]. Note: Two cases below [typeVariable] and 2374 // [toString]. Note: Two cases below [typeVariable] and
2375 // [arguments.head]. 2375 // [arguments.head].
2376 js.PropertyAccess field = 2376 js.PropertyAccess field =
2377 new js.PropertyAccess.field(pop(), typeVariable.toString()); 2377 new js.PropertyAccess.field(pop(), typeVariable.toString());
2378 js.Expression genericName = new js.LiteralString("'${arguments.head}'"); 2378 js.Expression genericName = new js.LiteralString("'${arguments.head}'");
2379 js.Binary eqTest = new js.Binary('===', field, genericName); 2379 js.Binary eqTest = new js.Binary('===', field, genericName);
2380 result = new js.Binary('&&', result, eqTest); 2380 // Also test for 'undefined' in case the object does not have
2381 // any type variable.
2382 js.Prefix undefinedTest = new js.Prefix('!', field);
2383 result = new js.Binary(
2384 '&&', result, new js.Binary('||', undefinedTest, eqTest));
2381 } 2385 }
2382 push(result, node); 2386 push(result, node);
2383 } 2387 }
2384 if (node.nullOk) { 2388 if (node.nullOk) {
2385 checkNull(input); 2389 checkNull(input);
2386 push(new js.Binary('||', pop(), pop()), node); 2390 push(new js.Binary('||', pop(), pop()), node);
2387 } 2391 }
2388 } 2392 }
2389 2393
2390 void visitTypeConversion(HTypeConversion node) { 2394 void visitTypeConversion(HTypeConversion node) {
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 if (leftType.canBeNull() && rightType.canBeNull()) { 2985 if (leftType.canBeNull() && rightType.canBeNull()) {
2982 if (left.isConstantNull() || right.isConstantNull() || 2986 if (left.isConstantNull() || right.isConstantNull() ||
2983 (leftType.isPrimitive() && leftType == rightType)) { 2987 (leftType.isPrimitive() && leftType == rightType)) {
2984 return '=='; 2988 return '==';
2985 } 2989 }
2986 return null; 2990 return null;
2987 } else { 2991 } else {
2988 return '==='; 2992 return '===';
2989 } 2993 }
2990 } 2994 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698