Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: src/cpu-profiler.h

Issue 3417019: Provide more functions to CPU profiler (fix issue 858). (Closed)
Patch Set: Hooked on MC/MS also Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | src/cpu-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.h
diff --git a/src/cpu-profiler.h b/src/cpu-profiler.h
index 4d5559e4febdc9de02a7ca105e007347a6686170..86f9f6711f9f21713130f24fcdea3e61149112ef 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -41,6 +41,7 @@ class CodeEntry;
class CodeMap;
class CpuProfile;
class CpuProfilesCollection;
+class HashMap;
class ProfileGenerator;
class TokenEnumerator;
@@ -132,7 +133,7 @@ class TickSampleEventRecord BASE_EMBEDDED {
class ProfilerEventsProcessor : public Thread {
public:
explicit ProfilerEventsProcessor(ProfileGenerator* generator);
- virtual ~ProfilerEventsProcessor() { }
+ virtual ~ProfilerEventsProcessor();
// Thread control.
virtual void Run();
@@ -163,6 +164,7 @@ class ProfilerEventsProcessor : public Thread {
Address start, unsigned size);
// Puts current stack into tick sample events buffer.
void AddCurrentStack();
+ bool IsKnownFunction(Address start);
// Tick sample events are filled directly in the buffer of the circular
// queue (because the structure is of fixed width, but usually not all
@@ -183,6 +185,13 @@ class ProfilerEventsProcessor : public Thread {
bool ProcessTicks(unsigned dequeue_order);
INLINE(static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag));
+ INLINE(static bool AddressesMatch(void* key1, void* key2)) {
+ return key1 == key2;
+ }
+ INLINE(static uint32_t AddressHash(Address addr)) {
+ return ComputeIntegerHash(
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr)));
+ }
ProfileGenerator* generator_;
bool running_;
@@ -190,6 +199,9 @@ class ProfilerEventsProcessor : public Thread {
SamplingCircularQueue ticks_buffer_;
UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_;
unsigned enqueue_order_;
+
+ // Used from the VM thread.
+ HashMap* known_functions_;
};
} } // namespace v8::internal
@@ -242,6 +254,10 @@ class CpuProfiler {
static void CodeMoveEvent(Address from, Address to);
static void CodeDeleteEvent(Address from);
static void FunctionCreateEvent(JSFunction* function);
+ // Reports function creation in case we had missed it (e.g.
+ // if it was created from compiled code).
+ static void FunctionCreateEventFromMove(JSFunction* function,
+ HeapObject* source);
static void FunctionMoveEvent(Address from, Address to);
static void FunctionDeleteEvent(Address from);
static void GetterCallbackEvent(String* name, Address entry_point);
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | src/cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698