Revision: 5871
Author: [email protected]
Date: Mon Nov 22 08:09:14 2010
Log: Fix windows compilation after r5867. Now linux-friendly.
[email protected]
Review URL: http://codereview.chromium.org/5216008
http://code.google.com/p/v8/source/detail?r=5871
Modified:
/branches/bleeding_edge/src/profile-generator-inl.h
/branches/bleeding_edge/src/profile-generator.cc
/branches/bleeding_edge/src/profile-generator.h
=======================================
--- /branches/bleeding_edge/src/profile-generator-inl.h Mon Nov 22 07:38:12
2010
+++ /branches/bleeding_edge/src/profile-generator-inl.h Mon Nov 22 08:09:14
2010
@@ -120,6 +120,17 @@
default: return NULL;
}
}
+
+
+#ifdef WIN32
+inline uint64_t HeapEntry::id() {
+ return *(reinterpret_cast<uint64_t*>(&id_));
+}
+#else
+inline uint64_t HeapEntry::id() {
+ return id_;
+}
+#endif
template<class Visitor>
=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Mon Nov 22 07:38:12
2010
+++ /branches/bleeding_edge/src/profile-generator.cc Mon Nov 22 08:09:14
2010
@@ -870,7 +870,11 @@
type_ = type;
painted_ = kUnpainted;
name_ = name;
+#ifdef WIN32
+ *(reinterpret_cast<uint64_t*>(&id_)) = id;
+#else
id_ = id;
+#endif
self_size_ = self_size;
retained_size_ = 0;
children_count_ = children_count;
@@ -952,7 +956,7 @@
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 {
=======================================
--- /branches/bleeding_edge/src/profile-generator.h Mon Nov 22 07:38:12 2010
+++ /branches/bleeding_edge/src/profile-generator.h Mon Nov 22 08:09:14 2010
@@ -526,7 +526,7 @@
HeapSnapshot* snapshot() { return snapshot_; }
Type type() { return static_cast<Type>(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,15 @@
};
HeapEntry* dominator_;
HeapSnapshot* snapshot_;
- const char* name_;
+#ifdef WIN32
+ struct Id {
+ uint32_t id1_;
+ uint32_t id2_;
+ } id_; // This is to avoid extra padding of 64-bit value on MSVC.
+#else
uint64_t id_;
+#endif
+ const char* name_;
// Paints used for exact retained sizes calculation.
static const unsigned kUnpainted = 0;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev