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

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

Issue 11264005: InvocationMirror implemented in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Working version Created 8 years, 2 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
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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 world.registerDynamicInvocation(name, selector); 1506 world.registerDynamicInvocation(name, selector);
1507 } 1507 }
1508 } 1508 }
1509 push(jsPropertyCall(object, methodName, arguments), node); 1509 push(jsPropertyCall(object, methodName, arguments), node);
1510 } 1510 }
1511 1511
1512 Selector getOptimizedSelectorFor(HInvokeDynamic node, 1512 Selector getOptimizedSelectorFor(HInvokeDynamic node,
1513 Selector defaultSelector) { 1513 Selector defaultSelector) {
1514 // TODO(4434): For private members we need to use the untyped selector. 1514 // TODO(4434): For private members we need to use the untyped selector.
1515 if (defaultSelector.name.isPrivate()) return defaultSelector; 1515 if (defaultSelector.name.isPrivate()) return defaultSelector;
1516 // If [InvocationMirror.invokeOn] is called we must not create a typed
1517 // selector based on the receiver type.
1518 if (backend.compiler.enabledNoSuchMethod &&
1519 backend.compiler.enabledInvokeOn) {
1520 return defaultSelector;
1521 }
1516 HType receiverHType = types[node.inputs[0]]; 1522 HType receiverHType = types[node.inputs[0]];
1517 DartType receiverType = receiverHType.computeType(compiler); 1523 DartType receiverType = receiverHType.computeType(compiler);
1518 if (receiverType != null) { 1524 if (receiverType != null) {
1519 return new TypedSelector(receiverType, defaultSelector); 1525 return new TypedSelector(receiverType, defaultSelector);
1520 } else { 1526 } else {
1521 return defaultSelector; 1527 return defaultSelector;
1522 } 1528 }
1523 } 1529 }
1524 1530
1525 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 1531 visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2990 if (leftType.canBeNull() && rightType.canBeNull()) { 2996 if (leftType.canBeNull() && rightType.canBeNull()) {
2991 if (left.isConstantNull() || right.isConstantNull() || 2997 if (left.isConstantNull() || right.isConstantNull() ||
2992 (leftType.isPrimitive() && leftType == rightType)) { 2998 (leftType.isPrimitive() && leftType == rightType)) {
2993 return '=='; 2999 return '==';
2994 } 3000 }
2995 return null; 3001 return null;
2996 } else { 3002 } else {
2997 return '==='; 3003 return '===';
2998 } 3004 }
2999 } 3005 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698