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

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

Issue 11571004: Implement is-checks for static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move to emitStaticFunctionGetters. Created 8 years 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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2387 } else if (Elements.isNumberOrStringSupertype(element, compiler)) { 2387 } else if (Elements.isNumberOrStringSupertype(element, compiler)) {
2388 handleNumberOrStringSupertypeCheck(input, type); 2388 handleNumberOrStringSupertypeCheck(input, type);
2389 attachLocationToLast(node); 2389 attachLocationToLast(node);
2390 } else if (Elements.isStringOnlySupertype(element, compiler)) { 2390 } else if (Elements.isStringOnlySupertype(element, compiler)) {
2391 handleStringSupertypeCheck(input, type); 2391 handleStringSupertypeCheck(input, type);
2392 attachLocationToLast(node); 2392 attachLocationToLast(node);
2393 } else if (identical(element, compiler.listClass) 2393 } else if (identical(element, compiler.listClass)
2394 || Elements.isListSupertype(element, compiler)) { 2394 || Elements.isListSupertype(element, compiler)) {
2395 handleListOrSupertypeCheck(input, type); 2395 handleListOrSupertypeCheck(input, type);
2396 attachLocationToLast(node); 2396 attachLocationToLast(node);
2397 } else if (element.isTypedef()) {
2398 checkType(input, type);
2399 attachLocationToLast(node);
2397 } else if (types[input].canBePrimitive() || types[input].canBeNull()) { 2400 } else if (types[input].canBePrimitive() || types[input].canBeNull()) {
2398 checkObject(input, '==='); 2401 checkObject(input, '===');
2399 js.Expression objectTest = pop(); 2402 js.Expression objectTest = pop();
2400 checkType(input, type); 2403 checkType(input, type);
2401 push(new js.Binary('&&', objectTest, pop()), node); 2404 push(new js.Binary('&&', objectTest, pop()), node);
2402 } else { 2405 } else {
2403 checkType(input, type); 2406 checkType(input, type);
2404 attachLocationToLast(node); 2407 attachLocationToLast(node);
2405 } 2408 }
2406 if (node.hasArgumentChecks()) { 2409 if (node.hasArgumentChecks()) {
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 if (leftType.canBeNull() && rightType.canBeNull()) { 3049 if (leftType.canBeNull() && rightType.canBeNull()) {
3047 if (left.isConstantNull() || right.isConstantNull() || 3050 if (left.isConstantNull() || right.isConstantNull() ||
3048 (leftType.isPrimitive() && leftType == rightType)) { 3051 (leftType.isPrimitive() && leftType == rightType)) {
3049 return '=='; 3052 return '==';
3050 } 3053 }
3051 return null; 3054 return null;
3052 } else { 3055 } else {
3053 return '==='; 3056 return '===';
3054 } 3057 }
3055 } 3058 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698