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

Unified Diff: src/hydrogen-minus-zero.h

Issue 190713002: Replace the recursion in PropagateMinusZeroChecks() with a loop and a worklist. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/hydrogen-instructions.cc ('k') | src/hydrogen-minus-zero.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-minus-zero.h
diff --git a/src/hydrogen-minus-zero.h b/src/hydrogen-minus-zero.h
index d23ec1196b3419cdc06e20aa3e12688979306009..7b74ab99a4a41b12916e922fa4822db8c5df62ba 100644
--- a/src/hydrogen-minus-zero.h
+++ b/src/hydrogen-minus-zero.h
@@ -38,14 +38,22 @@ class HComputeMinusZeroChecksPhase : public HPhase {
public:
explicit HComputeMinusZeroChecksPhase(HGraph* graph)
: HPhase("H_Compute minus zero checks", graph),
- visited_(graph->GetMaximumValueID(), zone()) { }
+ in_worklist_(graph->GetMaximumValueID(), zone()),
+ worklist_(32, zone()) {}
void Run();
private:
+ void AddToWorklist(HValue* value) {
+ if (value->CheckFlag(HValue::kBailoutOnMinusZero)) return;
+ if (in_worklist_.Contains(value->id())) return;
+ in_worklist_.Add(value->id());
+ worklist_.Add(value, zone());
+ }
void PropagateMinusZeroChecks(HValue* value);
- BitVector visited_;
+ BitVector in_worklist_;
+ ZoneList<HValue*> worklist_;
DISALLOW_COPY_AND_ASSIGN(HComputeMinusZeroChecksPhase);
};
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/hydrogen-minus-zero.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698