| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_STACK_FRAME_H_ | 5 #ifndef VM_STACK_FRAME_H_ |
| 6 #define VM_STACK_FRAME_H_ | 6 #define VM_STACK_FRAME_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/stub_code.h" | 10 #include "vm/stub_code.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 // Forward declarations. | 14 // Forward declarations. |
| 15 class ObjectPointerVisitor; | 15 class ObjectPointerVisitor; |
| 16 class RawContext; |
| 16 | 17 |
| 17 | 18 |
| 18 // Generic stack frame. | 19 // Generic stack frame. |
| 19 class StackFrame : public ValueObject { | 20 class StackFrame : public ValueObject { |
| 20 public: | 21 public: |
| 21 virtual ~StackFrame() { } | 22 virtual ~StackFrame() { } |
| 22 | 23 |
| 23 // Accessors to get the pc, sp and fp of a frame. | 24 // Accessors to get the pc, sp and fp of a frame. |
| 24 uword sp() const { return sp_; } | 25 uword sp() const { return sp_; } |
| 25 uword fp() const { return fp_; } | 26 uword fp() const { return fp_; } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 // Entry Frame is used to mark the transition from dart VM runtime code into | 113 // Entry Frame is used to mark the transition from dart VM runtime code into |
| 113 // dart code. | 114 // dart code. |
| 114 class EntryFrame : public StackFrame { | 115 class EntryFrame : public StackFrame { |
| 115 public: | 116 public: |
| 116 bool IsValid() const { return StubCode::InInvocationStub(pc()); } | 117 bool IsValid() const { return StubCode::InInvocationStub(pc()); } |
| 117 bool IsDartFrame() const { return false; } | 118 bool IsDartFrame() const { return false; } |
| 118 bool IsStubFrame() const { return false; } | 119 bool IsStubFrame() const { return false; } |
| 119 bool IsEntryFrame() const { return true; } | 120 bool IsEntryFrame() const { return true; } |
| 120 | 121 |
| 122 RawContext* SavedContext() const; |
| 123 |
| 121 // Visit objects in the frame. | 124 // Visit objects in the frame. |
| 122 virtual void VisitObjectPointers(ObjectPointerVisitor* visitor); | 125 virtual void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 123 | 126 |
| 124 protected: | 127 protected: |
| 125 virtual const char* GetName() const { return "entry"; } | 128 virtual const char* GetName() const { return "entry"; } |
| 126 | 129 |
| 127 private: | 130 private: |
| 128 EntryFrame() { } | 131 EntryFrame() { } |
| 129 intptr_t ExitLinkOffset(); | 132 intptr_t ExitLinkOffset() const; |
| 133 intptr_t SavedContextOffset() const; |
| 130 | 134 |
| 131 friend class StackFrameIterator; | 135 friend class StackFrameIterator; |
| 132 DISALLOW_COPY_AND_ASSIGN(EntryFrame); | 136 DISALLOW_COPY_AND_ASSIGN(EntryFrame); |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 | 139 |
| 136 // Iterator for iterating over all frames from the last ExitFrame to the | 140 // Iterator for iterating over all frames from the last ExitFrame to the |
| 137 // first EntryFrame. | 141 // first EntryFrame. |
| 138 class StackFrameIterator : public ValueObject { | 142 class StackFrameIterator : public ValueObject { |
| 139 public: | 143 public: |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 uword pc_; | 264 uword pc_; |
| 261 GrowableArray<DeoptInstr*> deopt_instructions_; | 265 GrowableArray<DeoptInstr*> deopt_instructions_; |
| 262 Array& object_table_; | 266 Array& object_table_; |
| 263 | 267 |
| 264 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator); | 268 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator); |
| 265 }; | 269 }; |
| 266 | 270 |
| 267 } // namespace dart | 271 } // namespace dart |
| 268 | 272 |
| 269 #endif // VM_STACK_FRAME_H_ | 273 #endif // VM_STACK_FRAME_H_ |
| OLD | NEW |