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 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 // Push a frame with special values setup to mark it as an entry frame. | 1073 // Push a frame with special values setup to mark it as an entry frame. |
1074 // Bad FP (-1) | 1074 // Bad FP (-1) |
1075 // SMI Marker | 1075 // SMI Marker |
1076 // SMI Marker | 1076 // SMI Marker |
1077 // kCEntryFPAddress | 1077 // kCEntryFPAddress |
1078 // Frame type | 1078 // Frame type |
1079 __ lay(sp, MemOperand(sp, -5 * kPointerSize)); | 1079 __ lay(sp, MemOperand(sp, -5 * kPointerSize)); |
1080 // Push a bad frame pointer to fail if it is used. | 1080 // Push a bad frame pointer to fail if it is used. |
1081 __ LoadImmP(r10, Operand(-1)); | 1081 __ LoadImmP(r10, Operand(-1)); |
1082 | 1082 |
1083 int marker = type(); | 1083 StackFrame::Type marker = type(); |
1084 __ LoadSmiLiteral(r9, Smi::FromInt(marker)); | 1084 __ Load(r9, Operand(StackFrame::TypeToMarker(marker))); |
1085 __ LoadSmiLiteral(r8, Smi::FromInt(marker)); | 1085 __ Load(r8, Operand(StackFrame::TypeToMarker(marker))); |
1086 // Save copies of the top frame descriptor on the stack. | 1086 // Save copies of the top frame descriptor on the stack. |
1087 __ mov(r7, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 1087 __ mov(r7, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
1088 __ LoadP(r7, MemOperand(r7)); | 1088 __ LoadP(r7, MemOperand(r7)); |
1089 __ StoreMultipleP(r7, r10, MemOperand(sp, kPointerSize)); | 1089 __ StoreMultipleP(r7, r10, MemOperand(sp, kPointerSize)); |
1090 // Set up frame pointer for the frame to be pushed. | 1090 // Set up frame pointer for the frame to be pushed. |
1091 // Need to add kPointerSize, because sp has one extra | 1091 // Need to add kPointerSize, because sp has one extra |
1092 // frame already for the frame type being pushed later. | 1092 // frame already for the frame type being pushed later. |
1093 __ lay(fp, | 1093 __ lay(fp, |
1094 MemOperand(sp, -EntryFrameConstants::kCallerFPOffset + kPointerSize)); | 1094 MemOperand(sp, -EntryFrameConstants::kCallerFPOffset + kPointerSize)); |
1095 | 1095 |
1096 // If this is the outermost JS call, set js_entry_sp value. | 1096 // If this is the outermost JS call, set js_entry_sp value. |
1097 Label non_outermost_js; | 1097 Label non_outermost_js; |
1098 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); | 1098 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); |
1099 __ mov(r7, Operand(ExternalReference(js_entry_sp))); | 1099 __ mov(r7, Operand(ExternalReference(js_entry_sp))); |
1100 __ LoadAndTestP(r8, MemOperand(r7)); | 1100 __ LoadAndTestP(r8, MemOperand(r7)); |
1101 __ bne(&non_outermost_js, Label::kNear); | 1101 __ bne(&non_outermost_js, Label::kNear); |
1102 __ StoreP(fp, MemOperand(r7)); | 1102 __ StoreP(fp, MemOperand(r7)); |
1103 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)); | 1103 __ Load(ip, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME)); |
1104 Label cont; | 1104 Label cont; |
1105 __ b(&cont, Label::kNear); | 1105 __ b(&cont, Label::kNear); |
1106 __ bind(&non_outermost_js); | 1106 __ bind(&non_outermost_js); |
1107 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME)); | 1107 __ Load(ip, Operand(StackFrame::INNER_JSENTRY_FRAME)); |
1108 | 1108 |
1109 __ bind(&cont); | 1109 __ bind(&cont); |
1110 __ StoreP(ip, MemOperand(sp)); // frame-type | 1110 __ StoreP(ip, MemOperand(sp)); // frame-type |
1111 | 1111 |
1112 // Jump to a faked try block that does the invoke, with a faked catch | 1112 // Jump to a faked try block that does the invoke, with a faked catch |
1113 // block that sets the pending exception. | 1113 // block that sets the pending exception. |
1114 __ b(&invoke, Label::kNear); | 1114 __ b(&invoke, Label::kNear); |
1115 | 1115 |
1116 __ bind(&handler_entry); | 1116 __ bind(&handler_entry); |
1117 handler_offset_ = handler_entry.pos(); | 1117 handler_offset_ = handler_entry.pos(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 __ b(ip); | 1164 __ b(ip); |
1165 __ bind(&return_addr); | 1165 __ bind(&return_addr); |
1166 | 1166 |
1167 // Unlink this frame from the handler chain. | 1167 // Unlink this frame from the handler chain. |
1168 __ PopStackHandler(); | 1168 __ PopStackHandler(); |
1169 | 1169 |
1170 __ bind(&exit); // r2 holds result | 1170 __ bind(&exit); // r2 holds result |
1171 // Check if the current stack frame is marked as the outermost JS frame. | 1171 // Check if the current stack frame is marked as the outermost JS frame. |
1172 Label non_outermost_js_2; | 1172 Label non_outermost_js_2; |
1173 __ pop(r7); | 1173 __ pop(r7); |
1174 __ CmpSmiLiteral(r7, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME), r0); | 1174 __ CmpP(r7, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME)); |
1175 __ bne(&non_outermost_js_2, Label::kNear); | 1175 __ bne(&non_outermost_js_2, Label::kNear); |
1176 __ mov(r8, Operand::Zero()); | 1176 __ mov(r8, Operand::Zero()); |
1177 __ mov(r7, Operand(ExternalReference(js_entry_sp))); | 1177 __ mov(r7, Operand(ExternalReference(js_entry_sp))); |
1178 __ StoreP(r8, MemOperand(r7)); | 1178 __ StoreP(r8, MemOperand(r7)); |
1179 __ bind(&non_outermost_js_2); | 1179 __ bind(&non_outermost_js_2); |
1180 | 1180 |
1181 // Restore the top frame descriptors from the stack. | 1181 // Restore the top frame descriptors from the stack. |
1182 __ pop(r5); | 1182 __ pop(r5); |
1183 __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 1183 __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
1184 __ StoreP(r5, MemOperand(ip)); | 1184 __ StoreP(r5, MemOperand(ip)); |
(...skipping 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3472 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 3472 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
3473 kStackUnwindSpace, NULL, return_value_operand, NULL); | 3473 kStackUnwindSpace, NULL, return_value_operand, NULL); |
3474 } | 3474 } |
3475 | 3475 |
3476 #undef __ | 3476 #undef __ |
3477 | 3477 |
3478 } // namespace internal | 3478 } // namespace internal |
3479 } // namespace v8 | 3479 } // namespace v8 |
3480 | 3480 |
3481 #endif // V8_TARGET_ARCH_S390 | 3481 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |