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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 #ifndef V8_X64_FRAMES_X64_H_ |
| 29 #define V8_X64_FRAMES_X64_H_ |
| 30 |
| 31 namespace v8 { namespace internal { |
| 32 |
| 33 // TODO(port): This is a stub, mostly just a copy of the ia32 bit version. |
| 34 // This will all need to change to be correct for x64. |
| 35 |
| 36 static const int kNumRegs = 8; |
| 37 static const RegList kJSCallerSaved = 0; |
| 38 static const int kNumJSCallerSaved = 5; |
| 39 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; |
| 40 |
| 41 class StackHandlerConstants : public AllStatic { |
| 42 public: |
| 43 static const int kNextOffset = -1 * kPointerSize; |
| 44 static const int kPPOffset = -1 * kPointerSize; |
| 45 static const int kFPOffset = -1 * kPointerSize; |
| 46 |
| 47 static const int kCodeOffset = -1 * kPointerSize; |
| 48 |
| 49 static const int kStateOffset = -1 * kPointerSize; |
| 50 static const int kPCOffset = -1 * kPointerSize; |
| 51 |
| 52 static const int kAddressDisplacement = -1 * kPointerSize; |
| 53 static const int kSize = kPCOffset + kPointerSize; |
| 54 }; |
| 55 |
| 56 |
| 57 class EntryFrameConstants : public AllStatic { |
| 58 public: |
| 59 static const int kCallerFPOffset = -1 * kPointerSize; |
| 60 |
| 61 static const int kFunctionArgOffset = -1 * kPointerSize; |
| 62 static const int kReceiverArgOffset = -1 * kPointerSize; |
| 63 static const int kArgcOffset = -1 * kPointerSize; |
| 64 static const int kArgvOffset = -1 * kPointerSize; |
| 65 }; |
| 66 |
| 67 |
| 68 class ExitFrameConstants : public AllStatic { |
| 69 public: |
| 70 static const int kDebugMarkOffset = -1 * kPointerSize; |
| 71 static const int kSPOffset = -1 * kPointerSize; |
| 72 |
| 73 static const int kPPDisplacement = -1 * kPointerSize; |
| 74 |
| 75 static const int kCallerFPOffset = -1 * kPointerSize; |
| 76 static const int kCallerPCOffset = -1 * kPointerSize; |
| 77 }; |
| 78 |
| 79 |
| 80 class StandardFrameConstants : public AllStatic { |
| 81 public: |
| 82 static const int kExpressionsOffset = -1 * kPointerSize; |
| 83 static const int kMarkerOffset = -1 * kPointerSize; |
| 84 static const int kContextOffset = -1 * kPointerSize; |
| 85 static const int kCallerFPOffset = -1 * kPointerSize; |
| 86 static const int kCallerPCOffset = -1 * kPointerSize; |
| 87 static const int kCallerSPOffset = -1 * kPointerSize; |
| 88 }; |
| 89 |
| 90 |
| 91 class JavaScriptFrameConstants : public AllStatic { |
| 92 public: |
| 93 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; |
| 94 static const int kSavedRegistersOffset = -1 * kPointerSize; |
| 95 static const int kFunctionOffset = StandardFrameConstants::kMarkerOffset; |
| 96 |
| 97 static const int kParam0Offset = -1 * kPointerSize; |
| 98 static const int kReceiverOffset = -1 * kPointerSize; |
| 99 }; |
| 100 |
| 101 |
| 102 class ArgumentsAdaptorFrameConstants : public AllStatic { |
| 103 public: |
| 104 static const int kLengthOffset = StandardFrameConstants::kExpressionsOffset; |
| 105 }; |
| 106 |
| 107 |
| 108 class InternalFrameConstants : public AllStatic { |
| 109 public: |
| 110 static const int kCodeOffset = StandardFrameConstants::kExpressionsOffset; |
| 111 }; |
| 112 |
| 113 |
| 114 inline Object* JavaScriptFrame::function_slot_object() const { |
| 115 const int offset = JavaScriptFrameConstants::kFunctionOffset; |
| 116 return Memory::Object_at(fp() + offset); |
| 117 } |
| 118 |
| 119 } } // namespace v8::internal |
| 120 |
| 121 #endif // V8_X64_FRAMES_X64_H_ |
OLD | NEW |