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

Unified Diff: src/frames.cc

Issue 17579005: Merge SafeStackTraceFrameIterator into SafeStackFrameIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 5ea0fd84ca3eac49fe61cb92aeefb0dae972a066..3cf02f4007c076799324137d80406a3268ffefe3 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -291,6 +291,7 @@ SafeStackFrameIterator::SafeStackFrameIterator(
is_valid_fp_(IsWithinBounds(low_bound, high_bound, fp)),
iteration_done_(!is_valid_top_ && !is_valid_fp_),
iterator_(isolate, is_valid_top_, is_valid_fp_ ? fp : NULL, sp) {
+ if (!done()) Advance();
}
bool SafeStackFrameIterator::is_active(Isolate* isolate) {
@@ -308,7 +309,7 @@ bool SafeStackFrameIterator::IsValidTop(Isolate* isolate,
}
-void SafeStackFrameIterator::Advance() {
+void SafeStackFrameIterator::AdvanceOneFrame() {
ASSERT(!done());
StackFrame* last_frame = iterator_.frame();
Address last_sp = last_frame->sp(), last_fp = last_frame->fp();
@@ -366,26 +367,18 @@ bool SafeStackFrameIterator::IsValidCaller(StackFrame* frame) {
}
-// -------------------------------------------------------------------------
-
-
-SafeStackTraceFrameIterator::SafeStackTraceFrameIterator(
- Isolate* isolate,
- Address fp, Address sp, Address low_bound, Address high_bound)
- : iterator_(isolate, fp, sp, low_bound, high_bound) {
- if (!done()) Advance();
-}
-
-
-void SafeStackTraceFrameIterator::Advance() {
+void SafeStackFrameIterator::Advance() {
while (true) {
- iterator_.Advance();
- if (iterator_.done()) return;
+ AdvanceOneFrame();
+ if (done()) return;
if (iterator_.frame()->is_java_script()) return;
}
}
+// -------------------------------------------------------------------------
+
+
Code* StackFrame::GetSafepointData(Isolate* isolate,
Address inner_pointer,
SafepointEntry* safepoint_entry,
« no previous file with comments | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698