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

Unified Diff: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart

Issue 1252883003: dart2js cps: Fix performance issues in optimization passes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update status file Created 5 years, 5 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 | « pkg/compiler/lib/src/cps_ir/let_sinking.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 01738041a11c13754fe1f4600aa437b673255ee4..ac1d1433f0622eaee7a73ffc8f8601d0f1bde5e2 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -14,14 +14,14 @@ import 'optimizers.dart';
class ShrinkingReducer extends Pass {
String get passName => 'Shrinking reductions';
- Set<_ReductionTask> _worklist;
+ List<_ReductionTask> _worklist;
static final _DeletedNode _DELETED = new _DeletedNode();
/// Applies shrinking reductions to root, mutating root in the process.
@override
void rewrite(FunctionDefinition root) {
- _worklist = new Set<_ReductionTask>();
+ _worklist = new List<_ReductionTask>();
_RedexVisitor redexVisitor = new _RedexVisitor(_worklist);
// Set all parent pointers.
@@ -32,8 +32,7 @@ class ShrinkingReducer extends Pass {
// Process the worklist.
while (_worklist.isNotEmpty) {
- _ReductionTask task = _worklist.first;
- _worklist.remove(task);
+ _ReductionTask task = _worklist.removeLast();
_processTask(task);
}
}
@@ -400,7 +399,7 @@ bool _isDeadParameter(Parameter parameter) {
/// Traverses a term and adds any found redexes to the worklist.
class _RedexVisitor extends RecursiveVisitor {
- final Set<_ReductionTask> worklist;
+ final List<_ReductionTask> worklist;
_RedexVisitor(this.worklist);
@@ -446,7 +445,7 @@ class _RedexVisitor extends RecursiveVisitor {
/// any corresponding tasks can be skipped. Nodes are marked so by setting
/// their parent to the deleted sentinel.
class _RemovalVisitor extends RecursiveVisitor {
- final Set<_ReductionTask> worklist;
+ final List<_ReductionTask> worklist;
_RemovalVisitor(this.worklist);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/let_sinking.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698