Fix compile errors on Linux x64 and Windows.

Will fix test-heap-profiler in the next change.

TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5079 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c98ac6e8
...@@ -103,28 +103,6 @@ static inline void CheckEqualsHelper(const char* file, int line, ...@@ -103,28 +103,6 @@ static inline void CheckEqualsHelper(const char* file, int line,
} }
// Helper function used by the CHECK_EQ function when given uint64_t
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file, int line,
const char* expected_source,
uint64_t expected,
const char* value_source,
uint64_t value) {
if (expected != value) {
// Print uint64_t values in hex, as two int32s,
// to avoid platform-dependencies.
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n#"
" Expected: 0x%08x%08x\n# Found: 0x%08x%08x",
expected_source, value_source,
static_cast<uint32_t>(expected >> 32),
static_cast<uint32_t>(expected),
static_cast<uint32_t>(value >> 32),
static_cast<uint32_t>(value));
}
}
// Helper function used by the CHECK_NE function when given int // Helper function used by the CHECK_NE function when given int
// arguments. Should not be called directly. // arguments. Should not be called directly.
static inline void CheckNonEqualsHelper(const char* file, static inline void CheckNonEqualsHelper(const char* file,
......
...@@ -496,7 +496,7 @@ class HeapEntry { ...@@ -496,7 +496,7 @@ class HeapEntry {
HeapEntry(HeapSnapshot* snapshot, HeapEntry(HeapSnapshot* snapshot,
Type type, Type type,
const char* name, const char* name,
int id, uint64_t id,
int self_size, int self_size,
int security_token_id) int security_token_id)
: snapshot_(snapshot), : snapshot_(snapshot),
......
...@@ -629,6 +629,12 @@ TEST(HeapSnapshotCodeObjects) { ...@@ -629,6 +629,12 @@ TEST(HeapSnapshotCodeObjects) {
} }
// Trying to introduce a check helper for uint64_t causes many
// overloading ambiguities, so it seems easier just to cast
// them to a signed type.
#define CHECK_EQ_UINT64_T(a, b) \
CHECK_EQ(static_cast<int64_t>(a), static_cast<int64_t>(b))
TEST(HeapEntryIdsAndGC) { TEST(HeapEntryIdsAndGC) {
v8::HandleScope scope; v8::HandleScope scope;
LocalContext env; LocalContext env;
...@@ -648,32 +654,32 @@ TEST(HeapEntryIdsAndGC) { ...@@ -648,32 +654,32 @@ TEST(HeapEntryIdsAndGC) {
const v8::HeapGraphNode* global1 = GetGlobalObject(snapshot1); const v8::HeapGraphNode* global1 = GetGlobalObject(snapshot1);
const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2); const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2);
CHECK_NE(0, global1->GetId()); CHECK(global1->GetId() != 0);
CHECK_EQ(global1->GetId(), global2->GetId()); CHECK_EQ_UINT64_T(global1->GetId(), global2->GetId());
const v8::HeapGraphNode* A1 = const v8::HeapGraphNode* A1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "A"); GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "A");
const v8::HeapGraphNode* A2 = const v8::HeapGraphNode* A2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "A"); GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "A");
CHECK_NE(0, A1->GetId()); CHECK(A1->GetId() != 0);
CHECK_EQ(A1->GetId(), A2->GetId()); CHECK_EQ_UINT64_T(A1->GetId(), A2->GetId());
const v8::HeapGraphNode* B1 = const v8::HeapGraphNode* B1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "B"); GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "B");
const v8::HeapGraphNode* B2 = const v8::HeapGraphNode* B2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "B"); GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "B");
CHECK_NE(0, B1->GetId()); CHECK(B1->GetId() != 0);
CHECK_EQ(B1->GetId(), B2->GetId()); CHECK_EQ_UINT64_T(B1->GetId(), B2->GetId());
const v8::HeapGraphNode* a1 = const v8::HeapGraphNode* a1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "a"); GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "a");
const v8::HeapGraphNode* a2 = const v8::HeapGraphNode* a2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "a"); GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "a");
CHECK_NE(0, a1->GetId()); CHECK(a1->GetId() != 0);
CHECK_EQ(a1->GetId(), a2->GetId()); CHECK_EQ_UINT64_T(a1->GetId(), a2->GetId());
const v8::HeapGraphNode* b1 = const v8::HeapGraphNode* b1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "b"); GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "b");
const v8::HeapGraphNode* b2 = const v8::HeapGraphNode* b2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "b"); GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "b");
CHECK_NE(0, b1->GetId()); CHECK(b1->GetId() != 0);
CHECK_EQ(b1->GetId(), b2->GetId()); CHECK_EQ_UINT64_T(b1->GetId(), b2->GetId());
} }
...@@ -741,7 +747,7 @@ TEST(HeapSnapshotsDiff) { ...@@ -741,7 +747,7 @@ TEST(HeapSnapshotsDiff) {
} }
} }
CHECK(found_A_del); CHECK(found_A_del);
CHECK_NE(0, s1_A_id); CHECK(s1_A_id != 0);
CHECK(s1_A_id != s2_A_id); CHECK(s1_A_id != s2_A_id);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment