OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/x87/lithium-x87.h" | 5 #include "src/crankshaft/x87/lithium-x87.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X87 | 9 #if V8_TARGET_ARCH_X87 |
10 | 10 |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 // an arguments adaptor frame on top of it (if the latter is present). | 928 // an arguments adaptor frame on top of it (if the latter is present). |
929 hydrogen_env = hydrogen_env->outer(); | 929 hydrogen_env = hydrogen_env->outer(); |
930 if (hydrogen_env != nullptr && | 930 if (hydrogen_env != nullptr && |
931 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | 931 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { |
932 hydrogen_env = hydrogen_env->outer(); | 932 hydrogen_env = hydrogen_env->outer(); |
933 } | 933 } |
934 if (hydrogen_env != nullptr) { | 934 if (hydrogen_env != nullptr) { |
935 // Push return value on top of outer environment. | 935 // Push return value on top of outer environment. |
936 hydrogen_env = hydrogen_env->Copy(); | 936 hydrogen_env = hydrogen_env->Copy(); |
937 hydrogen_env->Push(hydrogen_val); | 937 hydrogen_env->Push(hydrogen_val); |
| 938 } else { |
| 939 // Although we don't need this lazy bailout for normal execution |
| 940 // (because when we tail call from the outermost function we should pop |
| 941 // its frame) we still need it when debugger is on. |
| 942 hydrogen_env = current_block_->last_environment(); |
938 } | 943 } |
939 } else { | 944 } else { |
940 if (hydrogen_val->HasObservableSideEffects()) { | 945 if (hydrogen_val->HasObservableSideEffects()) { |
941 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | 946 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
942 sim->ReplayEnvironment(hydrogen_env); | 947 sim->ReplayEnvironment(hydrogen_env); |
943 hydrogen_value_for_lazy_bailout = sim; | 948 hydrogen_value_for_lazy_bailout = sim; |
944 } | 949 } |
945 } | 950 } |
946 if (hydrogen_env != nullptr) { | 951 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( |
947 // The |hydrogen_env| can be null at this point only if we are generating | 952 new (zone()) LLazyBailout(), hydrogen_env); |
948 // a syntactic tail call from the outermost function but in this case | 953 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
949 // it would be a real tail call which will pop function's frame and | 954 chunk_->AddInstruction(bailout, current_block_); |
950 // therefore this lazy bailout can be skipped. | |
951 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | |
952 new (zone()) LLazyBailout(), hydrogen_env); | |
953 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
954 chunk_->AddInstruction(bailout, current_block_); | |
955 } | |
956 } | 955 } |
957 } | 956 } |
958 | 957 |
959 | 958 |
960 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 959 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
961 LInstruction* result = new (zone()) LPrologue(); | 960 LInstruction* result = new (zone()) LPrologue(); |
962 if (info_->num_heap_slots() > 0) { | 961 if (info_->num_heap_slots() > 0) { |
963 result = MarkAsCall(result, instr); | 962 result = MarkAsCall(result, instr); |
964 } | 963 } |
965 return result; | 964 return result; |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2622 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
2624 LOperand* context = UseRegisterAtStart(instr->context()); | 2623 LOperand* context = UseRegisterAtStart(instr->context()); |
2625 return new(zone()) LStoreFrameContext(context); | 2624 return new(zone()) LStoreFrameContext(context); |
2626 } | 2625 } |
2627 | 2626 |
2628 | 2627 |
2629 } // namespace internal | 2628 } // namespace internal |
2630 } // namespace v8 | 2629 } // namespace v8 |
2631 | 2630 |
2632 #endif // V8_TARGET_ARCH_X87 | 2631 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |