Revision: 17242
Author: [email protected]
Date: Wed Oct 16 14:33:04 2013 UTC
Log: 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
[email protected]
Review URL: https://codereview.chromium.org/26166004
http://code.google.com/p/v8/source/detail?r=17242
Modified:
/branches/bleeding_edge/src/builtins.cc
/branches/bleeding_edge/src/heap-profiler.h
/branches/bleeding_edge/src/heap.cc
/branches/bleeding_edge/src/mark-compact.cc
=======================================
--- /branches/bleeding_edge/src/builtins.cc Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/builtins.cc Wed Oct 16 14:33:04 2013 UTC
@@ -273,9 +273,12 @@
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));
}
=======================================
--- /branches/bleeding_edge/src/heap-profiler.h Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/heap-profiler.h Wed Oct 16 14:33:04 2013 UTC
@@ -37,14 +37,6 @@
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);
=======================================
--- /branches/bleeding_edge/src/heap.cc Mon Oct 14 14:00:28 2013 UTC
+++ /branches/bleeding_edge/src/heap.cc Wed Oct 16 14:33:04 2013 UTC
@@ -2130,9 +2130,12 @@
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()) {
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/mark-compact.cc Wed Oct 16 14:33:04 2013 UTC
@@ -2759,7 +2759,10 @@
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) {
--
--
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/groups/opt_out.