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* lazy_deoptimization_environment; | 604 LEnvironment* deoptimization_environment; |
605 ASSERT(!instr->IsControl()); | 605 if (instr->HasDeoptimizationEnvironment()) { |
606 ASSERT(instructions_->at(current_instruction_ + 1)->IsGap()); | 606 deoptimization_environment = instr->deoptimization_environment(); |
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(); | |
611 } else { | 607 } else { |
612 lazy_deoptimization_environment = instr->environment(); | 608 deoptimization_environment = instr->environment(); |
613 } | 609 } |
614 | 610 |
615 RegisterEnvironmentForDeoptimization(lazy_deoptimization_environment); | 611 RegisterEnvironmentForDeoptimization(deoptimization_environment); |
616 RecordSafepoint(instr->pointer_map(), | 612 RecordSafepoint(instr->pointer_map(), |
617 lazy_deoptimization_environment->deoptimization_index()); | 613 deoptimization_environment->deoptimization_index()); |
618 } | 614 } |
619 | 615 |
620 | 616 |
621 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { | 617 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { |
622 if (!environment->HasBeenRegistered()) { | 618 if (!environment->HasBeenRegistered()) { |
623 // Physical stack frame layout: | 619 // Physical stack frame layout: |
624 // -x ............. -4 0 ..................................... y | 620 // -x ............. -4 0 ..................................... y |
625 // [incoming arguments] [spill slots] [pushed outgoing arguments] | 621 // [incoming arguments] [spill slots] [pushed outgoing arguments] |
626 | 622 |
627 // Layout of the environment: | 623 // Layout of the environment: |
(...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3674 | 3670 |
3675 | 3671 |
3676 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3672 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3677 Abort("DoOsrEntry unimplemented."); | 3673 Abort("DoOsrEntry unimplemented."); |
3678 } | 3674 } |
3679 | 3675 |
3680 | 3676 |
3681 #undef __ | 3677 #undef __ |
3682 | 3678 |
3683 } } // namespace v8::internal | 3679 } } // namespace v8::internal |
OLD | NEW |