Correctly report stack trace when current function is FunctionApply builtin
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 3 Jul 2013 14:04:37 +0000 (14:04 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 3 Jul 2013 14:04:37 +0000 (14:04 +0000)
commit559e1d45402d5d904629a8163e6f618f225744ef
tree445c04e4ff6c0a161f2cadecf3e592b374b0d34a
parent2c942ea6ff98202fe82e869dc56e57d055a7941c
Correctly report stack trace when current function is FunctionApply builtin

When pc is inside FunctionApply builtin function the top frame may be either
2) Internal stack frame created by FunctionApply itself.
In this case we know its caller's pc and can correctly resolve calling function.
1) Frame of the calling JavaScript function that invoked .apply(). In this case we have no practical reliable way to find out the caller's pc so we mark the caller's frame as 'unresolved'.

All this logic is implemented in ProfileGenerator. SafeStackFrameIterator is extended to provide type of the current top stack frame (iteration actually starts from the caller's frame as we know top function from pc).

BUG=252097
R=jkummerow@chromium.org, loislo@chromium.org

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

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