Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index edd5ddde400ffff23572c9f38f032eba66ef6a91..0ca6991488464994be3300cf56e1ec47978036a4 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -43,8 +43,19 @@ namespace v8 { |
namespace internal { |
-ReturnAddressLocationResolver |
- StackFrame::return_address_location_resolver_ = NULL; |
+static ReturnAddressLocationResolver return_address_location_resolver = NULL; |
+ |
+ |
+// Resolves pc_address through the resolution address function if one is set. |
+static inline Address* ResolveReturnAddressLocation(Address* pc_address) { |
+ if (return_address_location_resolver == NULL) { |
+ return pc_address; |
+ } else { |
+ return reinterpret_cast<Address*>( |
+ return_address_location_resolver( |
+ reinterpret_cast<uintptr_t>(pc_address))); |
+ } |
+} |
// Iterator that supports traversing the stack handlers of a |
@@ -228,7 +239,7 @@ SafeStackFrameIterator::SafeStackFrameIterator( |
ASSERT(fp != NULL); |
state.fp = fp; |
state.sp = sp; |
- state.pc_address = StackFrame::ResolveReturnAddressLocation( |
+ state.pc_address = ResolveReturnAddressLocation( |
reinterpret_cast<Address*>(StandardFrame::ComputePCAddress(fp))); |
type = StackFrame::ComputeType(this, &state); |
} else { |
@@ -378,8 +389,8 @@ void StackFrame::IteratePc(ObjectVisitor* v, |
void StackFrame::SetReturnAddressLocationResolver( |
ReturnAddressLocationResolver resolver) { |
- ASSERT(return_address_location_resolver_ == NULL); |
- return_address_location_resolver_ = resolver; |
+ ASSERT(return_address_location_resolver == NULL); |
+ return_address_location_resolver = resolver; |
} |