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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10660007: Don't transform interceptors into dynamic invocations for null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/language/null_to_string2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index 9b8dc6666dce10a2cd1058265fc7567395a6e208..c19202f4477c2d68714b1786bcc35f83c30cd835 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -196,7 +196,17 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
}
if (!input.canBePrimitive() && !node.getter && !node.setter) {
- return fromInterceptorToDynamicInvocation(node, node.name);
+ bool transformToDynamicInvocation = true;
+ if (input.canBeNull()) {
+ // Check if the method exists on Null. If yes we must not transform
+ // the static interceptor call to a dynamic invocation.
+ // TODO(floitsch): get a list of methods that exist on 'null' and only
+ // bail out on them.
+ transformToDynamicInvocation = false;
+ }
+ if (transformToDynamicInvocation) {
+ return fromInterceptorToDynamicInvocation(node, node.name);
+ }
}
return node;
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/language/null_to_string2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698