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 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 // we can store the address on the stack to be able to find it again and | 1028 // we can store the address on the stack to be able to find it again and |
1029 // we never have to restore it, because it will not change. | 1029 // we never have to restore it, because it will not change. |
1030 { | 1030 { |
1031 Label return_label; | 1031 Label return_label; |
1032 __ larl(r14, &return_label); // Generate the return addr of call later. | 1032 __ larl(r14, &return_label); // Generate the return addr of call later. |
1033 __ StoreP(r14, MemOperand(sp, kStackFrameRASlot * kPointerSize)); | 1033 __ StoreP(r14, MemOperand(sp, kStackFrameRASlot * kPointerSize)); |
1034 | 1034 |
1035 // zLinux ABI requires caller's frame to have sufficient space for callee | 1035 // zLinux ABI requires caller's frame to have sufficient space for callee |
1036 // preserved regsiter save area. | 1036 // preserved regsiter save area. |
1037 // __ lay(sp, MemOperand(sp, -kCalleeRegisterSaveAreaSize)); | 1037 // __ lay(sp, MemOperand(sp, -kCalleeRegisterSaveAreaSize)); |
1038 __ positions_recorder()->WriteRecordedPositions(); | |
1039 __ b(target); | 1038 __ b(target); |
1040 __ bind(&return_label); | 1039 __ bind(&return_label); |
1041 // __ la(sp, MemOperand(sp, +kCalleeRegisterSaveAreaSize)); | 1040 // __ la(sp, MemOperand(sp, +kCalleeRegisterSaveAreaSize)); |
1042 } | 1041 } |
1043 | 1042 |
1044 // If return value is on the stack, pop it to registers. | 1043 // If return value is on the stack, pop it to registers. |
1045 if (needs_return_buffer) { | 1044 if (needs_return_buffer) { |
1046 if (result_size() > 2) __ LoadP(r4, MemOperand(r2, 2 * kPointerSize)); | 1045 if (result_size() > 2) __ LoadP(r4, MemOperand(r2, 2 * kPointerSize)); |
1047 __ LoadP(r3, MemOperand(r2, kPointerSize)); | 1046 __ LoadP(r3, MemOperand(r2, kPointerSize)); |
1048 __ LoadP(r2, MemOperand(r2)); | 1047 __ LoadP(r2, MemOperand(r2)); |
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3087 __ Pop(r3, r2); | 3086 __ Pop(r3, r2); |
3088 } | 3087 } |
3089 | 3088 |
3090 __ JumpToJSEntry(r4); | 3089 __ JumpToJSEntry(r4); |
3091 } | 3090 } |
3092 | 3091 |
3093 // This stub is paired with DirectCEntryStub::GenerateCall | 3092 // This stub is paired with DirectCEntryStub::GenerateCall |
3094 void DirectCEntryStub::Generate(MacroAssembler* masm) { | 3093 void DirectCEntryStub::Generate(MacroAssembler* masm) { |
3095 __ CleanseP(r14); | 3094 __ CleanseP(r14); |
3096 | 3095 |
3097 // Statement positions are expected to be recorded when the target | |
3098 // address is loaded. | |
3099 __ positions_recorder()->WriteRecordedPositions(); | |
3100 | |
3101 __ b(ip); // Callee will return to R14 directly | 3096 __ b(ip); // Callee will return to R14 directly |
3102 } | 3097 } |
3103 | 3098 |
3104 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, Register target) { | 3099 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, Register target) { |
3105 #if ABI_USES_FUNCTION_DESCRIPTORS && !defined(USE_SIMULATOR) | 3100 #if ABI_USES_FUNCTION_DESCRIPTORS && !defined(USE_SIMULATOR) |
3106 // Native AIX/S390X Linux use a function descriptor. | 3101 // Native AIX/S390X Linux use a function descriptor. |
3107 __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kPointerSize)); | 3102 __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kPointerSize)); |
3108 __ LoadP(target, MemOperand(target, 0)); // Instruction address | 3103 __ LoadP(target, MemOperand(target, 0)); // Instruction address |
3109 #else | 3104 #else |
3110 // ip needs to be set for DirectCEentryStub::Generate, and also | 3105 // ip needs to be set for DirectCEentryStub::Generate, and also |
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5501 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5496 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5502 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5497 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5503 } | 5498 } |
5504 | 5499 |
5505 #undef __ | 5500 #undef __ |
5506 | 5501 |
5507 } // namespace internal | 5502 } // namespace internal |
5508 } // namespace v8 | 5503 } // namespace v8 |
5509 | 5504 |
5510 #endif // V8_TARGET_ARCH_S390 | 5505 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |