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

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

Issue 12256036: Fix warning spotted by dartc, and make the HType understand the dynamic class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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.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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 } else if (target == backend.jsArrayRemoveLast) { 1521 } else if (target == backend.jsArrayRemoveLast) {
1522 methodName = 'pop'; 1522 methodName = 'pop';
1523 } else if (target == backend.jsStringSplit) { 1523 } else if (target == backend.jsStringSplit) {
1524 methodName = 'split'; 1524 methodName = 'split';
1525 // Split returns a List, so we make sure the backend knows the 1525 // Split returns a List, so we make sure the backend knows the
1526 // list class is instantiated. 1526 // list class is instantiated.
1527 world.registerInstantiatedClass(compiler.listClass); 1527 world.registerInstantiatedClass(compiler.listClass);
1528 } else if (target == backend.jsStringConcat) { 1528 } else if (target == backend.jsStringConcat) {
1529 push(new js.Binary('+', object, arguments[0]), node); 1529 push(new js.Binary('+', object, arguments[0]), node);
1530 return; 1530 return;
1531 } else if (target.isNative() && !compiler.enableTypeAssertions) { 1531 } else if (target.isNative()
1532 && !compiler.enableTypeAssertions
1533 && target.isFunction()) {
1532 // Enable direct calls to a native method only if we don't 1534 // Enable direct calls to a native method only if we don't
1533 // run in checked mode, where the Dart version may have 1535 // run in checked mode, where the Dart version may have
1534 // type annotations on parameters and return type that it 1536 // type annotations on parameters and return type that it
1535 // should check. 1537 // should check.
1536 // Also check that the parameters are not functions: it's 1538 // Also check that the parameters are not functions: it's
1537 // the callee that will translate them to JS functions. 1539 // the callee that will translate them to JS functions.
1538 // TODO(ngeoffray): There are some cases where we could 1540 // TODO(ngeoffray): There are some cases where we could
1539 // still inline in checked mode if we know the arguments 1541 // still inline in checked mode if we know the arguments
1540 // have the right type. And we could do the closure 1542 // have the right type. And we could do the closure
1541 // conversion as well as the return type annotation check. 1543 // conversion as well as the return type annotation check.
1542 bool canInlineNativeCall = true; 1544 bool canInlineNativeCall = true;
1543 target.computeSignature(compiler).forEachParameter((Element element) { 1545 FunctionElement function = target;
1546 function.computeSignature(compiler).forEachParameter((Element element) {
1544 DartType type = element.computeType(compiler).unalias(compiler); 1547 DartType type = element.computeType(compiler).unalias(compiler);
1545 if (type is FunctionType) { 1548 if (type is FunctionType) {
1546 canInlineNativeCall = false; 1549 canInlineNativeCall = false;
1547 } 1550 }
1548 }); 1551 });
1549 if (canInlineNativeCall) { 1552 if (canInlineNativeCall) {
1550 methodName = target.fixedBackendName(); 1553 methodName = target.fixedBackendName();
1551 } 1554 }
1552 } 1555 }
1553 } 1556 }
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 if (leftType.canBeNull() && rightType.canBeNull()) { 3013 if (leftType.canBeNull() && rightType.canBeNull()) {
3011 if (left.isConstantNull() || right.isConstantNull() || 3014 if (left.isConstantNull() || right.isConstantNull() ||
3012 (leftType.isPrimitive() && leftType == rightType)) { 3015 (leftType.isPrimitive() && leftType == rightType)) {
3013 return '=='; 3016 return '==';
3014 } 3017 }
3015 return null; 3018 return null;
3016 } else { 3019 } else {
3017 return '==='; 3020 return '===';
3018 } 3021 }
3019 } 3022 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698