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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 static const int kFrameSize = | 174 static const int kFrameSize = |
175 StandardFrameConstants::kFixedFrameSize + 5 * kPointerSize; | 175 StandardFrameConstants::kFixedFrameSize + 5 * kPointerSize; |
176 }; | 176 }; |
177 | 177 |
178 | 178 |
179 class InterpreterFrameConstants : public AllStatic { | 179 class InterpreterFrameConstants : public AllStatic { |
180 public: | 180 public: |
181 // Register file pointer relative. | 181 // Register file pointer relative. |
182 static const int kLastParamFromRegisterPointer = | 182 static const int kLastParamFromRegisterPointer = |
183 StandardFrameConstants::kFixedFrameSize + kPointerSize; | 183 StandardFrameConstants::kFixedFrameSize + 2 * kPointerSize; |
184 static const int kFunctionFromRegisterPointer = kPointerSize; | 184 static const int kNewTargetFromRegisterPointer = kPointerSize; |
185 static const int kContextFromRegisterPointer = 2 * kPointerSize; | 185 static const int kFunctionFromRegisterPointer = 2 * kPointerSize; |
| 186 static const int kContextFromRegisterPointer = 3 * kPointerSize; |
186 }; | 187 }; |
187 | 188 |
188 | 189 |
189 // Abstract base class for all stack frames. | 190 // Abstract base class for all stack frames. |
190 class StackFrame BASE_EMBEDDED { | 191 class StackFrame BASE_EMBEDDED { |
191 public: | 192 public: |
192 #define DECLARE_TYPE(type, ignore) type, | 193 #define DECLARE_TYPE(type, ignore) type, |
193 enum Type { | 194 enum Type { |
194 NONE = 0, | 195 NONE = 0, |
195 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) | 196 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // Debugger access. | 577 // Debugger access. |
577 void SetParameterValue(int index, Object* value) const; | 578 void SetParameterValue(int index, Object* value) const; |
578 | 579 |
579 // Check if this frame is a constructor frame invoked through 'new'. | 580 // Check if this frame is a constructor frame invoked through 'new'. |
580 bool IsConstructor() const; | 581 bool IsConstructor() const; |
581 | 582 |
582 // Determines whether this frame includes inlined activations. To get details | 583 // Determines whether this frame includes inlined activations. To get details |
583 // about the inlined frames use {GetFunctions} and {Summarize}. | 584 // about the inlined frames use {GetFunctions} and {Summarize}. |
584 bool HasInlinedFrames() const; | 585 bool HasInlinedFrames() const; |
585 | 586 |
586 // Returns the new target function that was used in the constructor call to | |
587 // this frame. Note that this is only valid on constructor frames. | |
588 Object* GetNewTarget() const; | |
589 | |
590 // Check if this frame has "adapted" arguments in the sense that the | 587 // Check if this frame has "adapted" arguments in the sense that the |
591 // actual passed arguments are available in an arguments adaptor | 588 // actual passed arguments are available in an arguments adaptor |
592 // frame below it on the stack. | 589 // frame below it on the stack. |
593 inline bool has_adapted_arguments() const; | 590 inline bool has_adapted_arguments() const; |
594 int GetArgumentsLength() const; | 591 int GetArgumentsLength() const; |
595 | 592 |
596 // Garbage collection support. | 593 // Garbage collection support. |
597 void Iterate(ObjectVisitor* v) const override; | 594 void Iterate(ObjectVisitor* v) const override; |
598 | 595 |
599 // Printing support. | 596 // Printing support. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 | 955 |
959 | 956 |
960 // Reads all frames on the current stack and copies them into the current | 957 // Reads all frames on the current stack and copies them into the current |
961 // zone memory. | 958 // zone memory. |
962 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 959 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
963 | 960 |
964 } // namespace internal | 961 } // namespace internal |
965 } // namespace v8 | 962 } // namespace v8 |
966 | 963 |
967 #endif // V8_FRAMES_H_ | 964 #endif // V8_FRAMES_H_ |
OLD | NEW |