OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 static const int kFPOffset = 4 * kPointerSize; | 86 static const int kFPOffset = 4 * kPointerSize; |
87 static const int kPCOffset = 5 * kPointerSize; | 87 static const int kPCOffset = 5 * kPointerSize; |
88 | 88 |
89 static const int kAddressDisplacement = -1 * kPointerSize; | 89 static const int kAddressDisplacement = -1 * kPointerSize; |
90 static const int kSize = kPCOffset + kPointerSize; | 90 static const int kSize = kPCOffset + kPointerSize; |
91 }; | 91 }; |
92 | 92 |
93 | 93 |
94 class EntryFrameConstants : public AllStatic { | 94 class EntryFrameConstants : public AllStatic { |
95 public: | 95 public: |
96 static const int kCallerFPOffset = -2 * kPointerSize; | 96 static const int kCallerFPOffset = -3 * kPointerSize; |
97 static const int kConstructMarkOffset = -1 * kPointerSize; | |
98 }; | 97 }; |
99 | 98 |
100 | 99 |
101 class ExitFrameConstants : public AllStatic { | 100 class ExitFrameConstants : public AllStatic { |
102 public: | 101 public: |
103 // Exit frames have a debug marker on the stack. | 102 // Exit frames have a debug marker on the stack. |
104 static const int kSPDisplacement = -1 * kPointerSize; | 103 static const int kSPDisplacement = -1 * kPointerSize; |
105 | 104 |
106 // The debug marker is just above the frame pointer. | 105 // The debug marker is just above the frame pointer. |
107 static const int kDebugMarkOffset = -1 * kPointerSize; | 106 static const int kDebugMarkOffset = -1 * kPointerSize; |
108 | 107 |
109 static const int kSavedRegistersOffset = 0 * kPointerSize; | 108 static const int kSavedRegistersOffset = 0 * kPointerSize; |
110 | 109 |
111 // Let the parameters pointer for exit frames point just below the | 110 // Let the parameters pointer for exit frames point just below the |
112 // frame structure on the stack. | 111 // frame structure on the stack. |
113 static const int kPPDisplacement = 4 * kPointerSize; | 112 static const int kPPDisplacement = 3 * kPointerSize; |
114 | 113 |
115 // The caller fields are below the frame pointer on the stack. | 114 // The caller fields are below the frame pointer on the stack. |
116 static const int kCallerPPOffset = +0 * kPointerSize; | 115 static const int kCallerFPOffset = +0 * kPointerSize; |
117 static const int kCallerFPOffset = +1 * kPointerSize; | 116 static const int kCallerPPOffset = +1 * kPointerSize; |
118 static const int kCallerPCOffset = +3 * kPointerSize; | 117 static const int kCallerPCOffset = +2 * kPointerSize; |
119 }; | 118 }; |
120 | 119 |
121 | 120 |
122 class StandardFrameConstants : public AllStatic { | 121 class StandardFrameConstants : public AllStatic { |
123 public: | 122 public: |
124 static const int kExpressionsOffset = -4 * kPointerSize; | 123 static const int kExpressionsOffset = -3 * kPointerSize; |
125 static const int kCodeOffset = -3 * kPointerSize; | 124 static const int kMarkerOffset = -2 * kPointerSize; |
126 static const int kContextOffset = -2 * kPointerSize; | 125 static const int kContextOffset = -1 * kPointerSize; |
127 static const int kCallerPPOffset = 0 * kPointerSize; | 126 static const int kCallerFPOffset = 0 * kPointerSize; |
128 static const int kCallerFPOffset = +1 * kPointerSize; | 127 static const int kCallerPCOffset = +1 * kPointerSize; |
129 static const int kCallerPCOffset = +3 * kPointerSize; | 128 static const int kCallerSPOffset = +2 * kPointerSize; |
130 | |
131 // TODO(1233523): This is - of course - faked. The ARM port does not | |
132 // yet pass the callee function in a register, but the | |
133 // StackFrame::ComputeType code uses the field to figure out if a | |
134 // frame is a real JavaScript frame or an internal frame. | |
135 static const int kFunctionOffset = kContextOffset; | |
136 }; | 129 }; |
137 | 130 |
138 | 131 |
139 class JavaScriptFrameConstants : public AllStatic { | 132 class JavaScriptFrameConstants : public AllStatic { |
140 public: | 133 public: |
141 // FP-relative. | 134 // FP-relative. |
142 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; | 135 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; |
143 static const int kArgsLengthOffset = -1 * kPointerSize; | 136 static const int kSavedRegistersOffset = +2 * kPointerSize; |
144 // 0 * kPointerSize : StandardFrameConstants::kCallerPPOffset | 137 static const int kFunctionOffset = StandardFrameConstants::kMarkerOffset; |
145 // 1 * kPointersize : StandardFrameConstents::kCallerFPOffset | |
146 static const int kSPOnExitOffset = +2 * kPointerSize; | |
147 // 3 * kPointerSize : StandardFrameConstants::kCallerPCOffset | |
148 static const int kSavedRegistersOffset = +4 * kPointerSize; | |
149 | 138 |
150 // PP-relative. | 139 // PP-relative. |
151 static const int kParam0Offset = -2 * kPointerSize; | 140 static const int kParam0Offset = -2 * kPointerSize; |
152 static const int kReceiverOffset = -1 * kPointerSize; | 141 static const int kReceiverOffset = -1 * kPointerSize; |
153 static const int kFunctionOffset = 0 * kPointerSize; | 142 }; |
| 143 |
| 144 |
| 145 class ArgumentsAdaptorFrameConstants : public AllStatic { |
| 146 public: |
| 147 static const int kLengthOffset = StandardFrameConstants::kExpressionsOffset; |
154 }; | 148 }; |
155 | 149 |
156 | 150 |
157 class InternalFrameConstants : public AllStatic { | 151 class InternalFrameConstants : public AllStatic { |
158 public: | 152 public: |
159 static const int kCodeOffset = StandardFrameConstants::kCodeOffset; | 153 static const int kCodeOffset = StandardFrameConstants::kExpressionsOffset; |
160 }; | 154 }; |
161 | 155 |
162 | 156 |
163 inline Address StandardFrame::caller_pp() const { | |
164 return Memory::Address_at(fp() + StandardFrameConstants::kCallerPPOffset); | |
165 } | |
166 | |
167 | |
168 inline Object* JavaScriptFrame::function() const { | 157 inline Object* JavaScriptFrame::function() const { |
169 const int offset = JavaScriptFrameConstants::kFunctionOffset; | 158 const int offset = JavaScriptFrameConstants::kFunctionOffset; |
170 return Memory::Object_at(pp() + offset); | 159 Object* result = Memory::Object_at(fp() + offset); |
| 160 ASSERT(result->IsJSFunction()); |
| 161 return result; |
171 } | 162 } |
172 | 163 |
173 | 164 |
174 // ---------------------------------------------------- | 165 // ---------------------------------------------------- |
175 | 166 |
176 | 167 |
177 | 168 |
178 | 169 |
179 // lower | Stack | | 170 // lower | Stack | |
180 // addresses | ^ | | 171 // addresses | ^ | |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // | caller | | 372 // | caller | |
382 // | expressions | | 373 // | expressions | |
383 // | | | 374 // | | |
384 // higher | | | 375 // higher | | |
385 // addresses | JS frame | | 376 // addresses | JS frame | |
386 | 377 |
387 | 378 |
388 } } // namespace v8::internal | 379 } } // namespace v8::internal |
389 | 380 |
390 #endif // V8_FRAMES_ARM_H_ | 381 #endif // V8_FRAMES_ARM_H_ |
OLD | NEW |