OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-ppc.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/lithium-inl.h" | 10 #include "src/crankshaft/lithium-inl.h" |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 instr = AssignEnvironment(instr); | 885 instr = AssignEnvironment(instr); |
886 } | 886 } |
887 chunk_->AddInstruction(instr, current_block_); | 887 chunk_->AddInstruction(instr, current_block_); |
888 | 888 |
889 if (instr->IsCall()) { | 889 if (instr->IsCall()) { |
890 HEnvironment* hydrogen_env = current_block_->last_environment(); | 890 HEnvironment* hydrogen_env = current_block_->last_environment(); |
891 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 891 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
892 DCHECK_NOT_NULL(hydrogen_env); | 892 DCHECK_NOT_NULL(hydrogen_env); |
893 if (instr->IsSyntacticTailCall()) { | 893 if (instr->IsSyntacticTailCall()) { |
894 // If it was a syntactic tail call we need to drop the current frame and | 894 // If it was a syntactic tail call we need to drop the current frame and |
895 // an arguments adaptor frame on top of it (if the latter is present). | 895 // all the frames on top of it that are either an arguments adaptor frame |
| 896 // or a tail caller frame. |
896 hydrogen_env = hydrogen_env->outer(); | 897 hydrogen_env = hydrogen_env->outer(); |
897 if (hydrogen_env != nullptr && | 898 while (hydrogen_env != nullptr && |
898 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | 899 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR || |
| 900 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) { |
899 hydrogen_env = hydrogen_env->outer(); | 901 hydrogen_env = hydrogen_env->outer(); |
900 } | 902 } |
901 if (hydrogen_env != nullptr) { | 903 if (hydrogen_env != nullptr) { |
902 // Push return value on top of outer environment. | 904 // Push return value on top of outer environment. |
903 hydrogen_env = hydrogen_env->Copy(); | 905 hydrogen_env = hydrogen_env->Copy(); |
904 hydrogen_env->Push(hydrogen_val); | 906 hydrogen_env->Push(hydrogen_val); |
905 } else { | 907 } else { |
906 // Although we don't need this lazy bailout for normal execution | 908 // Although we don't need this lazy bailout for normal execution |
907 // (because when we tail call from the outermost function we should pop | 909 // (because when we tail call from the outermost function we should pop |
908 // its frame) we still need it when debugger is on. | 910 // its frame) we still need it when debugger is on. |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2514 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2513 LOperand* object = UseRegister(instr->object()); | 2515 LOperand* object = UseRegister(instr->object()); |
2514 LOperand* index = UseTempRegister(instr->index()); | 2516 LOperand* index = UseTempRegister(instr->index()); |
2515 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); | 2517 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); |
2516 LInstruction* result = DefineSameAsFirst(load); | 2518 LInstruction* result = DefineSameAsFirst(load); |
2517 return AssignPointerMap(result); | 2519 return AssignPointerMap(result); |
2518 } | 2520 } |
2519 | 2521 |
2520 } // namespace internal | 2522 } // namespace internal |
2521 } // namespace v8 | 2523 } // namespace v8 |
OLD | NEW |