Reviewers: Yang,
Message:
After the addition of the IcMiss timer events, the buffers gets filed rather
quickly, and the logs becomes un-proccessable for many websites and
benchmarks.
Attempting to allow to log but exclude the IcMisses, feel free to suggest a
different approach.
Description:
Add ExternalTimerEventScope to log non internal timer events scopes
BUG=3432
LOG=N
Please review this at https://codereview.chromium.org/382043003/
SVN Base: git://github.com/v8/v8.git@master
Affected files (+41, -17 lines):
M src/ic.cc
M src/log.h
M src/log.cc
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index
cd92af11852c0f77c7140804cf6500e767087474..551c6934bb8d73bd15f678403c7cf90dd95685be
100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1931,7 +1931,7 @@ void CallIC::HandleMiss(Handle<Object> receiver,
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(CallIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 4);
@@ -1946,7 +1946,7 @@ RUNTIME_FUNCTION(CallIC_Miss) {
RUNTIME_FUNCTION(CallIC_Customization_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 4);
@@ -1962,7 +1962,7 @@ RUNTIME_FUNCTION(CallIC_Customization_Miss) {
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(LoadIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 2);
@@ -1978,7 +1978,7 @@ RUNTIME_FUNCTION(LoadIC_Miss) {
// Used from ic-<arch>.cc
RUNTIME_FUNCTION(KeyedLoadIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 2);
@@ -1993,7 +1993,7 @@ RUNTIME_FUNCTION(KeyedLoadIC_Miss) {
RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 2);
@@ -2009,7 +2009,7 @@ RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure) {
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(StoreIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 3);
@@ -2027,7 +2027,7 @@ RUNTIME_FUNCTION(StoreIC_Miss) {
RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 3);
@@ -2045,7 +2045,7 @@ RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
RUNTIME_FUNCTION(StoreIC_ArrayLength) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
@@ -2073,7 +2073,7 @@ RUNTIME_FUNCTION(StoreIC_ArrayLength) {
// it is necessary to extend the properties array of a
// JSObject.
RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope shs(isolate);
ASSERT(args.length() == 3);
@@ -2115,7 +2115,7 @@ RUNTIME_FUNCTION(SharedStoreIC_ExtendStorage) {
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 3);
@@ -2133,7 +2133,7 @@ RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 3);
@@ -2185,7 +2185,7 @@ RUNTIME_FUNCTION(KeyedStoreIC_Slow) {
RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 4);
@@ -2696,7 +2696,7 @@ MaybeHandle<Object> BinaryOpIC::Transition(
RUNTIME_FUNCTION(BinaryOpIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT_EQ(2, args.length());
@@ -2713,7 +2713,7 @@ RUNTIME_FUNCTION(BinaryOpIC_Miss) {
RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT_EQ(3, args.length());
@@ -2948,7 +2948,7 @@ Code* CompareIC::UpdateCaches(Handle<Object> x,
Handle<Object> y) {
// Used from ICCompareStub::GenerateMiss in code-stubs-<arch>.cc.
RUNTIME_FUNCTION(CompareIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
ASSERT(args.length() == 3);
@@ -3014,7 +3014,7 @@ Handle<Object>
CompareNilIC::CompareNil(Handle<Object> object) {
RUNTIME_FUNCTION(CompareNilIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
HandleScope scope(isolate);
Handle<Object> object = args.at<Object>(0);
@@ -3081,7 +3081,7 @@ Handle<Object> ToBooleanIC::ToBoolean(Handle<Object>
object) {
RUNTIME_FUNCTION(ToBooleanIC_Miss) {
- Logger::TimerEventScope timer(
+ Logger::ExternalTimerEventScope timer(
isolate, Logger::TimerEventScope::v8_ic_miss);
ASSERT(args.length() == 1);
HandleScope scope(isolate);
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index
e8af5d0ff4aa02d7667c3e27b2bb4846f61f5517..ad6019e52bf326e040bc4562276e034b6abb72c2
100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1123,6 +1123,12 @@ void Logger::TimerEventScope::LogTimerEvent(StartEnd
se) {
}
+void Logger::ExternalTimerEventScope::LogTimerEvent(StartEnd se) {
+ if (FLAG_log_timer_events)
+ isolate_->event_logger()(name_, se);
+}
+
+
const char* Logger::TimerEventScope::v8_recompile_synchronous =
"V8.RecompileSynchronous";
const char* Logger::TimerEventScope::v8_recompile_concurrent =
Index: src/log.h
diff --git a/src/log.h b/src/log.h
index
e98874b5baaa2354a2f7990f039b29e40473dfb1..7eda0ce0fa0d276bb5a0d8672eac19bb79ab1700
100644
--- a/src/log.h
+++ b/src/log.h
@@ -325,6 +325,24 @@ class Logger {
const char* name_;
};
+ class ExternalTimerEventScope {
+ public:
+ ExternalTimerEventScope(Isolate* isolate, const char* name)
+ : isolate_(isolate), name_(name) {
+ LogTimerEvent(START);
+ }
+
+ ~ExternalTimerEventScope() {
+ LogTimerEvent(END);
+ }
+
+ void LogTimerEvent(StartEnd se);
+
+ private:
+ Isolate* isolate_;
+ const char* name_;
+ };
+
// ==== Events logged by --log-regexp ====
// Regexp compilation and execution events.
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.