Commit Graph

78 Commits

Author SHA1 Message Date
yurys@chromium.org
0ac0edb707 Test that profiler is stopped when isolate is being disposed
The only way to get v8::CpuProfiler instance in the V8 public API is to call v8::Iolate::GetCpuProfiler(). The method will return NULL if the isolate has not been initialized yet or has been torn down already. It is the client's reponsibility to make sure that CPU profiling has been stopped before disposing of the isolate.

This CL adds a test for this and several ASSRTS enforcing that assumptions. This allowed to be sure that heap is always setup when CPU profiling is being started. Based on that the number of places where already compiled functions are reported to the profiler event processor boils down to the single place (CpuProfiler::StartProcessorIfNotStarted). I'm going to rely on this assumption in further changes.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 12:32:52 +00:00
bmeurer@chromium.org
d7618796f6 No need to pass profiles to ProfilerEventsProcessor.
Following up on https://codereview.chromium.org/18353002, there's
no need to pass the profiles to ProfilerEventsProcessor's constructor.

BUG=
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 12:24:26 +00:00
loislo@chromium.org
ca90f4b058 CpuProfiler: eliminate 2 layers of 4 for CodeCreateEvent calls.
The bodies of methods in ProfilerEventProcessor were moved into CpuProfiler.
Multiple NewCodeEntry methods in CpuProfilesCollection were replaced with one which
simply passes arguments to the CodeEntry constructor.
And CpuProfiler just calls this method when it needs a CodeEntry object.

This NewCodeEntry method is required because CpuProfilesCollection keeps ownership of CodeEntry objects.

BUG=255392
TEST=existing tests
R=yangguo@chromium.org, yurys@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=15405

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 10:12:03 +00:00
loislo@chromium.org
baa3a7e47b Revert "CpuProfiler: eliminate 2 layers of 4 for CodeCreateEvent calls."
This reverts commit 76adf84b83ec3c0b261cbc29369ce4ac83f9d002.

windows compilation failed

BUG=none
TBR=yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 09:51:44 +00:00
loislo@chromium.org
eb14637367 CpuProfiler: eliminate 2 layers of 4 for CodeCreateEvent calls.
The bodies of methods in ProfilerEventProcessor were moved into CpuProfiler.
Multiple NewCodeEntry methods in CpuProfilesCollection were replaced with one which
simply passes arguments to the CodeEntry constructor.
And CpuProfiler just calls this method when it needs a CodeEntry object.

This NewCodeEntry method is required because CpuProfilesCollection keeps ownership of CodeEntry objects.

BUG=255392
TEST=existing tests
R=yangguo@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 09:39:15 +00:00
yurys@chromium.org
4aeccdb23e Do not iterate stack handlers in SafeStackFrameIterator
CPU profiler doesn't use stack handlers so there is no need to iterate through them while traversing stack. This change SafeStackFrameIterator always iterate only frames and removes checks corresponding to the handlers iteration.

The problem described in the bug occurred because of a false assumption in SafeStackFrameIterator that if Isolate::c_entry_fp is not NULL then the top frame on the stack is always a C++ frame. It is false because we may have entered JS code again, in which case JS_ENTRY code stub generated by JSEntryStub::GenerateBody() will save current c_entry_fp value but not reset it to NULL and after that it will create ENTRY stack frame and JS_ENTRY handler on the stack and put the latter into Isolate::handler(top). This means that if we start iterating from c_entry_fp frame and try to compare the frame's sp with Isolate::handler()->address() it will turn out that frame->sp() > handler->address() and the condition in SafeStackFrameIterator::CanIterateHandles is not held.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-27 09:28:11 +00:00
yurys@chromium.org
c4224f09a2 Notify CPU profiler when calling native getters
This change modifies code produced by BaseLoadStubCompiler::GenerateLoadCallback so that instead of calling AccessorGetter direcly it calls InvokeAccessorGetter which changes VM state and calls the actual callback. This way CPU profiler knows which external callback is being executed in this case. Indirect call happens only if CpuProfiler::is_profiling() is true.

This is exactly same change as r15116 with a build fix for test-api.cc

BUG=244580
TBR=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-13 19:16:35 +00:00
yurys@chromium.org
24ec017182 Revert "Notify CPU profiler when calling native getters"
This reverts commit f323d984a73bab345c4eab5c1907552ccfa7ccaa.

Broke compilation on the bots with an error that doesn't occur locally:

  CXX(target) /mnt/data/b/build/slave/v8-linux-debug/build/v8/out/Debug/obj.target/cctest/test/cctest/test-bignum-dtoa.o
../test/cctest/test-api.cc: In function ‘void FastReturnValueCallback(const v8::FunctionCallbackInfo<v8::Value>&) [with T = int]’:
../test/cctest/test-api.cc:1129: error: insufficient contextual information to determine type
../test/cctest/test-api.cc: In function ‘void FastReturnValueCallback(const v8::FunctionCallbackInfo<v8::Value>&) [with T = unsigned int]’:
../test/cctest/test-api.cc:1136: error: insufficient contextual information to determine type
../test/cctest/test-api.cc: In function ‘void FastReturnValueCallback(const v8::FunctionCallbackInfo<v8::Value>&) [with T = double]’:
../test/cctest/test-api.cc:1143: error: insufficient contextual information to determine type
../test/cctest/test-api.cc: In function ‘void FastReturnValueCallback(const v8::FunctionCallbackInfo<v8::Value>&) [with T = bool]’:
../test/cctest/test-api.cc:1150: error: insufficient contextual information to determine type
../test/cctest/test-api.cc: In function ‘void FastReturnValueCallback(const v8::FunctionCallbackInfo<v8::Value>&) [with T = void]’:
../test/cctest/test-api.cc:1157: error: insufficient contextual information to determine type
  CXX(target) /mnt/data/b/build/slave/v8-linux-debug/build/v8/out/Debug/obj.target/cctest/test/cctest/test-circular-queue.o

BUG=None
TBR=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-13 14:05:19 +00:00
yurys@chromium.org
1a3c3cee9d Notify CPU profiler when calling native getters
This change modifies code produced by BaseLoadStubCompiler::GenerateLoadCallback so that instead of calling AccessorGetter direcly it calls InvokeAccessorGetter which changes VM state and calls the actual callback. This way CPU profiler knows which external callback is being executed in this case.

BUG=244580
R=dcarney@chromium.org, loislo@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-13 13:46:33 +00:00
loislo@chromium.org
2f811dbb99 Revert "DevTools: CPUProfiler: provide url for scripts that have sourceURL property."
This reverts commit d95b7bb92ad1a191cf505250830d094b86d61e8f.
This reverts commit ca81c09a367600be79452e1fc53ac63b75e369c4.

record-cpu-profile.html is crashing

TBR= yurys@chromium.org, danno@chromium.org
BUG=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15114 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-13 11:09:19 +00:00
loislo@chromium.org
3be6a032d0 two cpu profiler tests are flaky on windows.
BUG=none
TEST=LogExistingFunctionSourceURLCheck, SourceURLSupportForNewFunctions
TBR=yurys

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15088 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-12 14:34:19 +00:00
loislo@chromium.org
29abaf4aad DevTools: CPUProfiler: provide url for scripts that have sourceURL property.
BUG=none
TEST=SourceURLSupportForNewFunctions, LogExistingFunctionSourceURLCheck
R=jkummerow@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-12 08:27:24 +00:00
yurys@chromium.org
eb037a86fd Test that functions created using v8::FunctionTemplate::New correctly displayed in CPU profiles
BUG=244580
R=jkummerow@chromium.org, loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15066 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-11 15:00:41 +00:00
yurys@chromium.org
b90bd6987b Make sure CallIC is in monomorphic state when starting profiling in NativeAccessorNameInProfile2
Changed cctest/test-cpu-profiler/NativeAccessorNameInProfile2 to make a few warm-up cycles before starting profiler so that accessor invocations performed via monomorphic inline caches and slow paths traces do not distort the profile.

Drive-by: removed logging code that was used to diagnose NativeAccessorNameInProfile2 failures on Windows.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15055 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-11 08:32:48 +00:00
yurys@chromium.org
e3dbf202c8 Try to deflake cctest/test-cpu-profiler/NativeAccessorNameInProfile1 on Windows
Make native accessors sleep for 1ms before measuring elapsed time. This is to check the theory that we cannot pause profiled thread on Win64 for some reason and miss many samples.

BUG=None
TBR=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15016 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-07 17:25:47 +00:00
yurys@chromium.org
7a34b394a5 Print accessors loop iterations count in test-cpu-profiler/NativeAccessorNameInProfile1
The test is failing on Win64 bot but passes locally I need this debug print to better understand what's different on the bot.

BUG=None
TBR=loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14965 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-06 07:00:57 +00:00
yurys@chromium.org
40a5fc747d Print accessors execution time in test-cpu-profiler/NativeAccessorNameInProfile1
The test is failing on Win64 bot but passes locally I need this debug print to better understand what's different on the bot.

BUG=None
TBR=loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-05 06:15:41 +00:00
yurys@chromium.org
106a477443 CPU profiler should support names of accessors set via v8::Object::SetAccessor
This change fixes the case when the accessors are invoked from JSObject::{Get,Set}PropertyWithCallback.

It already works for inlined calls generated by StoreStubCompiler::CompileStoreCallback. The same still needs to be fixed for getter invocations generated by  BaseLoadStubCompiler::CompileLoadCallback, corresponding case is commented out in the new test.

This is a slightly modified version of r14915 which was rolled back due to test timeout on Windows. Compared to r14915 the new tests use OS::TimeCurrentMillis instead of OS::Ticks as OS::Ticks has ms precision on Windows and trying to wait 10 ticks (us) will result in at least 1 ms pause.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14932 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-04 10:57:32 +00:00
danno@chromium.org
5344161ee6 Revert 14916: Mark test-cpu-profiler/SampleWhenFrameIsNotSetup as flaky on MIPS simulator
Revert 14915: CPU profiler should support names of accessors set via v8::Object::SetAccessor

Due to Windows failures

R=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-03 15:25:28 +00:00
yurys@chromium.org
710c245a41 CPU profiler should support names of accessors set via v8::Object::SetAccessor
This change fixes the case when the accessors are invoked from JSObject::{Get,Set}PropertyWithCallback.

It already works for inlined calls generated by StoreStubCompiler::CompileStoreCallback. The same still needs to be fixed for getter invocations generated by  BaseLoadStubCompiler::CompileLoadCallback, corresponding case is commented out in the new test.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-03 12:50:03 +00:00
dcarney@chromium.org
ff2a76b5d5 remove most V8_ALLOW_ACCESS_TO_* defines from test classes
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-28 11:54:52 +00:00
yurys@chromium.org
9974d932b2 Deprecate profiler methods that accept security origin
Now that the only known client console.profiles was removed from Blink:
https://src.chromium.org/viewvc/blink?revision=151136&view=revision
https://src.chromium.org/viewvc/blink?revision=151196&view=revision
this method can be deprecated and all the code that supports filtering
CPU profiles based on security origins can be later removed.

Drive-by fix: in line with CpuProfiler changes deprecated HeapProfiler::FindHeapSnapshot to reduce v8 API surface. FindHeapSnapshot may well be implemented based on existing GetSnapshotCount/GetSnapshot and it is only used in the tests.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14833 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-28 08:00:16 +00:00
yurys@chromium.org
77d93014ae Un-flake test-cpu-profiler/SampleWhenFrameIsNotSetup
It is OK for FindChild to return NULL. If the child must
exist GetChild should be used to force the assertion.

BUG=v8:2628
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14809 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-24 16:19:06 +00:00
yurys@chromium.org
3ad62f5ee1 Allow for no samples in test-cpu-profiler/SampleWhenFrameIsNotSetup
The test should only check that there are no sample stacks that never possible in the JS code being profiled.

BUG=v8:2628
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-17 15:10:25 +00:00
yurys@chromium.org
69c2f54d32 Skip samples where top function's stack frame is not setup properly
Stack iterator takes return address based on the frame pointer (ebp) and detects JS frames based on value at fp + StandardFrameConstants::kMarkerOffset. So in order the iterator to work correctly this values should be already setup for the current function. Stack frame is constructed at the very beginning of JS function code and destroyed before return. If sample is taken before before the frame construction is completed or after it was destroyed the stack iterator will wrongly think that FP points at the current functions frame base and will skip callers frame. To avoid this we mark code ranges where  stack frame doesn't exist and completely ignore such samples.

This fixes cctest/test-cpu-profiler/CollectCpuProfile flakiness.

BUG=v8:2628
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-14 22:51:33 +00:00
dcarney@chromium.org
cf5ff5a14c first step to remove unsafe handles
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14530 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-02 20:18:42 +00:00
yurys@chromium.org
f76c2ae2b7 Avoid unnecessary indirection when creating CodeEntries
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14446 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-26 07:50:35 +00:00
yurys@chromium.org
c0fca4e8c8 Revert r14252 as it broke --prof for some cases
R=jkummerow
BUG=v8:2642

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-19 11:55:01 +00:00
yurys@chromium.org
e103bd3521 Increase profiling interval in test-cpu-profiler/CollectCpuProfile to 500ms on Windows
BUG=v8:2628

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-15 14:45:38 +00:00
yurys@chromium.org
5206b08451 Remove code that analyzes tos values from tickprocessor
Assuming that the value on top of stack is return address for a frameless invocation is error-prone. Corresponding logic was removed from profile-generator.cc in r14205 (see https://code.google.com/p/v8/source/diff?spec=svn14205&r=14205&format=side&path=/branches/bleeding_edge/src/profile-generator.cc) and now it is time to remove it from the tick processor.

Since the tos is not used anymore by profiler it is also removed from TickSample.

BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-12 11:20:22 +00:00
yurys@chromium.org
fecd8bbec8 Stack traversal doesn't work properly on Arm simulator so disabling the test there.
BUG=2621

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 14:31:13 +00:00
svenpanne@chromium.org
41d9f4df7a Disable broken tests for now to get ARM simulator bots green again.
TBR=yurys@chromium.org
BUG=v8:2621

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 14:09:16 +00:00
yurys@chromium.org
c7ce87f865 Add sanity test for CPU profiler
The new test checks full CPU profiling cycle: using public
V8 API it starts profiling, executes a script, stops profiling
and analyzes collected profile to check that its top-down
tree has expected strutcture. The script that is being profiled
is guaranteed to run > 200ms to make sure enough samples
are collected.

To avoid possible flakiness due to non-deterministic time required
to start new thread on varios OSs when Sampler and ProfilerEventsProcessor
threads are being started the main thread is blocked until the threads
are running.

Also I removed the heuristic in profile-generator.cc where we try
to figure out if the value on top of the sampled stack is return address
of some frameless stub invocation. The code periodically gives false positive
with the new test ending up in an extra node in the collected cpu profile.
After discussion with jkummerow@ we concluded that the logic is too fragile
and that we can address frameless stub invocations in a more reliable way
later should they have a noticeable effect on cpu profiling.

BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14205 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 09:47:44 +00:00
mstarzinger@chromium.org
dd70ce29d1 Unify the way cctest initalizes the VM for each test case.
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 08:29:39 +00:00
yurys@chromium.org
359d4a2869 Isolatify CPU profiler public API
Relanding r14006 and r14009 that were reverted in r14031

TBR=danno
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-02 08:16:53 +00:00
yurys@chromium.org
9cbb34a0b5 Isolatify CPU profiler
Relanding r13987 that was reverted in r14031

TBR=danno
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-02 07:53:50 +00:00
yurys@chromium.org
c7532f0f0b Allow recording individual samples in addition to the aggregated CPU profiles
Re-landing r13980 that was reverted in r14031

TBR=danno
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-02 07:48:25 +00:00
danno@chromium.org
ed3809c318 Maintain API compatibility with older versions of V8.
Revert "Allow recording individual samples in addition to the aggregated CPU profiles"
Revert "Isolatify CPU profiler"
Revert "Isolatify HeapProfiler"
Revert "Deprecate HeapSnapshot type"
Revert "Isolatify CPU profiler public API"
Revert "MSVS compilation fix after r14006"
Revert "Add methods to allow resuming execution after calling TerminateExecution()."

R=jkummerow@chromium.org,mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14031 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-21 14:42:17 +00:00
yurys@chromium.org
95bfca8828 Isolatify CPU profiler public API
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-20 13:07:48 +00:00
yurys@chromium.org
a8e9bebabd Isolatify CPU profiler
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-19 12:44:10 +00:00
yurys@chromium.org
a5be5da2e8 Allow recording individual samples in addition to the aggregated CPU profiles
CPU profiler API is extended with methods that allow to retrieve individual samples from profile. Each sample is presented as a pointer to a node in the top-down profile tree. The samples will let us tie JS performance to time.

BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-19 08:11:56 +00:00
yurys@chromium.org
b3ee84d361 Remove bottom-up CPU profile
Bottom-up view of CPU profile can be restored based on top-down profile data. So there is no need to spend resources on creating both of them inside V8.

BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13958 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-15 12:46:45 +00:00
svenpanne@chromium.org
53310ac152 Added a version of the v8::HandleScope constructor with an Isolate and use that consistently.
I tried to limit the use of v8::Isolate::GetCurrent() and v8::internal::Isolate::Current() as much as possible, but sometimes this would have involved restructuring tests quite a bit, which is better left for a separate CL.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-15 12:06:53 +00:00
jkummerow@chromium.org
ed6c366f98 Add missing license headers.
BUG=chromium:98597

Review URL: https://codereview.chromium.org/12486003
Patch from Paweł Hajdan Jr. <phajdan.jr@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-07 11:12:26 +00:00
yurys@chromium.org
250edbdc64 Revert "Send SIGPROF signals on the profiler event processor thread"
This reverts commit r13735 as CPU profiler data is inaccurate after that change.

BUG=v8:2571

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13851 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-07 09:12:48 +00:00
yurys@chromium.org
dc9b817667 Send SIGPROF signals on the profiler event processor thread
The patch is based on the previous one that was rolled out: https://code.google.com/p/v8/source/detail?r=12985

On Linux sampling for CPU profiler is initiated on the profiler event processor thread, other platforms to follow.

CPU profiler continues to use SamplingCircularQueue, we will replave it with a single sample buffer when Mac and Win ports support profiling on the event processing thread.

When --prof option is specified profiling is initiated either on the profiler event processor thread if CPU profiler is on or on the  SignalSender thread as it used to if no CPU profiles are being collected.

ProfilerEventsProcessor::ProcessEventsAndDoSample now waits in a tight loop, processing collected samples until sampling interval expires. To save CPU resources I'm planning to change that to use nanosleep as only one sample is expected in the queue at any point.

BUG=v8:2364

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13735 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-26 16:15:32 +00:00
svenpanne@chromium.org
71a26c928a Make the Isolate parameter mandatory for internal HandleScopes.
Improved Frames and their iterators on the way, too.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 09:27:10 +00:00
jkummerow@chromium.org
bd69d3d5c3 Revert "Perform CPU sampling by CPU sampling thread only iff processing thread is not running."
This reverts r12985.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 10:26:21 +00:00
jkummerow@chromium.org
7f824867f6 Perform CPU sampling by CPU sampling thread only iff processing thread is not running.
- perform CPU profiler sampling in the sampler thread as we used to;
- skip sampling in the sampling thread if processing thread is running;
- only install SIGPROF handler when CPU profiling is enabled.

BUG=v8:2364

Review URL: https://codereview.chromium.org/11231002
Patch from Sergey Rogulenko <rogulenko@google.com> and Andrey Kosyakov <caseq@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-16 10:38:10 +00:00
jkummerow@chromium.org
62223bd2c0 Revert recent CPU profiler changes because they broke --prof.
This reverts r12649 and r12650.

BUG=v8:2364

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-17 12:24:31 +00:00