Commit db145a41 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Add JSHeapBroker::Trace helper function for logging.

Bug: v8:7790
Change-Id: I1da64ab7f2385be9d62542166a2577cc135b2154
Reviewed-on: https://chromium-review.googlesource.com/1175912Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55147}
parent 64117a74
......@@ -277,8 +277,16 @@ JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* zone)
zone_(zone),
refs_(zone),
mode_(FLAG_concurrent_compiler_frontend ? kSerializing : kDisabled) {
Trace("%s", "Constructing heap broker.\n");
}
void JSHeapBroker::Trace(const char* format, ...) const {
if (FLAG_trace_heap_broker) {
PrintF("[%p] Constructing heap broker.\n", this);
PrintF("[%p] ", this);
va_list arguments;
va_start(arguments, format);
base::OS::VPrint(format, arguments);
va_end(arguments);
}
}
......@@ -288,9 +296,7 @@ bool JSHeapBroker::SerializingAllowed() const {
}
void JSHeapBroker::SerializeStandardObjects() {
if (FLAG_trace_heap_broker) {
PrintF("[%p] Serializing standard objects.\n", this);
}
Trace("Serializing standard objects.\n");
Builtins* const b = isolate()->builtins();
Factory* const f = isolate()->factory();
......@@ -392,9 +398,8 @@ ObjectData* JSHeapBroker::GetOrCreateData(Handle<Object> object) {
}
void JSHeapBroker::AddData(Handle<Object> object, ObjectData* data) {
Trace("Creating data %p for handle %" V8PRIuPTR " (", data, object.address());
if (FLAG_trace_heap_broker) {
PrintF("[%p] Creating data %p for handle %" V8PRIuPTR " (", this, data,
object.address());
object->ShortPrint();
PrintF(")\n");
}
......
......@@ -428,6 +428,8 @@ class V8_EXPORT_PRIVATE JSHeapBroker : public NON_EXPORTED_BASE(ZoneObject) {
ObjectData* GetOrCreateData(Handle<Object>);
void AddData(Handle<Object> object, ObjectData* data);
void Trace(const char* format, ...) const;
private:
friend class HeapObjectRef;
friend class ObjectRef;
......
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