| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 | 29 |
| 30 #ifndef V8_MIPS_FRAMES_MIPS_H_ | 30 #ifndef V8_MIPS_FRAMES_MIPS_H_ |
| 31 #define V8_MIPS_FRAMES_MIPS_H_ | 31 #define V8_MIPS_FRAMES_MIPS_H_ |
| 32 | 32 |
| 33 | |
| 34 namespace v8 { | 33 namespace v8 { |
| 35 namespace internal { | 34 namespace internal { |
| 36 | 35 |
| 37 // Register lists. | 36 // Register lists. |
| 38 // Note that the bit values must match those used in actual instruction | 37 // Note that the bit values must match those used in actual instruction |
| 39 // encoding. | 38 // encoding. |
| 40 static const int kNumRegs = 32; | 39 static const int kNumRegs = 32; |
| 41 | 40 |
| 42 static const RegList kJSCallerSaved = | 41 static const RegList kJSCallerSaved = |
| 43 1 << 2 | // v0 | 42 1 << 2 | // v0 |
| 44 1 << 4 | // a0 | 43 1 << 3 | // v1 |
| 45 1 << 5 | // a1 | 44 1 << 4 | // a0 |
| 46 1 << 6 | // a2 | 45 1 << 5 | // a1 |
| 47 1 << 7; // a3 | 46 1 << 6 | // a2 |
| 47 1 << 7 | // a3 |
| 48 1 << 8 | // t0 |
| 49 1 << 9 | // t1 |
| 50 1 << 10 | // t2 |
| 51 1 << 11 | // t3 |
| 52 1 << 12 | // t4 |
| 53 1 << 13 | // t5 |
| 54 1 << 14 | // t6 |
| 55 1 << 15; // t7 |
| 48 | 56 |
| 49 static const int kNumJSCallerSaved = 5; | 57 static const int kNumJSCallerSaved = 14; |
| 50 | 58 |
| 51 | 59 |
| 52 // Return the code of the n-th caller-saved register available to JavaScript | 60 // Return the code of the n-th caller-saved register available to JavaScript |
| 53 // e.g. JSCallerSavedReg(0) returns a0.code() == 4. | 61 // e.g. JSCallerSavedReg(0) returns a0.code() == 4. |
| 54 int JSCallerSavedCode(int n); | 62 int JSCallerSavedCode(int n); |
| 55 | 63 |
| 56 | 64 |
| 57 // Callee-saved registers preserved when switching from C to JavaScript. | 65 // Callee-saved registers preserved when switching from C to JavaScript. |
| 58 static const RegList kCalleeSaved = | 66 static const RegList kCalleeSaved = |
| 59 // Saved temporaries. | 67 1 << 16 | // s0 |
| 60 1 << 16 | 1 << 17 | 1 << 18 | 1 << 19 | | 68 1 << 17 | // s1 |
| 61 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23 | | 69 1 << 18 | // s2 |
| 62 // fp. | 70 1 << 19 | // s3 |
| 63 1 << 30; | 71 1 << 20 | // s4 |
| 72 1 << 21 | // s5 |
| 73 1 << 22 | // s6 (roots in Javascript code) |
| 74 1 << 23 | // s7 (cp in Javascript code) |
| 75 1 << 30; // fp/s8 |
| 64 | 76 |
| 65 static const int kNumCalleeSaved = 9; | 77 static const int kNumCalleeSaved = 9; |
| 66 | 78 |
| 79 static const RegList kCalleeSavedFPU = |
| 80 1 << 20 | // f20 |
| 81 1 << 22 | // f22 |
| 82 1 << 24 | // f24 |
| 83 1 << 26 | // f26 |
| 84 1 << 28 | // f28 |
| 85 1 << 30; // f30 |
| 67 | 86 |
| 87 static const int kNumCalleeSavedFPU = 6; |
| 68 // Number of registers for which space is reserved in safepoints. Must be a | 88 // Number of registers for which space is reserved in safepoints. Must be a |
| 69 // multiple of 8. | 89 // multiple of 8. |
| 70 // TODO(mips): Only 8 registers may actually be sufficient. Revisit. | 90 // TODO(mips): Only 8 registers may actually be sufficient. Revisit. |
| 71 static const int kNumSafepointRegisters = 16; | 91 static const int kNumSafepointRegisters = 24; |
| 72 | 92 |
| 73 // Define the list of registers actually saved at safepoints. | 93 // Define the list of registers actually saved at safepoints. |
| 74 // Note that the number of saved registers may be smaller than the reserved | 94 // Note that the number of saved registers may be smaller than the reserved |
| 75 // space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters. | 95 // space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters. |
| 76 static const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved; | 96 static const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved; |
| 77 static const int kNumSafepointSavedRegisters = | 97 static const int kNumSafepointSavedRegisters = |
| 78 kNumJSCallerSaved + kNumCalleeSaved; | 98 kNumJSCallerSaved + kNumCalleeSaved; |
| 79 | 99 |
| 80 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; | 100 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; |
| 81 | 101 |
| 82 static const int kUndefIndex = -1; | 102 static const int kUndefIndex = -1; |
| 83 // Map with indexes on stack that corresponds to codes of saved registers. | 103 // Map with indexes on stack that corresponds to codes of saved registers. |
| 84 static const int kSafepointRegisterStackIndexMap[kNumRegs] = { | 104 static const int kSafepointRegisterStackIndexMap[kNumRegs] = { |
| 85 kUndefIndex, | 105 kUndefIndex, // zero_reg |
| 86 kUndefIndex, | 106 kUndefIndex, // at |
| 87 0, // v0 | 107 0, // v0 |
| 88 kUndefIndex, | 108 1, // v1 |
| 89 1, // a0 | 109 2, // a0 |
| 90 2, // a1 | 110 3, // a1 |
| 91 3, // a2 | 111 4, // a2 |
| 92 4, // a3 | 112 5, // a3 |
| 93 kUndefIndex, | 113 6, // t0 |
| 94 kUndefIndex, | 114 7, // t1 |
| 95 kUndefIndex, | 115 8, // t2 |
| 96 kUndefIndex, | 116 9, // t3 |
| 97 kUndefIndex, | 117 10, // t4 |
| 98 kUndefIndex, | 118 11, // t5 |
| 99 kUndefIndex, | 119 12, // t6 |
| 100 kUndefIndex, | 120 13, // t7 |
| 101 5, // Saved temporaries. | 121 14, // s0 |
| 102 6, | 122 15, // s1 |
| 103 7, | 123 16, // s2 |
| 104 8, | 124 17, // s3 |
| 105 9, | 125 18, // s4 |
| 106 10, | 126 19, // s5 |
| 107 11, | 127 20, // s6 |
| 108 12, | 128 21, // s7 |
| 109 kUndefIndex, | 129 kUndefIndex, // t8 |
| 110 kUndefIndex, | 130 kUndefIndex, // t9 |
| 111 kUndefIndex, | 131 kUndefIndex, // k0 |
| 112 kUndefIndex, | 132 kUndefIndex, // k1 |
| 113 13, // gp | 133 kUndefIndex, // gp |
| 114 14, // sp | 134 kUndefIndex, // sp |
| 115 15, // fp | 135 22, // fp |
| 116 kUndefIndex | 136 kUndefIndex |
| 117 }; | 137 }; |
| 118 | 138 |
| 119 | 139 |
| 120 // ---------------------------------------------------- | 140 // ---------------------------------------------------- |
| 121 | 141 |
| 122 class StackHandlerConstants : public AllStatic { | 142 class StackHandlerConstants : public AllStatic { |
| 123 public: | 143 public: |
| 124 static const int kNextOffset = 0 * kPointerSize; | 144 static const int kNextOffset = 0 * kPointerSize; |
| 125 static const int kStateOffset = 1 * kPointerSize; | 145 static const int kStateOffset = 1 * kPointerSize; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 231 |
| 212 inline Object* JavaScriptFrame::function_slot_object() const { | 232 inline Object* JavaScriptFrame::function_slot_object() const { |
| 213 const int offset = JavaScriptFrameConstants::kFunctionOffset; | 233 const int offset = JavaScriptFrameConstants::kFunctionOffset; |
| 214 return Memory::Object_at(fp() + offset); | 234 return Memory::Object_at(fp() + offset); |
| 215 } | 235 } |
| 216 | 236 |
| 217 | 237 |
| 218 } } // namespace v8::internal | 238 } } // namespace v8::internal |
| 219 | 239 |
| 220 #endif | 240 #endif |
| OLD | NEW |