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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 2197923002: Not for landing: Profile Elliott's parsing benchmark Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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
Index: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
index c1f74c4286e808879c9edb1af455d55690c9cafd..6ace7732409d378995db769ac25ac2ec2b4bf627 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -263,6 +263,8 @@ void gcPrologueForMajorGC(v8::Isolate* isolate, bool constructRetainedObjectInfo
} // namespace
+double s_time = 0;
+
void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCallbackFlags flags)
{
if (isMainThread())
@@ -279,6 +281,8 @@ void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCal
// a task to schedule the Oilpan's GC.
// (In practice, there is no finalizer that calls into V8 and thus is safe.)
+ s_time = WTF::currentTimeMS();
+
v8::HandleScope scope(isolate);
switch (type) {
case v8::kGCTypeScavenge:
@@ -325,6 +329,28 @@ void UpdateCollectedPhantomHandles(v8::Isolate* isolate)
void V8GCController::gcEpilogue(v8::Isolate* isolate, v8::GCType type, v8::GCCallbackFlags flags)
{
UpdateCollectedPhantomHandles(isolate);
+
+ if (flags & v8::kGCCallbackFlagForced) {
+ fprintf(stderr, "forced ");
+ }
+ switch (type) {
+ case v8::kGCTypeScavenge:
+ fprintf(stderr, "minor ");
+ break;
+ case v8::kGCTypeMarkSweepCompact:
+ fprintf(stderr, "major ");
+ break;
+ case v8::kGCTypeIncrementalMarking:
+ fprintf(stderr, "incremental ");
+ break;
+ case v8::kGCTypeProcessWeakCallbacks:
+ fprintf(stderr, "weak-callback ");
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ fprintf(stderr, "V8 GC: %.2lf ms\n", WTF::currentTimeMS() - s_time);
+
switch (type) {
case v8::kGCTypeScavenge:
TRACE_EVENT_END1("devtools.timeline,v8", "MinorGC", "usedHeapSizeAfter", usedHeapSize(isolate));
« no previous file with comments | « third_party/WebKit/Source/benchmarks/test-markup.txt ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698