| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 + 3 * kPointerSize; | 181 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; |
| 182 static const int kFixedFrameSizeFromFp = | 182 static const int kFixedFrameSizeFromFp = |
| 183 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; | 183 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; |
| 184 | 184 |
| 185 // FP-relative. | 185 // FP-relative. |
| 186 static const int kNewTargetFromFp = | 186 static const int kNewTargetFromFp = |
| 187 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; | 187 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; |
| 188 static const int kDispatchTableFromFp = | 188 static const int kBytecodeArrayFromFp = |
| 189 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; | 189 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; |
| 190 static const int kBytecodeOffsetFromFp = | 190 static const int kBytecodeOffsetFromFp = |
| 191 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; | 191 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; |
| 192 static const int kRegisterFilePointerFromFp = | 192 static const int kRegisterFilePointerFromFp = |
| 193 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; | 193 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; |
| 194 | 194 |
| 195 // Expression index for {StandardFrame::GetExpressionAddress}. | 195 // Expression index for {StandardFrame::GetExpressionAddress}. |
| 196 static const int kBytecodeArrayExpressionIndex = 1; |
| 196 static const int kBytecodeOffsetExpressionIndex = 2; | 197 static const int kBytecodeOffsetExpressionIndex = 2; |
| 197 static const int kRegisterFileExpressionIndex = 3; | 198 static const int kRegisterFileExpressionIndex = 3; |
| 198 | 199 |
| 199 // Register file pointer relative. | 200 // Register file pointer relative. |
| 200 static const int kLastParamFromRegisterPointer = | 201 static const int kLastParamFromRegisterPointer = |
| 201 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; | 202 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; |
| 202 | 203 |
| 203 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; | 204 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; |
| 204 static const int kDispatchTableFromRegisterPointer = 2 * kPointerSize; | 205 static const int kBytecodeArrayFromRegisterPointer = 2 * kPointerSize; |
| 205 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize; | 206 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize; |
| 206 static const int kFunctionFromRegisterPointer = 4 * kPointerSize; | 207 static const int kFunctionFromRegisterPointer = 4 * kPointerSize; |
| 207 static const int kContextFromRegisterPointer = 5 * kPointerSize; | 208 static const int kContextFromRegisterPointer = 5 * kPointerSize; |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 | 211 |
| 211 // Abstract base class for all stack frames. | 212 // Abstract base class for all stack frames. |
| 212 class StackFrame BASE_EMBEDDED { | 213 class StackFrame BASE_EMBEDDED { |
| 213 public: | 214 public: |
| 214 #define DECLARE_TYPE(type, ignore) type, | 215 #define DECLARE_TYPE(type, ignore) type, |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 friend class StackFrameIteratorBase; | 722 friend class StackFrameIteratorBase; |
| 722 | 723 |
| 723 Object* StackSlotAt(int index) const; | 724 Object* StackSlotAt(int index) const; |
| 724 }; | 725 }; |
| 725 | 726 |
| 726 | 727 |
| 727 class InterpretedFrame : public JavaScriptFrame { | 728 class InterpretedFrame : public JavaScriptFrame { |
| 728 public: | 729 public: |
| 729 Type type() const override { return INTERPRETED; } | 730 Type type() const override { return INTERPRETED; } |
| 730 | 731 |
| 731 // GC support. | |
| 732 void Iterate(ObjectVisitor* v) const override; | |
| 733 | |
| 734 // Lookup exception handler for current {pc}, returns -1 if none found. | 732 // Lookup exception handler for current {pc}, returns -1 if none found. |
| 735 int LookupExceptionHandlerInTable( | 733 int LookupExceptionHandlerInTable( |
| 736 int* data, HandlerTable::CatchPrediction* prediction) override; | 734 int* data, HandlerTable::CatchPrediction* prediction) override; |
| 737 | 735 |
| 738 // Returns the current offset into the bytecode stream. | 736 // Returns the current offset into the bytecode stream. |
| 739 int GetBytecodeOffset() const; | 737 int GetBytecodeOffset() const; |
| 740 | 738 |
| 741 // Updates the current offset into the bytecode stream, mainly used for stack | 739 // Updates the current offset into the bytecode stream, mainly used for stack |
| 742 // unwinding to continue execution at a different bytecode offset. | 740 // unwinding to continue execution at a different bytecode offset. |
| 743 void PatchBytecodeOffset(int new_offset); | 741 void PatchBytecodeOffset(int new_offset); |
| 744 | 742 |
| 745 // Returns the current dispatch table pointer. | 743 // Returns the frame's current bytecode array. |
| 746 Address GetDispatchTable() const; | 744 Object* GetBytecodeArray() const; |
| 747 | 745 |
| 748 // Updates the current dispatch table pointer with |dispatch_table|. Used by | 746 // Updates the frame's BytecodeArray with |bytecode_array|. Used by the |
| 749 // the debugger to swap execution onto the debugger dispatch table. | 747 // debugger to swap execution onto a BytecodeArray patched with breakpoints. |
| 750 void PatchDispatchTable(Address dispatch_table); | 748 void PatchBytecodeArray(Object* bytecode_array); |
| 751 | 749 |
| 752 // Access to the interpreter register file for this frame. | 750 // Access to the interpreter register file for this frame. |
| 753 Object* GetInterpreterRegister(int register_index) const; | 751 Object* GetInterpreterRegister(int register_index) const; |
| 754 | 752 |
| 755 // Build a list with summaries for this frame including all inlined frames. | 753 // Build a list with summaries for this frame including all inlined frames. |
| 756 void Summarize(List<FrameSummary>* frames) override; | 754 void Summarize(List<FrameSummary>* frames) override; |
| 757 | 755 |
| 758 protected: | 756 protected: |
| 759 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); | 757 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); |
| 760 | 758 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 | 1005 |
| 1008 | 1006 |
| 1009 // Reads all frames on the current stack and copies them into the current | 1007 // Reads all frames on the current stack and copies them into the current |
| 1010 // zone memory. | 1008 // zone memory. |
| 1011 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1009 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 1012 | 1010 |
| 1013 } // namespace internal | 1011 } // namespace internal |
| 1014 } // namespace v8 | 1012 } // namespace v8 |
| 1015 | 1013 |
| 1016 #endif // V8_FRAMES_H_ | 1014 #endif // V8_FRAMES_H_ |
| OLD | NEW |