Revision: 3802
Author: [email protected]
Date: Thu Feb  4 13:34:03 2010
Log: Fix issue 597: builtins and stubs are missing in profiler log when using snapshots.

After this fix, profiles of non-snapshotted VMs are now equivalent to
profiles of snapshotted VMs (having that --log-snapshot-positions is used,
and mksnapshot's log is given to the tick processor script.)

BUG=597

Review URL: http://codereview.chromium.org/574005
http://code.google.com/p/v8/source/detail?r=3802

Modified:
 /branches/bleeding_edge/src/log.cc
 /branches/bleeding_edge/src/log.h
 /branches/bleeding_edge/src/v8.cc
 /branches/bleeding_edge/tools/tickprocessor.js

=======================================
--- /branches/bleeding_edge/src/log.cc  Wed Jan 27 09:10:28 2010
+++ /branches/bleeding_edge/src/log.cc  Thu Feb  4 13:34:03 2010
@@ -1292,6 +1292,15 @@
     LOG(CodeCreateEvent(tag, code_object, description));
   }
 }
+
+
+void Logger::LogCodeObjects() {
+  AssertNoAllocation no_alloc;
+  HeapIterator iterator;
+ for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
+    if (obj->IsCode()) LogCodeObject(obj);
+  }
+}


 void Logger::LogCompiledFunctions() {
=======================================
--- /branches/bleeding_edge/src/log.h   Thu Jan 21 08:42:41 2010
+++ /branches/bleeding_edge/src/log.h   Thu Feb  4 13:34:03 2010
@@ -292,7 +292,7 @@
   // Logs all accessor callbacks found in the heap.
   static void LogAccessorCallbacks();
   // Used for logging stubs found in the snapshot.
-  static void LogCodeObject(Object* code_object);
+  static void LogCodeObjects();

  private:

@@ -325,6 +325,9 @@
   // Emits the source code of a regexp. Used by regexp events.
   static void LogRegExpSource(Handle<JSRegExp> regexp);

+  // Used for logging stubs found in the snapshot.
+  static void LogCodeObject(Object* code_object);
+
   // Emits a profiler tick event. Used by the profiler thread.
   static void TickEvent(TickSample* sample, bool overflow);

=======================================
--- /branches/bleeding_edge/src/v8.cc   Wed Jan 27 00:25:48 2010
+++ /branches/bleeding_edge/src/v8.cc   Thu Feb  4 13:34:03 2010
@@ -114,8 +114,11 @@

   OProfileAgent::Initialize();

-  if (FLAG_log_code) {
+  // If we are deserializing, log non-function code objects and compiled
+  // functions found in the snapshot.
+  if (des != NULL && FLAG_log_code) {
     HandleScope scope;
+    LOG(LogCodeObjects());
     LOG(LogCompiledFunctions());
   }

=======================================
--- /branches/bleeding_edge/tools/tickprocessor.js      Thu Jan 21 08:42:41 2010
+++ /branches/bleeding_edge/tools/tickprocessor.js      Thu Feb  4 13:34:03 2010
@@ -67,6 +67,9 @@
           processor: this.processCodeMove, backrefs: true },
       'code-delete': { parsers: [this.createAddressParser('code')],
           processor: this.processCodeDelete, backrefs: true },
+      'function-creation': null,
+      'function-move': null,
+      'function-delete': null,
'snapshot-pos': { parsers: [this.createAddressParser('code'), parseInt],
           processor: this.processSnapshotPosition, backrefs: true }});

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to