Chromium Code Reviews| Index: src/hydrogen-mark-deoptimize.cc |
| diff --git a/src/hydrogen-mark-deoptimize.cc b/src/hydrogen-mark-deoptimize.cc |
| index 111fcd2ce9ba30e7923ca4cdd7af952746499573..7927c8fb29c32e24eba15cb289e5399212f6add7 100644 |
| --- a/src/hydrogen-mark-deoptimize.cc |
| +++ b/src/hydrogen-mark-deoptimize.cc |
| @@ -34,14 +34,9 @@ void HMarkDeoptimizeOnUndefinedPhase::Run() { |
| const ZoneList<HPhi*>* phi_list = graph()->phi_list(); |
| for (int i = 0; i < phi_list->length(); i++) { |
| HPhi* phi = phi_list->at(i); |
| - if (phi->CheckFlag(HValue::kAllowUndefinedAsNaN)) { |
| - for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { |
| - HValue* use_value = it.value(); |
| - if (!use_value->CheckFlag(HValue::kAllowUndefinedAsNaN)) { |
| - ProcessPhi(phi); |
| - break; |
| - } |
| - } |
| + if (phi->CheckFlag(HValue::kAllowUndefinedAsNaN) && |
| + !phi->CheckUsesForFlag(HValue::kAllowUndefinedAsNaN)) { |
| + ProcessPhi(phi); |
| } |
| } |
| } |
| @@ -68,4 +63,22 @@ void HMarkDeoptimizeOnUndefinedPhase::ProcessPhi(HPhi* phi) { |
| } |
| } |
| + |
| +void HComputeChangeUndefinedToNaN::Run() { |
| + const ZoneList<HBasicBlock*>* blocks(graph()->blocks()); |
| + for (int i = 0; i < blocks->length(); ++i) { |
| + const HBasicBlock* block(blocks->at(i)); |
| + for (HInstruction* current = block->first(); current != NULL; ) { |
| + HInstruction* next = current->next(); |
| + if (current->IsChange()) { |
| + if (HChange::cast(current)->convert_undefined_to_nan()) { |
|
danno
2013/08/13 12:55:03
shouldn't this method be called "can_context_undef
Toon Verwaest
2013/08/13 13:18:56
Done.
|
| + current->SetFlag(HValue::kAllowUndefinedAsNaN); |
| + } |
| + } |
| + current = next; |
| + } |
| + } |
| +} |
| + |
| + |
| } } // namespace v8::internal |