From 29a7186d11bfb00e235d16fd731c1a996e80bbfd Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Wed, 24 Apr 2013 12:09:04 +0000 Subject: [PATCH] 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 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14410 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/profile-generator.cc | 7 ++++++- src/profile-generator.h | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 837faa0..b1b163b 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -571,7 +571,12 @@ void CodeMap::MoveCode(Address from, Address to) { 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()); + } } diff --git a/src/profile-generator.h b/src/profile-generator.h index 4ddb753..0ed5a0c 100644 --- a/src/profile-generator.h +++ b/src/profile-generator.h @@ -107,7 +107,6 @@ class CodeEntry { 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_; } -- 2.7.4