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

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

Issue 17003004: Fix a bug in how we deal HTypeConversion during type propagation: we must use the intersection betw… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart » ('j') | 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 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 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 } 2487 }
2488 return test; 2488 return test;
2489 } 2489 }
2490 2490
2491 void visitTypeConversion(HTypeConversion node) { 2491 void visitTypeConversion(HTypeConversion node) {
2492 if (!node.isChecked) { 2492 if (!node.isChecked) {
2493 use(node.checkedInput); 2493 use(node.checkedInput);
2494 return; 2494 return;
2495 } 2495 }
2496 if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) { 2496 if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) {
2497 // An int check if the input is not int or null, is not
2498 // sufficient for doing a argument or receiver check.
2499 assert(!node.isInteger() || node.checkedInput.isIntegerOrNull());
2497 js.Expression test = generateTest(node); 2500 js.Expression test = generateTest(node);
2498 js.Block oldContainer = currentContainer; 2501 js.Block oldContainer = currentContainer;
2499 js.Statement body = new js.Block.empty(); 2502 js.Statement body = new js.Block.empty();
2500 currentContainer = body; 2503 currentContainer = body;
2501 if (node.isArgumentTypeCheck) { 2504 if (node.isArgumentTypeCheck) {
2502 generateThrowWithHelper('iae', node.checkedInput); 2505 generateThrowWithHelper('iae', node.checkedInput);
2503 } else if (node.isReceiverTypeCheck) { 2506 } else if (node.isReceiverTypeCheck) {
2504 use(node.checkedInput); 2507 use(node.checkedInput);
2505 String methodName = 2508 String methodName =
2506 backend.namer.invocationName(node.receiverTypeCheckSelector); 2509 backend.namer.invocationName(node.receiverTypeCheckSelector);
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 if (leftType.canBeNull() && rightType.canBeNull()) { 3015 if (leftType.canBeNull() && rightType.canBeNull()) {
3013 if (left.isConstantNull() || right.isConstantNull() || 3016 if (left.isConstantNull() || right.isConstantNull() ||
3014 (leftType.isPrimitive(compiler) && leftType == rightType)) { 3017 (leftType.isPrimitive(compiler) && leftType == rightType)) {
3015 return '=='; 3018 return '==';
3016 } 3019 }
3017 return null; 3020 return null;
3018 } else { 3021 } else {
3019 return '==='; 3022 return '===';
3020 } 3023 }
3021 } 3024 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698