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

Unified Diff: src/heap-profiler.h

Issue 3301008: [Isolates] Add heap pointer to all maps and use map->heap() more. (Closed)
Patch Set: even more Created 10 years, 3 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: src/heap-profiler.h
diff --git a/src/heap-profiler.h b/src/heap-profiler.h
index daa297eca2647b59b59c96ce4c475c37aa295ae7..2625f6cb6731ad8487ce6751e02ad071851bca04 100644
--- a/src/heap-profiler.h
+++ b/src/heap-profiler.h
@@ -39,14 +39,15 @@ namespace internal {
class HeapSnapshot;
class HeapSnapshotsCollection;
-#define HEAP_PROFILE(Call) \
- do { \
- if (v8::internal::HeapProfiler::is_profiling()) { \
- v8::internal::HeapProfiler::Call; \
- } \
+#define HEAP_PROFILE(heap, call) \
+ do { \
+ v8::internal::HeapProfiler* profiler = heap->isolate()->heap_profiler(); \
+ if (profiler && profiler->is_profiling()) { \
Vitaly Repeshko 2010/09/10 12:35:25 nit: Use explicit != NULL comparison.
+ profiler->call; \
+ } \
} while (false)
#else
-#define HEAP_PROFILE(Call) ((void) 0)
+#define HEAP_PROFILE(heap, call) ((void) 0)
#endif // ENABLE_LOGGING_AND_PROFILING
// The HeapProfiler writes data to the log files, which can be postprocessed
@@ -63,11 +64,10 @@ class HeapProfiler {
static HeapSnapshot* GetSnapshot(int index);
static HeapSnapshot* FindSnapshot(unsigned uid);
- static void ObjectMoveEvent(Address from, Address to);
+ void ObjectMoveEvent(Address from, Address to);
- static INLINE(bool is_profiling()) {
- HeapProfiler* profiler = Isolate::Current()->heap_profiler();
- return profiler != NULL && profiler->snapshots_->is_tracking_objects();
+ INLINE(bool is_profiling()) {
+ return snapshots_->is_tracking_objects();
}
// Obsolete interface.

Powered by Google App Engine
This is Rietveld 408576698