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

Unified Diff: src/log-inl.h

Issue 1523015: C++ profiles processor: align browser mode with the old implementation, sample VM state. (Closed)
Patch Set: Using Script::type to filter out native scripts. 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/log.cc ('k') | src/platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log-inl.h
diff --git a/src/log-inl.h b/src/log-inl.h
index 1500252a5c66a09e436653a17847945a228e4c88..e71b667d16087d21d5c77f4a0140d24973cf7ff4 100644
--- a/src/log-inl.h
+++ b/src/log-inl.h
@@ -29,6 +29,7 @@
#define V8_LOG_INL_H_
#include "log.h"
+#include "cpu-profiler.h"
namespace v8 {
namespace internal {
@@ -55,10 +56,13 @@ inline const char* StateToString(StateTag state) {
}
}
-VMState::VMState(StateTag state) : disabled_(true), external_callback_(NULL) {
- if (!Logger::is_logging()) {
+VMState::VMState(StateTag state)
+ : disabled_(true),
+ state_(OTHER),
+ external_callback_(NULL) {
+ if (!Logger::is_logging() && !CpuProfiler::is_profiling()) {
return;
- }
+}
disabled_ = false;
#if !defined(ENABLE_HEAP_PROTECTION)
@@ -118,6 +122,26 @@ VMState::~VMState() {
}
#endif
}
+
+Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
+ Script* script) {
+#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+ if ((tag == FUNCTION_TAG || tag == LAZY_COMPILE_TAG || tag == SCRIPT_TAG)
+ && script->type()->value() == Script::TYPE_NATIVE) {
+ switch (tag) {
+ case FUNCTION_TAG: return NATIVE_FUNCTION_TAG;
+ case LAZY_COMPILE_TAG: return NATIVE_LAZY_COMPILE_TAG;
+ case SCRIPT_TAG: return NATIVE_SCRIPT_TAG;
+ default: return tag;
+ }
+ } else {
+ return tag;
+ }
+#else
+ return tag;
+#endif
+}
+
#endif
« no previous file with comments | « src/log.cc ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698