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 #include <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #if V8_TARGET_ARCH_PPC | 10 #if V8_TARGET_ARCH_PPC |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 | 1079 |
1080 void MacroAssembler::DebugBreak() { | 1080 void MacroAssembler::DebugBreak() { |
1081 li(r3, Operand::Zero()); | 1081 li(r3, Operand::Zero()); |
1082 mov(r4, Operand(ExternalReference(Runtime::kDebugBreak, isolate()))); | 1082 mov(r4, Operand(ExternalReference(Runtime::kDebugBreak, isolate()))); |
1083 CEntryStub ces(isolate(), 1); | 1083 CEntryStub ces(isolate(), 1); |
1084 DCHECK(AllowThisStubCall(&ces)); | 1084 DCHECK(AllowThisStubCall(&ces)); |
1085 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 1085 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
1086 } | 1086 } |
1087 | 1087 |
1088 | 1088 |
1089 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 1089 void MacroAssembler::PushStackHandler() { |
1090 int handler_index) { | |
1091 // Adjust this code if not the case. | 1090 // Adjust this code if not the case. |
1092 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); | 1091 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
1093 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 1092 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
1094 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | |
1095 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | |
1096 | |
1097 // For the JSEntry handler, we must preserve r1-r7, r0,r8-r12 are available. | |
1098 // We want the stack to look like | |
1099 // sp -> NextOffset | |
1100 // index | |
1101 // context | |
1102 | 1093 |
1103 // Link the current handler as the next handler. | 1094 // Link the current handler as the next handler. |
| 1095 // Preserve r3-r7. |
1104 mov(r8, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 1096 mov(r8, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
1105 LoadP(r0, MemOperand(r8)); | 1097 LoadP(r0, MemOperand(r8)); |
1106 StorePU(r0, MemOperand(sp, -StackHandlerConstants::kSize)); | 1098 push(r0); |
| 1099 |
1107 // Set this new handler as the current one. | 1100 // Set this new handler as the current one. |
1108 StoreP(sp, MemOperand(r8)); | 1101 StoreP(sp, MemOperand(r8)); |
1109 | |
1110 mov(r8, Operand(handler_index)); | |
1111 if (kind == StackHandler::JS_ENTRY) { | |
1112 LoadSmiLiteral(cp, Smi::FromInt(0)); // Indicates no context. | |
1113 } | |
1114 StoreP(r8, MemOperand(sp, StackHandlerConstants::kStateOffset)); | |
1115 StoreP(cp, MemOperand(sp, StackHandlerConstants::kContextOffset)); | |
1116 } | 1102 } |
1117 | 1103 |
1118 | 1104 |
1119 void MacroAssembler::PopTryHandler() { | 1105 void MacroAssembler::PopStackHandler() { |
| 1106 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
1120 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 1107 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 1108 |
1121 pop(r4); | 1109 pop(r4); |
1122 mov(ip, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 1110 mov(ip, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
1123 addi(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); | |
1124 StoreP(r4, MemOperand(ip)); | 1111 StoreP(r4, MemOperand(ip)); |
1125 } | 1112 } |
1126 | 1113 |
1127 | 1114 |
1128 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, | 1115 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, |
1129 Register scratch, Label* miss) { | 1116 Register scratch, Label* miss) { |
1130 Label same_contexts; | 1117 Label same_contexts; |
1131 | 1118 |
1132 DCHECK(!holder_reg.is(scratch)); | 1119 DCHECK(!holder_reg.is(scratch)); |
1133 DCHECK(!holder_reg.is(ip)); | 1120 DCHECK(!holder_reg.is(ip)); |
(...skipping 3405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4539 } | 4526 } |
4540 if (mag.shift > 0) srawi(result, result, mag.shift); | 4527 if (mag.shift > 0) srawi(result, result, mag.shift); |
4541 ExtractBit(r0, dividend, 31); | 4528 ExtractBit(r0, dividend, 31); |
4542 add(result, result, r0); | 4529 add(result, result, r0); |
4543 } | 4530 } |
4544 | 4531 |
4545 } // namespace internal | 4532 } // namespace internal |
4546 } // namespace v8 | 4533 } // namespace v8 |
4547 | 4534 |
4548 #endif // V8_TARGET_ARCH_PPC | 4535 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |