| 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/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 instr = AssignEnvironment(instr); | 895 instr = AssignEnvironment(instr); |
| 896 } | 896 } |
| 897 chunk_->AddInstruction(instr, current_block_); | 897 chunk_->AddInstruction(instr, current_block_); |
| 898 | 898 |
| 899 if (instr->IsCall()) { | 899 if (instr->IsCall()) { |
| 900 HEnvironment* hydrogen_env = current_block_->last_environment(); | 900 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 901 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 901 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
| 902 DCHECK_NOT_NULL(hydrogen_env); | 902 DCHECK_NOT_NULL(hydrogen_env); |
| 903 if (instr->IsSyntacticTailCall()) { | 903 if (instr->IsSyntacticTailCall()) { |
| 904 // If it was a syntactic tail call we need to drop the current frame and | 904 // If it was a syntactic tail call we need to drop the current frame and |
| 905 // an arguments adaptor frame on top of it (if the latter is present). | 905 // all the frames on top of it that are either an arguments adaptor frame |
| 906 // or a tail caller frame. |
| 906 hydrogen_env = hydrogen_env->outer(); | 907 hydrogen_env = hydrogen_env->outer(); |
| 907 if (hydrogen_env != nullptr && | 908 while (hydrogen_env != nullptr && |
| 908 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | 909 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR || |
| 910 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) { |
| 909 hydrogen_env = hydrogen_env->outer(); | 911 hydrogen_env = hydrogen_env->outer(); |
| 910 } | 912 } |
| 911 if (hydrogen_env != nullptr) { | 913 if (hydrogen_env != nullptr) { |
| 912 // Push return value on top of outer environment. | 914 // Push return value on top of outer environment. |
| 913 hydrogen_env = hydrogen_env->Copy(); | 915 hydrogen_env = hydrogen_env->Copy(); |
| 914 hydrogen_env->Push(hydrogen_val); | 916 hydrogen_env->Push(hydrogen_val); |
| 915 } else { | 917 } else { |
| 916 // Although we don't need this lazy bailout for normal execution | 918 // Although we don't need this lazy bailout for normal execution |
| 917 // (because when we tail call from the outermost function we should pop | 919 // (because when we tail call from the outermost function we should pop |
| 918 // its frame) we still need it when debugger is on. | 920 // its frame) we still need it when debugger is on. |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2625 LOperand* index = UseTempRegister(instr->index()); | 2627 LOperand* index = UseTempRegister(instr->index()); |
| 2626 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2628 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
| 2627 LInstruction* result = DefineSameAsFirst(load); | 2629 LInstruction* result = DefineSameAsFirst(load); |
| 2628 return AssignPointerMap(result); | 2630 return AssignPointerMap(result); |
| 2629 } | 2631 } |
| 2630 | 2632 |
| 2631 } // namespace internal | 2633 } // namespace internal |
| 2632 } // namespace v8 | 2634 } // namespace v8 |
| 2633 | 2635 |
| 2634 #endif // V8_TARGET_ARCH_X64 | 2636 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |