OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } else { | 594 } else { |
595 RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex); | 595 RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex); |
596 } | 596 } |
597 } | 597 } |
598 | 598 |
599 | 599 |
600 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { | 600 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { |
601 // Create the environment to bailout to. If the call has side effects | 601 // Create the environment to bailout to. If the call has side effects |
602 // execution has to continue after the call otherwise execution can continue | 602 // execution has to continue after the call otherwise execution can continue |
603 // from a previous bailout point repeating the call. | 603 // from a previous bailout point repeating the call. |
604 LEnvironment* deoptimization_environment; | 604 LEnvironment* lazy_deoptimization_environment; |
605 if (instr->HasDeoptimizationEnvironment()) { | 605 ASSERT(!instr->IsControl()); |
606 deoptimization_environment = instr->deoptimization_environment(); | 606 ASSERT(instructions_->at(current_instruction_ + 1)->IsGap()); |
| 607 LInstruction* next_instr = instructions_->at(current_instruction_ + 2); |
| 608 if (next_instr->IsLazyBailout()) { |
| 609 ASSERT(next_instr->HasEnvironment()); |
| 610 lazy_deoptimization_environment = next_instr->environment(); |
607 } else { | 611 } else { |
608 deoptimization_environment = instr->environment(); | 612 lazy_deoptimization_environment = instr->environment(); |
609 } | 613 } |
610 | 614 |
611 RegisterEnvironmentForDeoptimization(deoptimization_environment); | 615 RegisterEnvironmentForDeoptimization(lazy_deoptimization_environment); |
612 RecordSafepoint(instr->pointer_map(), | 616 RecordSafepoint(instr->pointer_map(), |
613 deoptimization_environment->deoptimization_index()); | 617 lazy_deoptimization_environment->deoptimization_index()); |
614 } | 618 } |
615 | 619 |
616 | 620 |
617 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { | 621 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { |
618 if (!environment->HasBeenRegistered()) { | 622 if (!environment->HasBeenRegistered()) { |
619 // Physical stack frame layout: | 623 // Physical stack frame layout: |
620 // -x ............. -4 0 ..................................... y | 624 // -x ............. -4 0 ..................................... y |
621 // [incoming arguments] [spill slots] [pushed outgoing arguments] | 625 // [incoming arguments] [spill slots] [pushed outgoing arguments] |
622 | 626 |
623 // Layout of the environment: | 627 // Layout of the environment: |
(...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 | 3674 |
3671 | 3675 |
3672 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3676 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3673 Abort("DoOsrEntry unimplemented."); | 3677 Abort("DoOsrEntry unimplemented."); |
3674 } | 3678 } |
3675 | 3679 |
3676 | 3680 |
3677 #undef __ | 3681 #undef __ |
3678 | 3682 |
3679 } } // namespace v8::internal | 3683 } } // namespace v8::internal |
OLD | NEW |