Only put VM state entry if a symbolized stacktrace is empty.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 15 Apr 2010 14:12:17 +0000 (14:12 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 15 Apr 2010 14:12:17 +0000 (14:12 +0000)
This makes more sense than putting "(program)" as the root of
every stack trace in broswer mode.

Review URL: http://codereview.chromium.org/1631018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/profile-generator.cc

index a842eb2..4c2a330 100644 (file)
@@ -562,8 +562,17 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
   }
 
   if (FLAG_prof_browser_mode) {
-    // Put VM state as the topmost entry.
-    *entry++ = EntryForVMState(sample.state);
+    bool no_symbolized_entries = true;
+    for (CodeEntry** e = entries.start(); e != entry; ++e) {
+      if (*e != NULL) {
+        no_symbolized_entries = false;
+        break;
+      }
+    }
+    // If no frames were symbolized, put the VM state entry in.
+    if (no_symbolized_entries) {
+      *entry++ = EntryForVMState(sample.state);
+    }
   }
 
   profiles_->AddPathToCurrentProfiles(entries);