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

Unified Diff: src/heap/code-stats.h

Issue 2082863003: Refactor the functions related to collecting code statistics to a new class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « BUILD.gn ('k') | src/heap/code-stats.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/code-stats.h
diff --git a/src/heap/code-stats.h b/src/heap/code-stats.h
new file mode 100644
index 0000000000000000000000000000000000000000..499c9fa5ac0ad3c2f50ae76100c2a6e063c9bf72
--- /dev/null
+++ b/src/heap/code-stats.h
@@ -0,0 +1,42 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/assembler.h"
+#include "src/heap/spaces.h"
+#include "src/isolate.h"
+#include "src/objects.h"
+
+namespace v8 {
+namespace internal {
+
+class CodeStatistics {
+ public:
+ // Collect statistics related to code size.
+ static void CollectCodeStatistics(PagedSpace* space, Isolate* isolate);
+
+ // Collect statistics related to code size from large object space.
+ static void CollectCodeStatistics(LargeObjectSpace* space, Isolate* isolate);
+
+ // Reset code size related statistics
+ static void ResetCodeAndMetadataStatistics(Isolate* isolate);
+
+#ifdef DEBUG
+ // Report statistics about code kind, code+metadata and code comments.
+ static void ReportCodeStatistics(Isolate* isolate);
+#endif
+
+ private:
+ static void RecordCodeAndMetadataStatistics(HeapObject* object,
+ Isolate* isolate);
+
+#ifdef DEBUG
+ static void CollectCommentStatistics(Isolate* isolate, RelocIterator* it);
+ static void CollectCodeCommentStatistics(HeapObject* obj, Isolate* isolate);
+ static void EnterComment(Isolate* isolate, const char* comment, int delta);
+ static void ResetCodeStatistics(Isolate* isolate);
+#endif
+};
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « BUILD.gn ('k') | src/heap/code-stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698