Revision: 8742
Author: [email protected]
Date: Tue Jul 26 03:12:37 2011
Log: Landing http://codereview.chromium.org/7514005/
http://code.google.com/p/v8/source/detail?r=8742
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/hydrogen.h
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Mon Jul 25 07:08:36 2011
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Jul 26 03:12:37 2011
@@ -736,6 +736,8 @@
HPhase phase("Assign dominators", this);
for (int i = 0; i < blocks_.length(); ++i) {
if (blocks_[i]->IsLoopHeader()) {
+ // Only the first predecessor of a loop header is from outside the
loop.
+ // All others are back edges, and thus cannot dominate the loop
header.
blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->first());
} else {
for (int j = 0; j < blocks_[i]->predecessors()->length(); ++j) {
@@ -743,13 +745,16 @@
}
}
}
-
- // Propagate flag marking blocks containing unconditional deoptimize.
+}
+
+// Mark all blocks that are dominated by an unconditional soft deoptimize
to
+// prevent code motion across those blocks.
+void HGraph::PropagateDeoptimizingMark()
+{
+ HPhase phase("Propagate deoptimizing mark", this);
MarkAsDeoptimizingRecursively(entry_block());
}
-
-// Mark all blocks that are dominated by an unconditional deoptimize.
void HGraph::MarkAsDeoptimizingRecursively(HBasicBlock* block) {
for (int i = 0; i < block->dominated_blocks()->length(); ++i) {
HBasicBlock* dominated = block->dominated_blocks()->at(i);
@@ -2295,6 +2300,7 @@
graph()->OrderBlocks();
graph()->AssignDominators();
+ graph()->PropagateDeoptimizingMark();
graph()->EliminateRedundantPhis();
if (FLAG_eliminate_dead_phis) graph()->EliminateUnreachablePhis();
if (!graph()->CollectPhis()) {
=======================================
--- /branches/bleeding_edge/src/hydrogen.h Mon Jul 25 07:08:36 2011
+++ /branches/bleeding_edge/src/hydrogen.h Tue Jul 26 03:12:37 2011
@@ -238,7 +238,7 @@
void OrderBlocks();
void AssignDominators();
void ReplaceCheckedValues();
- void MarkAsDeoptimizingRecursively(HBasicBlock* block);
+ void PropagateDeoptimizingMark();
// Returns false if there are phi-uses of the arguments-object
// which are not supported by the optimizing compiler.
@@ -293,6 +293,7 @@
HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
Object* value);
+ void MarkAsDeoptimizingRecursively(HBasicBlock* block);
void InsertTypeConversions(HInstruction* instr);
void PropagateMinusZeroChecks(HValue* value, BitVector* visited);
void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev