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
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3802
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
}
+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() {
HandleScope scope;
const int compiled_funcs_count = EnumerateCompiledFunctions(NULL);
// 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:
// 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);
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());
}
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 }});