Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index a6205ecdf5a6de3e10dbd6cd219a6faef1010434..be56c673b9ea8003bbac6fb15d28e5e5ae23156c 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -840,6 +840,19 @@ void HGraph::EliminateUnreachablePhis() { |
} |
+bool HGraph::CheckPhis() { |
+ int block_count = blocks_.length(); |
+ for (int i = 0; i < block_count; ++i) { |
+ for (int j = 0; j < blocks_[i]->phis()->length(); ++j) { |
+ HPhi* phi = blocks_[i]->phis()->at(j); |
+ // We don't support phi uses of arguments for now. |
+ if (phi->CheckFlag(HValue::kIsArguments)) return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
+ |
bool HGraph::CollectPhis() { |
int block_count = blocks_.length(); |
phi_list_ = new ZoneList<HPhi*>(block_count); |
@@ -847,8 +860,6 @@ bool HGraph::CollectPhis() { |
for (int j = 0; j < blocks_[i]->phis()->length(); ++j) { |
HPhi* phi = blocks_[i]->phis()->at(j); |
phi_list_->Add(phi); |
- // We don't support phi uses of arguments for now. |
- if (phi->CheckFlag(HValue::kIsArguments)) return false; |
// Check for the hole value (from an uninitialized const). |
for (int k = 0; k < phi->OperandCount(); k++) { |
if (phi->OperandAt(k) == GetConstantHole()) return false; |
@@ -2301,9 +2312,13 @@ HGraph* HGraphBuilder::CreateGraph() { |
graph()->AssignDominators(); |
graph()->PropagateDeoptimizingMark(); |
graph()->EliminateRedundantPhis(); |
+ if (!graph()->CheckPhis()) { |
+ Bailout("Unsupported phi use of arguments object"); |
+ return NULL; |
+ } |
if (FLAG_eliminate_dead_phis) graph()->EliminateUnreachablePhis(); |
if (!graph()->CollectPhis()) { |
- Bailout("Unsupported phi-use"); |
+ Bailout("Unsupported phi use of uninitialized constant"); |
return NULL; |
} |