Commit 6dd52eaf authored by jochen's avatar jochen Committed by Commit bot

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
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1128023005

Cr-Commit-Position: refs/heads/master@{#28414}
parent cbfb7cc1
......@@ -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 {
......
......@@ -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")
};
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment