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

Unified Diff: pkg/compiler/lib/src/ssa/interceptor_simplifier.dart

Issue 2316893002: Don't undo an interceptor optimization (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
diff --git a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
index a12a57efe1f1f40e9ed5aecfe7977ad9dd4ebd1e..10202de96fd7b5e96db135803a8db5208735a6a9 100644
--- a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
+++ b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
@@ -300,12 +300,16 @@ class SsaSimplifyInterceptors extends HBaseVisitor
return false;
}
+ // If it is a conditional constant interceptor and was not strengthened to a
+ // constant interceptor then there is nothing more we can do.
+ if (node.isConditionalConstantInterceptor) return false;
+
// Do we have an 'almost constant' interceptor? The receiver could be
// `null` but not any other JavaScript falsy value, `null` values cause
// `NoSuchMethodError`s, and if the receiver was not null we would have a
// constant interceptor `C`. Then we can use `(receiver && C)` for the
// interceptor.
- if (receiver.canBeNull() && !node.isConditionalConstantInterceptor) {
+ if (receiver.canBeNull()) {
if (!interceptedClasses.contains(helpers.jsNullClass)) {
// Can use `(receiver && C)` only if receiver is either null or truthy.
if (!(receiver.canBePrimitiveNumber(compiler) ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698