From a5f7ae72af760cd966abb93eb8abcfbc73180ab4 Mon Sep 17 00:00:00 2001 From: "mikhail.naganov@gmail.com" Date: Mon, 22 Nov 2010 15:31:43 +0000 Subject: [PATCH] Fix compilation on Win after r5867. TBR=sgjesse@chromium.org Review URL: http://codereview.chromium.org/5242003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5869 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/profile-generator-inl.h | 5 +++++ src/profile-generator.cc | 4 ++-- src/profile-generator.h | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h index 71de2d1..c8c98cc 100644 --- a/src/profile-generator-inl.h +++ b/src/profile-generator-inl.h @@ -122,6 +122,11 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { } +inline uint64_t HeapEntry::id() { + return *(reinterpret_cast(&id_)); +} + + template void HeapEntriesMap::UpdateEntries(Visitor* visitor) { for (HashMap::Entry* p = entries_.Start(); diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 9f475a4..8a871a5 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -870,7 +870,7 @@ void HeapEntry::Init(HeapSnapshot* snapshot, type_ = type; painted_ = kUnpainted; name_ = name; - id_ = id; + *(reinterpret_cast(&id_)) = id; self_size_ = self_size; retained_size_ = 0; children_count_ = children_count; @@ -952,7 +952,7 @@ void HeapEntry::PaintAllReachable() { void HeapEntry::Print(int max_depth, int indent) { - OS::Print("%6d %6d [%llu] ", self_size(), RetainedSize(false), id_); + OS::Print("%6d %6d [%llu] ", self_size(), RetainedSize(false), id()); if (type() != kString) { OS::Print("%s %.40s\n", TypeAsString(), name_); } else { diff --git a/src/profile-generator.h b/src/profile-generator.h index 7f8ffbd..0773a1e 100644 --- a/src/profile-generator.h +++ b/src/profile-generator.h @@ -526,7 +526,7 @@ class HeapEntry BASE_EMBEDDED { HeapSnapshot* snapshot() { return snapshot_; } Type type() { return static_cast(type_); } const char* name() { return name_; } - uint64_t id() { return id_; } + uint64_t id(); int self_size() { return self_size_; } int retained_size() { return retained_size_; } void add_retained_size(int size) { retained_size_ += size; } @@ -615,8 +615,11 @@ class HeapEntry BASE_EMBEDDED { }; HeapEntry* dominator_; HeapSnapshot* snapshot_; + struct Id { + uint32_t id1_; + uint32_t id2_; + } id_; // This is to avoid extra padding of 64-bit value on MSVC. const char* name_; - uint64_t id_; // Paints used for exact retained sizes calculation. static const unsigned kUnpainted = 0; -- 2.7.4