Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1447)

Side by Side Diff: runtime/vm/stack_frame.h

Issue 10827049: Allow creating DartFrameIterator using explicit last_fp value (instead of always expecting it from … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/stack_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 132
133 // Iterator for iterating over all frames from the last ExitFrame to the 133 // Iterator for iterating over all frames from the last ExitFrame to the
134 // first EntryFrame. 134 // first EntryFrame.
135 class StackFrameIterator : public ValueObject { 135 class StackFrameIterator : public ValueObject {
136 public: 136 public:
137 static const bool kValidateFrames = true; 137 static const bool kValidateFrames = true;
138 static const bool kDontValidateFrames = false; 138 static const bool kDontValidateFrames = false;
139 139
140 explicit StackFrameIterator(bool validate); 140 explicit StackFrameIterator(bool validate);
141 StackFrameIterator(uword last_fp, bool validate);
141 142
142 // Checks if a next frame exists. 143 // Checks if a next frame exists.
143 bool HasNextFrame() const { return frames_.fp_ != 0; } 144 bool HasNextFrame() const { return frames_.fp_ != 0; }
144 145
145 // Get next frame. 146 // Get next frame.
146 StackFrame* NextFrame(); 147 StackFrame* NextFrame();
147 148
148 private: 149 private:
149 // Iterator for iterating over the set of frames (dart or stub) which exist 150 // Iterator for iterating over the set of frames (dart or stub) which exist
150 // in one EntryFrame and ExitFrame block. 151 // in one EntryFrame and ExitFrame block.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 198
198 DISALLOW_COPY_AND_ASSIGN(StackFrameIterator); 199 DISALLOW_COPY_AND_ASSIGN(StackFrameIterator);
199 }; 200 };
200 201
201 202
202 // Iterator for iterating over all dart frames (skips over exit frames, 203 // Iterator for iterating over all dart frames (skips over exit frames,
203 // entry frames and stub frames). 204 // entry frames and stub frames).
204 class DartFrameIterator : public ValueObject { 205 class DartFrameIterator : public ValueObject {
205 public: 206 public:
206 DartFrameIterator() : frames_(StackFrameIterator::kDontValidateFrames) { } 207 DartFrameIterator() : frames_(StackFrameIterator::kDontValidateFrames) { }
207 208 explicit DartFrameIterator(uword last_fp)
209 : frames_(last_fp, StackFrameIterator::kDontValidateFrames) {}
208 // Get next dart frame. 210 // Get next dart frame.
209 StackFrame* NextFrame() { 211 StackFrame* NextFrame() {
210 StackFrame* frame = frames_.NextFrame(); 212 StackFrame* frame = frames_.NextFrame();
211 while (frame != NULL && !frame->IsDartFrame()) { 213 while (frame != NULL && !frame->IsDartFrame()) {
212 frame = frames_.NextFrame(); 214 frame = frames_.NextFrame();
213 } 215 }
214 return frame; 216 return frame;
215 } 217 }
216 218
217 private: 219 private:
218 StackFrameIterator frames_; 220 StackFrameIterator frames_;
219 221
220 DISALLOW_COPY_AND_ASSIGN(DartFrameIterator); 222 DISALLOW_COPY_AND_ASSIGN(DartFrameIterator);
221 }; 223 };
222 224
223 } // namespace dart 225 } // namespace dart
224 226
225 #endif // VM_STACK_FRAME_H_ 227 #endif // VM_STACK_FRAME_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698