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

Unified 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: Optimization + updated cf comments. 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 09f624da902f16300122bbe88e5b5f642baab321..90d447ab091975872bd0f2ac22fbd1429c2c47b3 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1483,6 +1483,10 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// Register this invocation to collect the types used at all call sites.
Selector selector = getOptimizedSelectorFor(node, node.selector);
+ if (node.selector.name.slowToString() == 'foo' ||
ngeoffray 2012/10/26 08:34:55 Remove
Johnni Winther 2012/10/26 10:18:01 Done.
+ node.selector.name.slowToString() == 'bar') {
+ print('getOptimizedSelectorFor($node)=$selector, target=${target}');
+ }
backend.registerDynamicInvocation(node, selector, types);
// If we don't know what we're calling or if we are calling a getter,
@@ -1513,6 +1517,14 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
Selector defaultSelector) {
// TODO(4434): For private members we need to use the untyped selector.
if (defaultSelector.name.isPrivate()) return defaultSelector;
+ // If [noSuchMethod] has been overridden and [InvocationMirror.invokeOn]
+ // has been called we must not create a typed selector based on the receiver
+ // type.
+ if (node.element == null && // Invocation is not exact.
+ backend.compiler.enabledNoSuchMethod &&
ngeoffray 2012/10/26 08:34:55 I think you can just check enabledInvokeOn.
Johnni Winther 2012/10/26 10:18:01 Done.
+ backend.compiler.enabledInvokeOn) {
+ return defaultSelector;
+ }
HType receiverHType = types[node.inputs[0]];
DartType receiverType = receiverHType.computeType(compiler);
if (receiverType != null) {

Powered by Google App Engine
This is Rietveld 408576698