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

Unified Diff: src/cpu-profiler.cc

Issue 1547023: C++ profiler: publish the new API, make compatible with WebKit / Chromium. (Closed)
Patch Set: comments addressed Created 10 years, 8 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 | « src/cpu-profiler.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 4869e76beda4913b767142b81f6ea77a42317494..fb76845c03d9e6c8c2249fd7d3096476da575946 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -33,6 +33,8 @@
#include "log-inl.h"
+#include "../include/v8-profiler.h"
+
namespace v8 {
namespace internal {
@@ -156,6 +158,23 @@ void ProfilerEventsProcessor::FunctionDeleteEvent(Address from) {
}
+void ProfilerEventsProcessor::RegExpCodeCreateEvent(
+ Logger::LogEventsAndTags tag,
+ const char* prefix,
+ String* name,
+ Address start,
+ unsigned size) {
+ CodeEventsContainer evt_rec;
+ CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
+ rec->type = CodeEventRecord::CODE_CREATION;
+ rec->order = ++enqueue_order_;
+ rec->start = start;
+ rec->entry = generator_->NewCodeEntry(tag, prefix, name);
+ rec->size = size;
+ events_buffer_.Enqueue(evt_rec);
+}
+
+
bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) {
if (!events_buffer_.IsEmpty()) {
CodeEventsContainer record;
@@ -287,7 +306,7 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
tag,
name,
Heap::empty_string(),
- CodeEntry::kNoLineNumberInfo,
+ v8::CpuProfileNode::kNoLineNumberInfo,
code->address(),
code->ExecutableSize());
}
@@ -349,11 +368,10 @@ void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) {
void CpuProfiler::RegExpCodeCreateEvent(Code* code, String* source) {
- singleton_->processor_->CodeCreateEvent(
+ singleton_->processor_->RegExpCodeCreateEvent(
Logger::REG_EXP_TAG,
+ "RegExp: ",
source,
- Heap::empty_string(),
- CodeEntry::kNoLineNumberInfo,
code->address(),
code->ExecutableSize());
}
@@ -379,14 +397,14 @@ CpuProfiler::~CpuProfiler() {
void CpuProfiler::StartCollectingProfile(const char* title) {
- if (profiles_->StartProfiling(title, ++next_profile_uid_)) {
+ if (profiles_->StartProfiling(title, next_profile_uid_++)) {
StartProcessorIfNotStarted();
}
}
void CpuProfiler::StartCollectingProfile(String* title) {
- if (profiles_->StartProfiling(title, ++next_profile_uid_)) {
+ if (profiles_->StartProfiling(title, next_profile_uid_++)) {
StartProcessorIfNotStarted();
}
}
« no previous file with comments | « src/cpu-profiler.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698