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

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

Issue 12263009: - Trust type annotations on fields of HTML classes. (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/optimize.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) {
1532 // Enable direct calls to a native method only if we don't
1533 // run in checked mode, where the Dart version may have
1534 // type annotations on parameters and return type that it
1535 // should check.
sra1 2013/02/13 19:30:02 TODO: Can still inline if all the arguments are kn
ngeoffray 2013/02/14 10:41:28 Done.
1536 // Also check that the parameters are not functions: it's
1537 // the callee that will translate them to JS functions.
1538 bool canInlineNativeCall = true;
1539 target.computeSignature(compiler).forEachParameter((Element element) {
1540 DartType type = element.computeType(compiler).unalias(compiler);
1541 if (type is FunctionType) {
1542 canInlineNativeCall = false;
1543 }
1544 });
1545 if (canInlineNativeCall) {
1546 methodName = target.fixedBackendName();
1547 }
1531 } 1548 }
1532 } 1549 }
1533 } 1550 }
1534 1551
1535 if (methodName == null) { 1552 if (methodName == null) {
1536 methodName = backend.namer.invocationName(node.selector); 1553 methodName = backend.namer.invocationName(node.selector);
1537 registerMethodInvoke(node); 1554 registerMethodInvoke(node);
1538 } 1555 }
1539 push(jsPropertyCall(object, methodName, arguments), node); 1556 push(jsPropertyCall(object, methodName, arguments), node);
1540 } 1557 }
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 if (leftType.canBeNull() && rightType.canBeNull()) { 3006 if (leftType.canBeNull() && rightType.canBeNull()) {
2990 if (left.isConstantNull() || right.isConstantNull() || 3007 if (left.isConstantNull() || right.isConstantNull() ||
2991 (leftType.isPrimitive() && leftType == rightType)) { 3008 (leftType.isPrimitive() && leftType == rightType)) {
2992 return '=='; 3009 return '==';
2993 } 3010 }
2994 return null; 3011 return null;
2995 } else { 3012 } else {
2996 return '==='; 3013 return '===';
2997 } 3014 }
2998 } 3015 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698