Index: src/frames-inl.h |
diff --git a/src/frames-inl.h b/src/frames-inl.h |
index e6eaec0e0ce518591370193e2e5edcf35ee3176b..2962ce75bb2b9a957ef508b49dbdb103dd60f930 100644 |
--- a/src/frames-inl.h |
+++ b/src/frames-inl.h |
@@ -89,10 +89,20 @@ inline Address* StackHandler::pc_address() const { |
inline StackHandler* StackFrame::top_handler() const { |
+ ASSERT((tagged_isolate_ptr_ & kIsolateTag) == 0); |
return iterator_->handler(); |
} |
+inline Isolate* StackFrame::isolate() const { |
Vitaly Repeshko
2011/04/04 20:37:08
I'm not convinced we need this tricky stuff. Usual
mnaganov (inactive)
2011/04/05 08:28:23
I agree. I was in a premature optimization mood. S
|
+ if ((tagged_isolate_ptr_ & kIsolateTag) == 0) { |
+ return iterator_->isolate(); |
+ } else { |
+ return reinterpret_cast<Isolate*>(tagged_isolate_ptr_ & ~kIsolateTag); |
+ } |
+} |
+ |
+ |
inline Code* StackFrame::GetContainingCode(Isolate* isolate, Address pc) { |
return isolate->pc_to_code_cache()->GetCacheEntry(pc)->code; |
} |
@@ -168,6 +178,13 @@ inline Object* JavaScriptFrame::function() const { |
template<typename Iterator> |
+inline JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp( |
+ Isolate* isolate) |
+ : iterator_(isolate) { |
+ if (!done()) Advance(); |
+} |
+ |
+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 |
@@ -181,11 +198,9 @@ inline JavaScriptFrame* JavaScriptFrameIteratorTemp<Iterator>::frame() const { |
template<typename Iterator> |
JavaScriptFrameIteratorTemp<Iterator>::JavaScriptFrameIteratorTemp( |
- StackFrame::Id id) { |
- while (!done()) { |
- Advance(); |
- if (frame()->id() == id) return; |
- } |
+ Isolate* isolate, StackFrame::Id id) |
+ : iterator_(isolate) { |
+ AdvanceToId(id); |
} |
@@ -206,6 +221,15 @@ void JavaScriptFrameIteratorTemp<Iterator>::AdvanceToArgumentsFrame() { |
template<typename Iterator> |
+void JavaScriptFrameIteratorTemp<Iterator>::AdvanceToId(StackFrame::Id id) { |
+ while (!done()) { |
+ Advance(); |
+ if (frame()->id() == id) return; |
+ } |
+} |
+ |
+ |
+template<typename Iterator> |
void JavaScriptFrameIteratorTemp<Iterator>::Reset() { |
iterator_.Reset(); |
if (!done()) Advance(); |