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
This commit is contained in:
mikhail.naganov@gmail.com 2010-07-15 14:28:52 +00:00
parent c98ac6e82c
commit 522faec553
3 changed files with 18 additions and 34 deletions

View File

@ -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
// arguments. Should not be called directly.
static inline void CheckNonEqualsHelper(const char* file,

View File

@ -496,7 +496,7 @@ class HeapEntry {
HeapEntry(HeapSnapshot* snapshot,
Type type,
const char* name,
int id,
uint64_t id,
int self_size,
int security_token_id)
: snapshot_(snapshot),

View File

@ -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) {
v8::HandleScope scope;
LocalContext env;
@ -648,32 +654,32 @@ TEST(HeapEntryIdsAndGC) {
const v8::HeapGraphNode* global1 = GetGlobalObject(snapshot1);
const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2);
CHECK_NE(0, global1->GetId());
CHECK_EQ(global1->GetId(), global2->GetId());
CHECK(global1->GetId() != 0);
CHECK_EQ_UINT64_T(global1->GetId(), global2->GetId());
const v8::HeapGraphNode* A1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "A");
const v8::HeapGraphNode* A2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "A");
CHECK_NE(0, A1->GetId());
CHECK_EQ(A1->GetId(), A2->GetId());
CHECK(A1->GetId() != 0);
CHECK_EQ_UINT64_T(A1->GetId(), A2->GetId());
const v8::HeapGraphNode* B1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "B");
const v8::HeapGraphNode* B2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "B");
CHECK_NE(0, B1->GetId());
CHECK_EQ(B1->GetId(), B2->GetId());
CHECK(B1->GetId() != 0);
CHECK_EQ_UINT64_T(B1->GetId(), B2->GetId());
const v8::HeapGraphNode* a1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "a");
const v8::HeapGraphNode* a2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "a");
CHECK_NE(0, a1->GetId());
CHECK_EQ(a1->GetId(), a2->GetId());
CHECK(a1->GetId() != 0);
CHECK_EQ_UINT64_T(a1->GetId(), a2->GetId());
const v8::HeapGraphNode* b1 =
GetProperty(global1, v8::HeapGraphEdge::PROPERTY, "b");
const v8::HeapGraphNode* b2 =
GetProperty(global2, v8::HeapGraphEdge::PROPERTY, "b");
CHECK_NE(0, b1->GetId());
CHECK_EQ(b1->GetId(), b2->GetId());
CHECK(b1->GetId() != 0);
CHECK_EQ_UINT64_T(b1->GetId(), b2->GetId());
}
@ -741,7 +747,7 @@ TEST(HeapSnapshotsDiff) {
}
}
CHECK(found_A_del);
CHECK_NE(0, s1_A_id);
CHECK(s1_A_id != 0);
CHECK(s1_A_id != s2_A_id);
}