Reviewers: Hannes Payer,
Description:
Remove static logging of memory allocations
We want to move to a world where there's no Isolate::Current but we
always knows which isolate we're in. There's no way we can teach this
info to the C++ allocator.
BUG=none
[email protected]
LOG=n
Please review this at https://codereview.chromium.org/1128023005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+0, -50 lines):
M src/globals.h
M src/heap/spaces.h
M src/log.h
M src/log.cc
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index
00623ca7056b596241edfcded577b0cb235e9eb3..761983178d4b0f4d2f316744eed9d4ff818474e4
100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -645,26 +645,6 @@ struct AccessorDescriptor {
#define DOUBLE_POINTER_ALIGN(value) \
(((value) + kDoubleAlignmentMask) & ~kDoubleAlignmentMask)
-// Support for tracking C++ memory allocation. Insert TRACK_MEMORY("Fisk")
-// inside a C++ class and new and delete will be overloaded so logging is
-// performed.
-// This file (globals.h) is included before log.h, so we use direct calls
to
-// the Logger rather than the LOG macro.
-#ifdef DEBUG
-#define TRACK_MEMORY(name) \
- void* operator new(size_t size) { \
- void* result = ::operator new(size); \
- Logger::NewEventStatic(name, result, size); \
- return result; \
- } \
- void operator delete(void* object) { \
- Logger::DeleteEventStatic(name, object); \
- ::operator delete(object); \
- }
-#else
-#define TRACK_MEMORY(name)
-#endif
-
// CPU feature flags.
enum CpuFeature {
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index
f165663af6cbd442427bb1f6e3b2948118b7386a..7ea318d3fa2a4e31c5377918e4561431e1ba4ac8
100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -2253,9 +2253,6 @@ class SemiSpace : public Space {
friend class SemiSpaceIterator;
friend class NewSpacePageIterator;
-
- public:
- TRACK_MEMORY("SemiSpace")
};
@@ -2625,9 +2622,6 @@ class NewSpace : public Space {
SlowAllocateRaw(int size_in_bytes, AllocationAlignment alignment);
friend class SemiSpaceIterator;
-
- public:
- TRACK_MEMORY("NewSpace")
};
@@ -2641,9 +2635,6 @@ class OldSpace : public PagedSpace {
OldSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id,
Executability executable)
: PagedSpace(heap, max_capacity, id, executable) {}
-
- public:
- TRACK_MEMORY("OldSpace")
};
@@ -2689,9 +2680,6 @@ class MapSpace : public PagedSpace {
}
const int max_map_space_pages_;
-
- public:
- TRACK_MEMORY("MapSpace")
};
@@ -2785,9 +2773,6 @@ class LargeObjectSpace : public Space {
HashMap chunk_map_;
friend class LargeObjectIterator;
-
- public:
- TRACK_MEMORY("LargeObjectSpace")
};
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index
ec2bb631ea96b9dcfcbeb4abc4443c3691aa57b6..de99a774cbf71ad1347f44d0bcf5eea96507f695
100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1079,16 +1079,6 @@ void Logger::DeleteEvent(const char* name, void*
object) {
}
-void Logger::NewEventStatic(const char* name, void* object, size_t size) {
- Isolate::Current()->logger()->NewEvent(name, object, size);
-}
-
-
-void Logger::DeleteEventStatic(const char* name, void* object) {
- Isolate::Current()->logger()->DeleteEvent(name, object);
-}
-
-
void Logger::CallbackEventInternal(const char* prefix, Name* name,
Address entry_point) {
if (!FLAG_log_code || !log_->IsEnabled()) return;
Index: src/log.h
diff --git a/src/log.h b/src/log.h
index
c0559e7895500d32988f266cd797970e0e1972aa..9402110691d657bc897b1e52db477abafc8d146c
100644
--- a/src/log.h
+++ b/src/log.h
@@ -188,11 +188,6 @@ class Logger {
void NewEvent(const char* name, void* object, size_t size);
void DeleteEvent(const char* name, void* object);
- // Static versions of the above, operate on current isolate's logger.
- // Used in TRACK_MEMORY(TypeName) defined in globals.h
- static void NewEventStatic(const char* name, void* object, size_t size);
- static void DeleteEventStatic(const char* name, void* object);
-
// Emits an event with a tag, and some resource usage information.
// -> (name, tag, <rusage information>).
// Currently, the resource usage information is a process time stamp
--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.