| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 14 matching lines...) Expand all Loading... |
| 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 #ifndef V8_X64_FRAMES_X64_H_ | 28 #ifndef V8_X64_FRAMES_X64_H_ |
| 29 #define V8_X64_FRAMES_X64_H_ | 29 #define V8_X64_FRAMES_X64_H_ |
| 30 | 30 |
| 31 namespace v8 { | 31 namespace v8 { |
| 32 namespace internal { | 32 namespace internal { |
| 33 | 33 |
| 34 // TODO(x64): This is a stub, mostly just a copy of the ia32 bit version. | 34 // TODO(x64): This is a stub, mostly just a copy of the ia32 bit version. |
| 35 // This will all need to change to be correct for x64. | 35 // This might all need to change to be correct for x64. |
| 36 | 36 |
| 37 static const int kNumRegs = 8; | 37 static const int kNumRegs = 8; |
| 38 static const RegList kJSCallerSaved = 0; | 38 static const RegList kJSCallerSaved = |
| 39 1 << 0 | // rax |
| 40 1 << 1 | // rcx |
| 41 1 << 2 | // rdx |
| 42 1 << 3 | // rbx - used as a caller-saved register in JavaScript code |
| 43 1 << 7; // rdi - callee function |
| 44 |
| 39 static const int kNumJSCallerSaved = 5; | 45 static const int kNumJSCallerSaved = 5; |
| 46 |
| 40 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; | 47 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; |
| 41 | 48 |
| 42 class StackHandlerConstants : public AllStatic { | 49 class StackHandlerConstants : public AllStatic { |
| 43 public: | 50 public: |
| 44 static const int kNextOffset = 0 * kPointerSize; | 51 static const int kNextOffset = 0 * kPointerSize; |
| 45 static const int kPPOffset = 1 * kPointerSize; | 52 static const int kFPOffset = 1 * kPointerSize; |
| 46 static const int kFPOffset = 2 * kPointerSize; | |
| 47 | 53 |
| 48 static const int kCodeOffset = 3 * kPointerSize; | 54 static const int kCodeOffset = 2 * kPointerSize; |
| 49 | 55 |
| 50 static const int kStateOffset = 4 * kPointerSize; | 56 static const int kStateOffset = 3 * kPointerSize; |
| 51 static const int kPCOffset = 5 * kPointerSize; | 57 static const int kPCOffset = 4 * kPointerSize; |
| 52 | 58 |
| 53 static const int kAddressDisplacement = -1 * kPointerSize; | 59 static const int kAddressDisplacement = -1 * kPointerSize; |
| 54 static const int kSize = 6 * kPointerSize; | 60 static const int kSize = 5 * kPointerSize; |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 | 63 |
| 58 class EntryFrameConstants : public AllStatic { | 64 class EntryFrameConstants : public AllStatic { |
| 59 public: | 65 public: |
| 60 static const int kCallerFPOffset = -1 * kPointerSize; | 66 static const int kCallerFPOffset = 0 * kPointerSize; |
| 61 | 67 |
| 62 static const int kFunctionArgOffset = -1 * kPointerSize; | 68 static const int kFunctionArgOffset = 1 * kPointerSize; |
| 63 static const int kReceiverArgOffset = -1 * kPointerSize; | 69 static const int kReceiverArgOffset = 2 * kPointerSize; |
| 64 static const int kArgcOffset = -1 * kPointerSize; | 70 static const int kArgcOffset = 3 * kPointerSize; |
| 65 static const int kArgvOffset = -1 * kPointerSize; | 71 static const int kArgvOffset = 4 * kPointerSize; |
| 66 }; | 72 }; |
| 67 | 73 |
| 68 | 74 |
| 69 class ExitFrameConstants : public AllStatic { | 75 class ExitFrameConstants : public AllStatic { |
| 70 public: | 76 public: |
| 71 static const int kDebugMarkOffset = -1 * kPointerSize; | 77 static const int kDebugMarkOffset = -2 * kPointerSize; |
| 72 static const int kSPOffset = -1 * kPointerSize; | 78 static const int kSPOffset = -1 * kPointerSize; |
| 73 | 79 |
| 74 static const int kPPDisplacement = -1 * kPointerSize; | 80 // TODO(X64): Remove usage of PP in exit frames? |
| 81 // Still used though StackFrame::pp() |
| 82 static const int kPPDisplacement = +2 * kPointerSize; |
| 75 | 83 |
| 76 static const int kCallerFPOffset = -1 * kPointerSize; | 84 static const int kCallerFPOffset = +0 * kPointerSize; |
| 77 static const int kCallerPCOffset = -1 * kPointerSize; | 85 static const int kCallerPCOffset = +1 * kPointerSize; |
| 78 }; | 86 }; |
| 79 | 87 |
| 80 | 88 |
| 81 class StandardFrameConstants : public AllStatic { | 89 class StandardFrameConstants : public AllStatic { |
| 82 public: | 90 public: |
| 83 static const int kExpressionsOffset = -1 * kPointerSize; | 91 static const int kExpressionsOffset = -1 * kPointerSize; |
| 84 static const int kMarkerOffset = -1 * kPointerSize; | 92 static const int kMarkerOffset = -1 * kPointerSize; |
| 85 static const int kContextOffset = -1 * kPointerSize; | 93 static const int kContextOffset = -1 * kPointerSize; |
| 86 static const int kCallerFPOffset = -1 * kPointerSize; | 94 static const int kCallerFPOffset = -1 * kPointerSize; |
| 87 static const int kCallerPCOffset = -1 * kPointerSize; | 95 static const int kCallerPCOffset = -1 * kPointerSize; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 113 | 121 |
| 114 | 122 |
| 115 inline Object* JavaScriptFrame::function_slot_object() const { | 123 inline Object* JavaScriptFrame::function_slot_object() const { |
| 116 const int offset = JavaScriptFrameConstants::kFunctionOffset; | 124 const int offset = JavaScriptFrameConstants::kFunctionOffset; |
| 117 return Memory::Object_at(fp() + offset); | 125 return Memory::Object_at(fp() + offset); |
| 118 } | 126 } |
| 119 | 127 |
| 120 } } // namespace v8::internal | 128 } } // namespace v8::internal |
| 121 | 129 |
| 122 #endif // V8_X64_FRAMES_X64_H_ | 130 #endif // V8_X64_FRAMES_X64_H_ |
| OLD | NEW |