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

Unified Diff: src/frames.h

Issue 16917004: Simplify stack iterators implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use iterator_.frame() instead of frame() to avoid assertion failure Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.h
diff --git a/src/frames.h b/src/frames.h
index f09c24a3fbf43198d75bf07e75cfeed70e6c63e6..53668d09d98e9a89f1f01a6f6ea73184a45e0bf8 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -797,10 +797,10 @@ class StackFrameIterator BASE_EMBEDDED {
bool done() const { return frame_ == NULL; }
void Advance() { (this->*advance_)(); }
+ private:
// Go back to the first frame.
void Reset();
- private:
Isolate* isolate_;
#define DECLARE_SINGLETON(ignore, type) type type##_;
STACK_FRAME_TYPE_LIST(DECLARE_SINGLETON)
@@ -832,34 +832,12 @@ class StackFrameIterator BASE_EMBEDDED {
// Iterator that supports iterating through all JavaScript frames.
-template<typename Iterator>
-class JavaScriptFrameIteratorTemp BASE_EMBEDDED {
+class JavaScriptFrameIterator BASE_EMBEDDED {
public:
- inline explicit JavaScriptFrameIteratorTemp(Isolate* isolate);
-
- inline JavaScriptFrameIteratorTemp(Isolate* isolate, ThreadLocalTop* top);
-
+ inline explicit JavaScriptFrameIterator(Isolate* isolate);
+ inline JavaScriptFrameIterator(Isolate* isolate, ThreadLocalTop* top);
// Skip frames until the frame with the given id is reached.
- explicit JavaScriptFrameIteratorTemp(StackFrame::Id id) { AdvanceToId(id); }
-
- inline JavaScriptFrameIteratorTemp(Isolate* isolate, StackFrame::Id id);
-
- JavaScriptFrameIteratorTemp(Address fp,
- Address sp,
- Address low_bound,
- Address high_bound) :
- iterator_(fp, sp, low_bound, high_bound) {
- if (!done()) Advance();
- }
-
- JavaScriptFrameIteratorTemp(Isolate* isolate,
- Address fp,
- Address sp,
- Address low_bound,
- Address high_bound) :
- iterator_(isolate, fp, sp, low_bound, high_bound) {
- if (!done()) Advance();
- }
+ JavaScriptFrameIterator(Isolate* isolate, StackFrame::Id id);
inline JavaScriptFrame* frame() const;
@@ -871,19 +849,11 @@ class JavaScriptFrameIteratorTemp BASE_EMBEDDED {
// arguments.
void AdvanceToArgumentsFrame();
- // Go back to the first frame.
- void Reset();
-
private:
- inline void AdvanceToId(StackFrame::Id id);
-
- Iterator iterator_;
+ StackFrameIterator iterator_;
};
-typedef JavaScriptFrameIteratorTemp<StackFrameIterator> JavaScriptFrameIterator;
-
-
// NOTE: The stack trace frame iterator is an iterator that only
// traverse proper JavaScript frames; that is JavaScript frames that
// have proper JavaScript functions. This excludes the problematic
@@ -913,7 +883,6 @@ class SafeStackFrameIterator BASE_EMBEDDED {
bool done() const { return iteration_done_ ? true : iterator_.done(); }
void Advance();
- void Reset();
static bool is_active(Isolate* isolate);
@@ -978,16 +947,21 @@ class SafeStackFrameIterator BASE_EMBEDDED {
};
-typedef JavaScriptFrameIteratorTemp<SafeStackFrameIterator>
- SafeJavaScriptFrameIterator;
+class SafeStackTraceFrameIterator BASE_EMBEDDED {
+ public:
+ SafeStackTraceFrameIterator(Isolate* isolate,
+ Address fp,
+ Address sp,
+ Address low_bound,
+ Address high_bound);
+ inline JavaScriptFrame* frame() const;
-class SafeStackTraceFrameIterator: public SafeJavaScriptFrameIterator {
- public:
- explicit SafeStackTraceFrameIterator(Isolate* isolate,
- Address fp, Address sp,
- Address low_bound, Address high_bound);
+ bool done() const { return iterator_.done(); }
void Advance();
+
+ private:
+ SafeStackFrameIterator iterator_;
};
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698