| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/arm64/lithium-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-arm64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" | 9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 // an arguments adaptor frame on top of it (if the latter is present). | 723 // an arguments adaptor frame on top of it (if the latter is present). |
| 724 hydrogen_env = hydrogen_env->outer(); | 724 hydrogen_env = hydrogen_env->outer(); |
| 725 if (hydrogen_env != nullptr && | 725 if (hydrogen_env != nullptr && |
| 726 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | 726 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { |
| 727 hydrogen_env = hydrogen_env->outer(); | 727 hydrogen_env = hydrogen_env->outer(); |
| 728 } | 728 } |
| 729 if (hydrogen_env != nullptr) { | 729 if (hydrogen_env != nullptr) { |
| 730 // Push return value on top of outer environment. | 730 // Push return value on top of outer environment. |
| 731 hydrogen_env = hydrogen_env->Copy(); | 731 hydrogen_env = hydrogen_env->Copy(); |
| 732 hydrogen_env->Push(hydrogen_val); | 732 hydrogen_env->Push(hydrogen_val); |
| 733 } else { |
| 734 // Although we don't need this lazy bailout for normal execution |
| 735 // (because when we tail call from the outermost function we should pop |
| 736 // its frame) we still need it when debugger is on. |
| 737 hydrogen_env = current_block_->last_environment(); |
| 733 } | 738 } |
| 734 } else { | 739 } else { |
| 735 if (hydrogen_val->HasObservableSideEffects()) { | 740 if (hydrogen_val->HasObservableSideEffects()) { |
| 736 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | 741 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
| 737 sim->ReplayEnvironment(hydrogen_env); | 742 sim->ReplayEnvironment(hydrogen_env); |
| 738 hydrogen_value_for_lazy_bailout = sim; | 743 hydrogen_value_for_lazy_bailout = sim; |
| 739 } | 744 } |
| 740 } | 745 } |
| 741 if (hydrogen_env != nullptr) { | 746 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( |
| 742 // The |hydrogen_env| can be null at this point only if we are generating | 747 new (zone()) LLazyBailout(), hydrogen_env); |
| 743 // a syntactic tail call from the outermost function but in this case | 748 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
| 744 // it would be a real tail call which will pop function's frame and | 749 chunk_->AddInstruction(bailout, current_block_); |
| 745 // therefore this lazy bailout can be skipped. | |
| 746 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | |
| 747 new (zone()) LLazyBailout(), hydrogen_env); | |
| 748 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
| 749 chunk_->AddInstruction(bailout, current_block_); | |
| 750 } | |
| 751 } | 750 } |
| 752 } | 751 } |
| 753 | 752 |
| 754 | 753 |
| 755 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { | 754 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
| 756 HEnvironment* hydrogen_env = current_block_->last_environment(); | 755 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 757 return LChunkBuilderBase::AssignEnvironment(instr, hydrogen_env); | 756 return LChunkBuilderBase::AssignEnvironment(instr, hydrogen_env); |
| 758 } | 757 } |
| 759 | 758 |
| 760 | 759 |
| (...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2665 | 2664 |
| 2666 | 2665 |
| 2667 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2666 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
| 2668 LOperand* context = UseRegisterAtStart(instr->context()); | 2667 LOperand* context = UseRegisterAtStart(instr->context()); |
| 2669 return new(zone()) LStoreFrameContext(context); | 2668 return new(zone()) LStoreFrameContext(context); |
| 2670 } | 2669 } |
| 2671 | 2670 |
| 2672 | 2671 |
| 2673 } // namespace internal | 2672 } // namespace internal |
| 2674 } // namespace v8 | 2673 } // namespace v8 |
| OLD | NEW |