Get rid of HEAP_PROFILE macro

All usages of the macro were replaced with direct calls to the heap profiler. The macro does null check for HeapProfiler which is always true.

BUG=None
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yurys@chromium.org 2013-10-16 14:33:04 +00:00
parent 3e0f828b8f
commit 18482d0da2
4 changed files with 15 additions and 14 deletions

View File

@ -273,9 +273,12 @@ static FixedArrayBase* LeftTrimFixedArray(Heap* heap,
MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta);
}
HEAP_PROFILE(heap, ObjectMoveEvent(elms->address(),
elms->address() + size_delta,
elms->Size()));
HeapProfiler* profiler = heap->isolate()->heap_profiler();
if (profiler->is_profiling()) {
profiler->ObjectMoveEvent(elms->address(),
elms->address() + size_delta,
elms->Size());
}
return FixedArrayBase::cast(HeapObject::FromAddress(
elms->address() + to_trim * entry_size));
}

View File

@ -37,14 +37,6 @@ namespace internal {
class HeapSnapshot;
class HeapSnapshotsCollection;
#define HEAP_PROFILE(heap, call) \
do { \
v8::internal::HeapProfiler* profiler = heap->isolate()->heap_profiler(); \
if (profiler != NULL && profiler->is_profiling()) { \
profiler->call; \
} \
} while (false)
class HeapProfiler {
public:
explicit HeapProfiler(Heap* heap);

View File

@ -2130,9 +2130,12 @@ class ScavengingVisitor : public StaticVisitorBase {
if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
// Update NewSpace stats if necessary.
RecordCopiedObject(heap, target);
HEAP_PROFILE(heap,
ObjectMoveEvent(source->address(), target->address(), size));
Isolate* isolate = heap->isolate();
HeapProfiler* heap_profiler = isolate->heap_profiler();
if (heap_profiler->is_profiling()) {
heap_profiler->ObjectMoveEvent(source->address(), target->address(),
size);
}
if (isolate->logger()->is_logging_code_events() ||
isolate->cpu_profiler()->is_profiling()) {
if (target->IsSharedFunctionInfo()) {

View File

@ -2759,7 +2759,10 @@ void MarkCompactCollector::MigrateObject(Address dst,
Address src,
int size,
AllocationSpace dest) {
HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst, size));
HeapProfiler* heap_profiler = heap()->isolate()->heap_profiler();
if (heap_profiler->is_profiling()) {
heap_profiler->ObjectMoveEvent(src, dst, size);
}
ASSERT(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest));
ASSERT(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize);
if (dest == OLD_POINTER_SPACE) {