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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 // r4: function | 1093 // r4: function |
1094 // r5: receiver | 1094 // r5: receiver |
1095 // r6: argc | 1095 // r6: argc |
1096 // r7: argv | 1096 // r7: argv |
1097 __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 1097 __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
1098 __ push(r0); | 1098 __ push(r0); |
1099 if (FLAG_enable_embedded_constant_pool) { | 1099 if (FLAG_enable_embedded_constant_pool) { |
1100 __ li(kConstantPoolRegister, Operand::Zero()); | 1100 __ li(kConstantPoolRegister, Operand::Zero()); |
1101 __ push(kConstantPoolRegister); | 1101 __ push(kConstantPoolRegister); |
1102 } | 1102 } |
1103 int marker = type(); | 1103 StackFrame::Type marker = type(); |
1104 __ LoadSmiLiteral(r0, Smi::FromInt(marker)); | 1104 __ mov(r0, Operand(StackFrame::TypeToMarker(marker))); |
1105 __ push(r0); | 1105 __ push(r0); |
1106 __ push(r0); | 1106 __ push(r0); |
1107 // Save copies of the top frame descriptor on the stack. | 1107 // Save copies of the top frame descriptor on the stack. |
1108 __ mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 1108 __ mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
1109 __ LoadP(r0, MemOperand(r8)); | 1109 __ LoadP(r0, MemOperand(r8)); |
1110 __ push(r0); | 1110 __ push(r0); |
1111 | 1111 |
1112 // Set up frame pointer for the frame to be pushed. | 1112 // Set up frame pointer for the frame to be pushed. |
1113 __ addi(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 1113 __ addi(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
1114 | 1114 |
1115 // If this is the outermost JS call, set js_entry_sp value. | 1115 // If this is the outermost JS call, set js_entry_sp value. |
1116 Label non_outermost_js; | 1116 Label non_outermost_js; |
1117 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); | 1117 ExternalReference js_entry_sp(Isolate::kJSEntrySPAddress, isolate()); |
1118 __ mov(r8, Operand(ExternalReference(js_entry_sp))); | 1118 __ mov(r8, Operand(ExternalReference(js_entry_sp))); |
1119 __ LoadP(r9, MemOperand(r8)); | 1119 __ LoadP(r9, MemOperand(r8)); |
1120 __ cmpi(r9, Operand::Zero()); | 1120 __ cmpi(r9, Operand::Zero()); |
1121 __ bne(&non_outermost_js); | 1121 __ bne(&non_outermost_js); |
1122 __ StoreP(fp, MemOperand(r8)); | 1122 __ StoreP(fp, MemOperand(r8)); |
1123 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)); | 1123 __ mov(ip, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME)); |
1124 Label cont; | 1124 Label cont; |
1125 __ b(&cont); | 1125 __ b(&cont); |
1126 __ bind(&non_outermost_js); | 1126 __ bind(&non_outermost_js); |
1127 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME)); | 1127 __ mov(ip, Operand(StackFrame::INNER_JSENTRY_FRAME)); |
1128 __ bind(&cont); | 1128 __ bind(&cont); |
1129 __ push(ip); // frame-type | 1129 __ push(ip); // frame-type |
1130 | 1130 |
1131 // Jump to a faked try block that does the invoke, with a faked catch | 1131 // Jump to a faked try block that does the invoke, with a faked catch |
1132 // block that sets the pending exception. | 1132 // block that sets the pending exception. |
1133 __ b(&invoke); | 1133 __ b(&invoke); |
1134 | 1134 |
1135 __ bind(&handler_entry); | 1135 __ bind(&handler_entry); |
1136 handler_offset_ = handler_entry.pos(); | 1136 handler_offset_ = handler_entry.pos(); |
1137 // Caught exception: Store result (exception) in the pending exception | 1137 // Caught exception: Store result (exception) in the pending exception |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 __ mtctr(ip); | 1180 __ mtctr(ip); |
1181 __ bctrl(); // make the call | 1181 __ bctrl(); // make the call |
1182 | 1182 |
1183 // Unlink this frame from the handler chain. | 1183 // Unlink this frame from the handler chain. |
1184 __ PopStackHandler(); | 1184 __ PopStackHandler(); |
1185 | 1185 |
1186 __ bind(&exit); // r3 holds result | 1186 __ bind(&exit); // r3 holds result |
1187 // Check if the current stack frame is marked as the outermost JS frame. | 1187 // Check if the current stack frame is marked as the outermost JS frame. |
1188 Label non_outermost_js_2; | 1188 Label non_outermost_js_2; |
1189 __ pop(r8); | 1189 __ pop(r8); |
1190 __ CmpSmiLiteral(r8, Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME), r0); | 1190 __ cmpi(r8, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME)); |
1191 __ bne(&non_outermost_js_2); | 1191 __ bne(&non_outermost_js_2); |
1192 __ mov(r9, Operand::Zero()); | 1192 __ mov(r9, Operand::Zero()); |
1193 __ mov(r8, Operand(ExternalReference(js_entry_sp))); | 1193 __ mov(r8, Operand(ExternalReference(js_entry_sp))); |
1194 __ StoreP(r9, MemOperand(r8)); | 1194 __ StoreP(r9, MemOperand(r8)); |
1195 __ bind(&non_outermost_js_2); | 1195 __ bind(&non_outermost_js_2); |
1196 | 1196 |
1197 // Restore the top frame descriptors from the stack. | 1197 // Restore the top frame descriptors from the stack. |
1198 __ pop(r6); | 1198 __ pop(r6); |
1199 __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 1199 __ mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
1200 __ StoreP(r6, MemOperand(ip)); | 1200 __ StoreP(r6, MemOperand(ip)); |
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3523 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 3523 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
3524 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 3524 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
3525 kStackUnwindSpace, NULL, return_value_operand, NULL); | 3525 kStackUnwindSpace, NULL, return_value_operand, NULL); |
3526 } | 3526 } |
3527 | 3527 |
3528 #undef __ | 3528 #undef __ |
3529 } // namespace internal | 3529 } // namespace internal |
3530 } // namespace v8 | 3530 } // namespace v8 |
3531 | 3531 |
3532 #endif // V8_TARGET_ARCH_PPC | 3532 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |