OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FRAMES_H_ | 5 #ifndef V8_FRAMES_H_ |
6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 | 171 |
172 static const int kFrameSize = | 172 static const int kFrameSize = |
173 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; | 173 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; |
174 }; | 174 }; |
175 | 175 |
176 | 176 |
177 class InterpreterFrameConstants : public AllStatic { | 177 class InterpreterFrameConstants : public AllStatic { |
178 public: | 178 public: |
179 // Fixed frame includes new.target and bytecode offset. | 179 // Fixed frame includes new.target and bytecode offset. |
180 static const int kFixedFrameSize = | 180 static const int kFixedFrameSize = |
181 StandardFrameConstants::kFixedFrameSize + 2 * kPointerSize; | 181 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; |
182 static const int kFixedFrameSizeFromFp = | 182 static const int kFixedFrameSizeFromFp = |
183 StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kPointerSize; | 183 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; |
184 | 184 |
185 // FP-relative. | 185 // FP-relative. |
186 static const int kBytecodeOffsetFromFp = | 186 static const int kBytecodeOffsetFromFp = |
187 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; | 187 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; |
188 static const int kRegisterFilePointerFromFp = | 188 static const int kRegisterFilePointerFromFp = |
189 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; | 189 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; |
190 | 190 |
191 // Expression index for {StandardFrame::GetExpressionAddress}. | 191 // Expression index for {StandardFrame::GetExpressionAddress}. |
192 static const int kBytecodeOffsetExpressionIndex = 1; | 192 static const int kBytecodeOffsetExpressionIndex = 2; |
193 static const int kRegisterFileExpressionIndex = 2; | 193 static const int kRegisterFileExpressionIndex = 3; |
194 | 194 |
195 // Register file pointer relative. | 195 // Register file pointer relative. |
196 static const int kLastParamFromRegisterPointer = | 196 static const int kLastParamFromRegisterPointer = |
197 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; | 197 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; |
198 | 198 |
199 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; | 199 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; |
200 static const int kNewTargetFromRegisterPointer = 2 * kPointerSize; | 200 static const int kDispatchTableFromRegisterPointer = 2 * kPointerSize; |
201 static const int kFunctionFromRegisterPointer = 3 * kPointerSize; | 201 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize; |
202 static const int kContextFromRegisterPointer = 4 * kPointerSize; | 202 static const int kFunctionFromRegisterPointer = 4 * kPointerSize; |
203 static const int kContextFromRegisterPointer = 5 * kPointerSize; | |
Yang
2016/02/10 12:37:46
Can you introduce a convenience method to read and
rmcilroy
2016/02/11 09:00:50
Done.
| |
203 }; | 204 }; |
204 | 205 |
205 | 206 |
206 // Abstract base class for all stack frames. | 207 // Abstract base class for all stack frames. |
207 class StackFrame BASE_EMBEDDED { | 208 class StackFrame BASE_EMBEDDED { |
208 public: | 209 public: |
209 #define DECLARE_TYPE(type, ignore) type, | 210 #define DECLARE_TYPE(type, ignore) type, |
210 enum Type { | 211 enum Type { |
211 NONE = 0, | 212 NONE = 0, |
212 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) | 213 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
992 | 993 |
993 | 994 |
994 // Reads all frames on the current stack and copies them into the current | 995 // Reads all frames on the current stack and copies them into the current |
995 // zone memory. | 996 // zone memory. |
996 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 997 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
997 | 998 |
998 } // namespace internal | 999 } // namespace internal |
999 } // namespace v8 | 1000 } // namespace v8 |
1000 | 1001 |
1001 #endif // V8_FRAMES_H_ | 1002 #endif // V8_FRAMES_H_ |
OLD | NEW |