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

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

Issue 10969014: Do not pass the name of the is check if it's not required (typically for primitive types). (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
« no previous file with comments | « lib/compiler/implementation/js_backend/emitter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 helper = backend.getCheckedModeHelper(type); 2455 helper = backend.getCheckedModeHelper(type);
2456 if (node.isCastTypeCheck) { 2456 if (node.isCastTypeCheck) {
2457 helper = castNames[helper.stringValue]; 2457 helper = castNames[helper.stringValue];
2458 } 2458 }
2459 } 2459 }
2460 Element helperElement = compiler.findHelper(helper); 2460 Element helperElement = compiler.findHelper(helper);
2461 world.registerStaticUse(helperElement); 2461 world.registerStaticUse(helperElement);
2462 List<js.Expression> arguments = <js.Expression>[]; 2462 List<js.Expression> arguments = <js.Expression>[];
2463 use(node.checkedInput); 2463 use(node.checkedInput);
2464 arguments.add(pop()); 2464 arguments.add(pop());
2465 String additionalArgument = backend.namer.operatorIs(element); 2465 if (helperElement.computeSignature(compiler).parameterCount != 1) {
2466 arguments.add(new js.LiteralString("'$additionalArgument'")); 2466 String additionalArgument = backend.namer.operatorIs(element);
2467 arguments.add(new js.LiteralString("'$additionalArgument'"));
2468 }
2467 String helperName = backend.namer.isolateAccess(helperElement); 2469 String helperName = backend.namer.isolateAccess(helperElement);
2468 push(new js.Call(new js.VariableUse(helperName), arguments)); 2470 push(new js.Call(new js.VariableUse(helperName), arguments));
2469 } else { 2471 } else {
2470 use(node.checkedInput); 2472 use(node.checkedInput);
2471 } 2473 }
2472 } 2474 }
2473 } 2475 }
2474 2476
2475 class SsaOptimizedCodeGenerator extends SsaCodeGenerator { 2477 class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
2476 SsaOptimizedCodeGenerator(backend, work, parameters, parameterNames) 2478 SsaOptimizedCodeGenerator(backend, work, parameters, parameterNames)
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 if (leftType.canBeNull() && rightType.canBeNull()) { 2991 if (leftType.canBeNull() && rightType.canBeNull()) {
2990 if (left.isConstantNull() || right.isConstantNull() || 2992 if (left.isConstantNull() || right.isConstantNull() ||
2991 (leftType.isPrimitive() && leftType == rightType)) { 2993 (leftType.isPrimitive() && leftType == rightType)) {
2992 return '=='; 2994 return '==';
2993 } 2995 }
2994 return null; 2996 return null;
2995 } else { 2997 } else {
2996 return '==='; 2998 return '===';
2997 } 2999 }
2998 } 3000 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/js_backend/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698