Index: src/frames-inl.h |
diff --git a/src/frames-inl.h b/src/frames-inl.h |
index b34a0abb15c6d95cdb21a12baffa608af97c33e6..c9d3ab6b461ff00abd8e5fbc27d44f43e8f203b9 100644 |
--- a/src/frames-inl.h |
+++ b/src/frames-inl.h |
@@ -169,7 +169,8 @@ inline bool JavaScriptFrame::has_adapted_arguments() const { |
} |
-inline JavaScriptFrame* JavaScriptFrameIterator::frame() const { |
+template<typename Iterator> |
+inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { |
// TODO(1233797): The frame hierarchy needs to change. It's |
// problematic that we can't use the safe-cast operator to cast to |
// the JavaScript frame type, because we may encounter arguments |
@@ -180,6 +181,39 @@ inline JavaScriptFrame* JavaScriptFrameIterator::frame() const { |
} |
+template<typename Iterator> |
+JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp( |
+ StackFrame::Id id) { |
+ while (!done()) { |
+ Advance(); |
+ if (frame()->id() == id) return; |
+ } |
+} |
+ |
+ |
+template<typename Iterator> |
+void JavaScriptFrameIteratorTemp<Iterator>::Advance() { |
+ do { |
+ iterator_.Advance(); |
+ } while (!iterator_.done() && !iterator_.frame()->is_java_script()); |
+} |
+ |
+ |
+template<typename Iterator> |
+void JavaScriptFrameIteratorTemp<Iterator>::AdvanceToArgumentsFrame() { |
+ if (!frame()->has_adapted_arguments()) return; |
+ iterator_.Advance(); |
+ ASSERT(iterator_.frame()->is_arguments_adaptor()); |
+} |
+ |
+ |
+template<typename Iterator> |
+void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
+ iterator_.Reset(); |
+ if (!done()) Advance(); |
+} |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_FRAMES_INL_H_ |