Fix call stack sampling for the case when native callback invokes JS function
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 23 Jul 2013 15:01:38 +0000 (15:01 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 23 Jul 2013 15:01:38 +0000 (15:01 +0000)
commit97f8f91bb5ef29844288305a8373d3de296a95fe
tree2ed4aef6fa5945469d54c380c106d5e41727311b
parentf48a8d1ca420d450010e894a6b855f5d7c549a03
Fix call stack sampling for the case when native callback invokes JS function

The SafeStackFrameIterator used by CPU profiler checked if Isolate::c_entry_fp is null and if it is not it would think that the control flow currently is in some native code. This assumption is wrong because the native code could have called a JS function but JSEntryStub would not reset c_entry_fp to NULL in that case. This CL adds a check in SafeStackFrameIterator::IsValidTop for the case when there is a JAVA_SCRIPT frame on top of EXIT frame.

Also this CL changes ExternalCallbackScope behavior to provide access to the whole stack of the scope objects instead of only top one. This allowed to provide exact callback names for those EXIT frames where external callbacks are called. Without this change it was possible only for the top most native call.

BUG=None
R=loislo@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/19775017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/frames-inl.h
src/frames.cc
src/frames.h
src/isolate.cc
src/isolate.h
src/profile-generator.cc
src/sampler.cc
src/vm-state-inl.h
src/vm-state.h
test/cctest/test-api.cc
test/cctest/test-cpu-profiler.cc