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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3203 __ bind(&loop); | 3203 __ bind(&loop); |
3204 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); | 3204 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); |
3205 __ dec(length); | 3205 __ dec(length); |
3206 __ j(not_zero, &loop); | 3206 __ j(not_zero, &loop); |
3207 | 3207 |
3208 // Invoke the function. | 3208 // Invoke the function. |
3209 __ bind(&invoke); | 3209 __ bind(&invoke); |
3210 | 3210 |
3211 InvokeFlag flag = CALL_FUNCTION; | 3211 InvokeFlag flag = CALL_FUNCTION; |
3212 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { | 3212 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { |
| 3213 DCHECK(!info()->saves_caller_doubles()); |
3213 // TODO(ishell): drop current frame before pushing arguments to the stack. | 3214 // TODO(ishell): drop current frame before pushing arguments to the stack. |
3214 flag = JUMP_FUNCTION; | 3215 flag = JUMP_FUNCTION; |
3215 ParameterCount actual(eax); | 3216 ParameterCount actual(eax); |
3216 // It is safe to use ebx, ecx and edx as scratch registers here given that | 3217 // It is safe to use ebx, ecx and edx as scratch registers here given that |
3217 // 1) we are not going to return to caller function anyway, | 3218 // 1) we are not going to return to caller function anyway, |
3218 // 2) ebx (expected arguments count) and edx (new.target) will be | 3219 // 2) ebx (expected arguments count) and edx (new.target) will be |
3219 // initialized below. | 3220 // initialized below. |
3220 PrepareForTailCall(actual, ebx, ecx, edx); | 3221 PrepareForTailCall(actual, ebx, ecx, edx); |
3221 } | 3222 } |
3222 | 3223 |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3837 | 3838 |
3838 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3839 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
3839 HInvokeFunction* hinstr = instr->hydrogen(); | 3840 HInvokeFunction* hinstr = instr->hydrogen(); |
3840 DCHECK(ToRegister(instr->context()).is(esi)); | 3841 DCHECK(ToRegister(instr->context()).is(esi)); |
3841 DCHECK(ToRegister(instr->function()).is(edi)); | 3842 DCHECK(ToRegister(instr->function()).is(edi)); |
3842 DCHECK(instr->HasPointerMap()); | 3843 DCHECK(instr->HasPointerMap()); |
3843 | 3844 |
3844 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; | 3845 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; |
3845 | 3846 |
3846 if (is_tail_call) { | 3847 if (is_tail_call) { |
| 3848 DCHECK(!info()->saves_caller_doubles()); |
3847 ParameterCount actual(instr->arity()); | 3849 ParameterCount actual(instr->arity()); |
3848 // It is safe to use ebx, ecx and edx as scratch registers here given that | 3850 // It is safe to use ebx, ecx and edx as scratch registers here given that |
3849 // 1) we are not going to return to caller function anyway, | 3851 // 1) we are not going to return to caller function anyway, |
3850 // 2) ebx (expected arguments count) and edx (new.target) will be | 3852 // 2) ebx (expected arguments count) and edx (new.target) will be |
3851 // initialized below. | 3853 // initialized below. |
3852 PrepareForTailCall(actual, ebx, ecx, edx); | 3854 PrepareForTailCall(actual, ebx, ecx, edx); |
3853 } | 3855 } |
3854 | 3856 |
3855 Handle<JSFunction> known_function = hinstr->known_function(); | 3857 Handle<JSFunction> known_function = hinstr->known_function(); |
3856 if (known_function.is_null()) { | 3858 if (known_function.is_null()) { |
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5840 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5842 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
5841 } | 5843 } |
5842 | 5844 |
5843 | 5845 |
5844 #undef __ | 5846 #undef __ |
5845 | 5847 |
5846 } // namespace internal | 5848 } // namespace internal |
5847 } // namespace v8 | 5849 } // namespace v8 |
5848 | 5850 |
5849 #endif // V8_TARGET_ARCH_X87 | 5851 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |