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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart

Issue 123423002: Fix checkedInstructionOrNonGenerateAtUseSite. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 6 years, 7 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: sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart b/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart
index ecfd632a94ade143e068422c5a19c17c3362ae84..daae053db2f3174496973980e20166c67caecb2c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart
@@ -256,7 +256,18 @@ class SsaSimplifyInterceptors extends HBaseVisitor
}
bool rewriteToUseSelfAsInterceptor(HInterceptor node, HInstruction receiver) {
- node.block.rewrite(node, receiver);
+ for (HInstruction user in node.usedBy.toList()) {
+ if (user is HIs) {
+ user.changeUse(node, receiver);
+ } else {
+ // Use the potentially self-argument as new receiver. Note that the
+ // self-argument could potentially have a tighter type than the
+ // receiver which was the input to the interceptor.
+ assert(user.inputs[0] == node);
+ assert(receiver.nonCheck() == user.inputs[1].nonCheck());
+ user.changeUse(node, user.inputs[1]);
+ }
+ }
return false;
}

Powered by Google App Engine
This is Rietveld 408576698