Chromium Code Reviews| Index: src/hydrogen.cc |
| =================================================================== |
| --- src/hydrogen.cc (revision 7210) |
| +++ src/hydrogen.cc (working copy) |
| @@ -113,6 +113,21 @@ |
| } |
| +HDeoptimize* HBasicBlock::CreateDeoptimize() { |
| + ASSERT(HasEnvironment()); |
| + HEnvironment* environment = last_environment(); |
| + |
| + HDeoptimize* instr = new HDeoptimize(environment->length()); |
| + |
| + for (int i = 0; i < environment->length(); i++) { |
| + HValue* val = environment->values()->at(i); |
| + instr->AddEnvironmentValue(val); |
| + } |
| + |
| + return instr; |
| +} |
| + |
| + |
| HSimulate* HBasicBlock::CreateSimulate(int id) { |
| ASSERT(HasEnvironment()); |
| HEnvironment* environment = last_environment(); |
| @@ -2495,7 +2510,8 @@ |
| AddSimulate(stmt->EntryId()); |
| Drop(1); |
| } |
| - current_block()->Finish(new HDeoptimize()); |
| + |
| + current_block()->FinishWithDeoptimization(); |
|
Kevin Millikin (Chromium)
2011/03/17 05:31:02
We had code to try to handle this issue with a hac
|
| set_current_block(NULL); |
| break; |
| } |
| @@ -3115,7 +3131,7 @@ |
| // know about and do not want to handle ones we've never seen. Otherwise |
| // use a generic IC. |
| if (count == types->length() && FLAG_deoptimize_uncommon_cases) { |
| - current_block()->FinishExit(new HDeoptimize); |
| + current_block()->FinishExitWithDeoptimization(); |
| } else { |
| HInstruction* instr = BuildStoreNamedGeneric(object, name, value); |
| instr->set_position(expr->position()); |
| @@ -3463,7 +3479,7 @@ |
| // know about and do not want to handle ones we've never seen. Otherwise |
| // use a generic IC. |
| if (count == types->length() && FLAG_deoptimize_uncommon_cases) { |
| - current_block()->FinishExit(new HDeoptimize); |
| + current_block()->FinishExitWithDeoptimization(); |
| } else { |
| HInstruction* instr = BuildLoadNamedGeneric(object, expr); |
| instr->set_position(expr->position()); |
| @@ -3828,7 +3844,7 @@ |
| // know about and do not want to handle ones we've never seen. Otherwise |
| // use a generic IC. |
| if (count == types->length() && FLAG_deoptimize_uncommon_cases) { |
| - current_block()->FinishExit(new HDeoptimize); |
| + current_block()->FinishExitWithDeoptimization(); |
| } else { |
| HContext* context = new HContext; |
| AddInstruction(context); |