Revision: 14410
Author:   [email protected]
Date:     Wed Apr 24 05:09:04 2013
Log:      Fix segmentation fault in CodeMap::Print

CodeEntry* is always NULL for SharedFunctionInfo entries in the CodeMap. Take this into account when printing the map.

Drive-by: removed  CodeEntry::shared_id() which is never called.

BUG=None

Review URL: https://codereview.chromium.org/14387004
http://code.google.com/p/v8/source/detail?r=14410

Modified:
 /branches/bleeding_edge/src/profile-generator.cc
 /branches/bleeding_edge/src/profile-generator.h

=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Tue Apr 23 00:26:30 2013 +++ /branches/bleeding_edge/src/profile-generator.cc Wed Apr 24 05:09:04 2013
@@ -571,7 +571,12 @@

 void CodeMap::CodeTreePrinter::Call(
     const Address& key, const CodeMap::CodeEntryInfo& value) {
-  OS::Print("%p %5d %s\n", key, value.size, value.entry->name());
+  // For shared function entries, 'size' field is used to store their IDs.
+  if (value.entry == kSharedFunctionCodeEntry) {
+    OS::Print("%p SharedFunctionInfo %d\n", key, value.size);
+  } else {
+    OS::Print("%p %5d %s\n", key, value.size, value.entry->name());
+  }
 }


=======================================
--- /branches/bleeding_edge/src/profile-generator.h     Tue Apr  2 00:48:25 2013
+++ /branches/bleeding_edge/src/profile-generator.h     Wed Apr 24 05:09:04 2013
@@ -107,7 +107,6 @@
   INLINE(const char* name() const) { return name_; }
   INLINE(const char* resource_name() const) { return resource_name_; }
   INLINE(int line_number() const) { return line_number_; }
-  INLINE(int shared_id() const) { return shared_id_; }
   INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; }
   INLINE(int security_token_id() const) { return security_token_id_; }

--
--
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.


Reply via email to