CPU profiler: add secure profiles by filtering out functions using security tokens.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 18 May 2010 14:19:33 +0000 (14:19 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 18 May 2010 14:19:33 +0000 (14:19 +0000)
commit3d7ce8ac19d3256d12f211afb636bc60f6e0c122
tree88e21a0450c23a1f651d5a465ef23fe4b51e9862
parent73b2fc29b7dc9f36ba7f05d0fe92b169c8f98556
CPU profiler: add secure profiles by filtering out functions using security tokens.

As several pages can run in a single V8 instance, it is possible to
have functions from different security contexts intermixed in a single
CPU profile.  To avoid exposing function names from one page to
another, filtering is introduced.

The basic idea is that instead of capturing return addresses from
stack, we're now capturing JSFunction addresses (as we anyway work
only with JS stack frames.)  Each JSFunction can reach out for
context's security token. When providing a profile to a page, the
profile is filtered using the security token of caller page. Any
functions with different security tokens are filtered out (yes, we
only do fast path check for now) and their ticks are attributed to
their parents.

Review URL: http://codereview.chromium.org/2083005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
12 files changed:
include/v8-profiler.h
src/api.cc
src/cpu-profiler-inl.h
src/cpu-profiler.cc
src/cpu-profiler.h
src/log.cc
src/profile-generator-inl.h
src/profile-generator.cc
src/profile-generator.h
test/cctest/test-cpu-profiler.cc
test/cctest/test-log-stack-tracer.cc
test/cctest/test-profile-generator.cc