Index: src/ppc/frames-ppc.h |
diff --git a/src/arm/frames-arm.h b/src/ppc/frames-ppc.h |
similarity index 57% |
copy from src/arm/frames-arm.h |
copy to src/ppc/frames-ppc.h |
index ce65e887f84aec811648f27e0253b934e1fb89d6..a1d1278228cf6c0ac909d3050f82eacb7d139254 100644 |
--- a/src/arm/frames-arm.h |
+++ b/src/ppc/frames-ppc.h |
@@ -1,33 +1,35 @@ |
// Copyright 2012 the V8 project authors. All rights reserved. |
+// |
+// Copyright IBM Corp. 2012, 2013. All rights reserved. |
+// |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef V8_ARM_FRAMES_ARM_H_ |
-#define V8_ARM_FRAMES_ARM_H_ |
+#ifndef V8_PPC_FRAMES_PPC_H_ |
+#define V8_PPC_FRAMES_PPC_H_ |
namespace v8 { |
namespace internal { |
-// The ARM ABI does not specify the usage of register r9, which may be reserved |
-// as the static base or thread register on some platforms, in which case we |
-// leave it alone. Adjust the value of kR9Available accordingly: |
-const int kR9Available = 1; // 1 if available to us, 0 if reserved |
- |
- |
// Register list in load/store instructions |
// Note that the bit values must match those used in actual instruction encoding |
-const int kNumRegs = 16; |
+const int kNumRegs = 32; |
// Caller-saved/arguments registers |
const RegList kJSCallerSaved = |
- 1 << 0 | // r0 a1 |
- 1 << 1 | // r1 a2 |
- 1 << 2 | // r2 a3 |
- 1 << 3; // r3 a4 |
- |
-const int kNumJSCallerSaved = 4; |
+ 1 << 3 | // r3 a1 |
+ 1 << 4 | // r4 a2 |
+ 1 << 5 | // r5 a3 |
+ 1 << 6 | // r6 a4 |
+ 1 << 7 | // r7 a5 |
+ 1 << 8 | // r8 a6 |
+ 1 << 9 | // r9 a7 |
+ 1 << 10 | // r10 a8 |
+ 1 << 11; |
+ |
+const int kNumJSCallerSaved = 9; |
// Return the code of the n-th caller-saved register available to JavaScript |
// e.g. JSCallerSavedReg(0) returns r0.code() == 0 |
@@ -36,35 +38,32 @@ int JSCallerSavedCode(int n); |
// Callee-saved registers preserved when switching from C to JavaScript |
const RegList kCalleeSaved = |
- 1 << 4 | // r4 v1 |
- 1 << 5 | // r5 v2 |
- 1 << 6 | // r6 v3 |
- 1 << 7 | // r7 v4 (cp in JavaScript code) |
- 1 << 8 | // r8 v5 (pp in JavaScript code) |
- kR9Available << 9 | // r9 v6 |
- 1 << 10 | // r10 v7 |
- 1 << 11; // r11 v8 (fp in JavaScript code) |
- |
-// When calling into C++ (only for C++ calls that can't cause a GC). |
-// The call code will take care of lr, fp, etc. |
-const RegList kCallerSaved = |
- 1 << 0 | // r0 |
- 1 << 1 | // r1 |
- 1 << 2 | // r2 |
- 1 << 3 | // r3 |
- 1 << 9; // r9 |
- |
- |
-const int kNumCalleeSaved = 7 + kR9Available; |
- |
-// Double registers d8 to d15 are callee-saved. |
-const int kNumDoubleCalleeSaved = 8; |
- |
+ 1 << 14 | // r14 |
+ 1 << 15 | // r15 |
+ 1 << 16 | // r16 |
+ 1 << 17 | // r17 |
+ 1 << 18 | // r18 |
+ 1 << 19 | // r19 |
+ 1 << 20 | // r20 |
+ 1 << 21 | // r21 |
+ 1 << 22 | // r22 |
+ 1 << 23 | // r23 |
+ 1 << 24 | // r24 |
+ 1 << 25 | // r25 |
+ 1 << 26 | // r26 |
+ 1 << 27 | // r27 |
+ 1 << 28 | // r28 |
+ 1 << 29 | // r29 |
+ 1 << 30 | // r20 |
+ 1 << 31; // r31 |
+ |
+ |
+const int kNumCalleeSaved = 18; |
// Number of registers for which space is reserved in safepoints. Must be a |
// multiple of 8. |
// TODO(regis): Only 8 registers may actually be sufficient. Revisit. |
-const int kNumSafepointRegisters = 16; |
+const int kNumSafepointRegisters = 32; |
// Define the list of registers actually saved at safepoints. |
// Note that the number of saved registers may be smaller than the reserved |
@@ -72,6 +71,51 @@ const int kNumSafepointRegisters = 16; |
const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved; |
const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved; |
+// The following constants describe the stack frame linkage area as |
+// defined by the ABI. Note that kNumRequiredStackFrameSlots must |
+// satisfy alignment requirements (rounding up if required). |
+#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN |
+// [0] back chain |
+// [1] condition register save area |
+// [2] link register save area |
+// [3] TOC save area |
+// [4] Parameter1 save area |
+// ... |
+// [11] Parameter8 save area |
+// [12] Parameter9 slot (if necessary) |
+// ... |
+const int kNumRequiredStackFrameSlots = 12; |
+const int kStackFrameLRSlot = 2; |
+const int kStackFrameExtraParamSlot = 12; |
+#elif V8_OS_AIX || V8_TARGET_ARCH_PPC64 |
+// [0] back chain |
+// [1] condition register save area |
+// [2] link register save area |
+// [3] reserved for compiler |
+// [4] reserved by binder |
+// [5] TOC save area |
+// [6] Parameter1 save area |
+// ... |
+// [13] Parameter8 save area |
+// [14] Parameter9 slot (if necessary) |
+// ... |
+#if V8_TARGET_ARCH_PPC64 |
+const int kNumRequiredStackFrameSlots = 14; |
+#else |
+const int kNumRequiredStackFrameSlots = 16; |
+#endif |
+const int kStackFrameLRSlot = 2; |
+const int kStackFrameExtraParamSlot = 14; |
+#else |
+// [0] back chain |
+// [1] link register save area |
+// [2] Parameter9 slot (if necessary) |
+// ... |
+const int kNumRequiredStackFrameSlots = 4; |
+const int kStackFrameLRSlot = 1; |
+const int kStackFrameExtraParamSlot = 2; |
+#endif |
+ |
// ---------------------------------------------------- |
@@ -84,13 +128,15 @@ class EntryFrameConstants : public AllStatic { |
class ExitFrameConstants : public AllStatic { |
public: |
- static const int kFrameSize = FLAG_enable_ool_constant_pool ? |
- 3 * kPointerSize : 2 * kPointerSize; |
- |
- static const int kConstantPoolOffset = FLAG_enable_ool_constant_pool ? |
- -3 * kPointerSize : 0; |
- static const int kCodeOffset = -2 * kPointerSize; |
- static const int kSPOffset = -1 * kPointerSize; |
+#if V8_OOL_CONSTANT_POOL |
+ static const int kFrameSize = 3 * kPointerSize; |
+ static const int kConstantPoolOffset = -3 * kPointerSize; |
+#else |
+ static const int kFrameSize = 2 * kPointerSize; |
+ static const int kConstantPoolOffset = 0; // Not used. |
+#endif |
+ static const int kCodeOffset = -2 * kPointerSize; |
+ static const int kSPOffset = -1 * kPointerSize; |
// The caller fields are below the frame pointer on the stack. |
static const int kCallerFPOffset = 0 * kPointerSize; |
@@ -159,4 +205,4 @@ inline void StackHandler::SetFp(Address slot, Address fp) { |
} } // namespace v8::internal |
-#endif // V8_ARM_FRAMES_ARM_H_ |
+#endif // V8_PPC_FRAMES_PPC_H_ |