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

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

Issue 1026333002: Revert "Remove NSM if followed by a foreign with same effect." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index d92a99f79e8566153ab4783b4038640bc0863a2f..5c6ec19ebf89fde870b1a0d6d10ffff330d6dfd3 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -1001,33 +1001,6 @@ class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
return zapInstructionCache;
}
- /// Returns true of [foreign] will throw an noSuchMethod error if
- /// receiver is `null` before having any other side-effects.
- bool templateThrowsNSMonNull(HForeignCode foreign, HInstruction receiver) {
- // We look for a template of the form
- //
- // #.something -or- #.something()
- //
- // where # is substituted by receiver.
- js.Template template = foreign.codeTemplate;
- js.Node node = template.ast;
- // #.something = ...
- if (node is js.Assignment) {
- js.Assignment assignment = node;
- node = assignment.leftHandSide;
- }
-
- // #.something
- if (node is js.PropertyAccess) {
- js.PropertyAccess access = node;
- if (access.receiver is js.InterpolatedExpression) {
- js.InterpolatedExpression hole = access.receiver;
- return hole.isPositional && foreign.inputs.first == receiver;
- }
- }
- return false;
- }
-
/// Returns whether the next throwing instruction that may have side
/// effects after [instruction], throws [NoSuchMethodError] on the
/// same receiver of [instruction].
@@ -1039,9 +1012,6 @@ class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
&& current.canThrow()) {
return true;
}
- if (current is HForeignCode && templateThrowsNSM(current, receiver)) {
- return true;
- }
if (current.canThrow() || current.sideEffects.hasSideEffects()) {
return false;
}
« 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