Commit 13d59a06 authored by whesse@chromium.org's avatar whesse@chromium.org

Add explicit integer type-casts to make WIN64 build without errors.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2795 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 09f65846
......@@ -95,6 +95,38 @@ static inline void CheckNonEqualsHelper(const char* file,
}
}
#ifdef V8_TARGET_ARCH_X64
// Helper function used by the CHECK_EQ function when given intptr_t
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file,
int line,
const char* expected_source,
intptr_t expected,
const char* value_source,
intptr_t value) {
if (expected != value) {
V8_Fatal(file, line,
"CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i",
expected_source, value_source, expected, value);
}
}
// Helper function used by the CHECK_NE function when given intptr_t
// arguments. Should not be called directly.
static inline void CheckNonEqualsHelper(const char* file,
int line,
const char* unexpected_source,
intptr_t unexpected,
const char* value_source,
intptr_t value) {
if (unexpected == value) {
V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i",
unexpected_source, value_source, value);
}
}
#endif // V8_TARGET_ARCH_X64
// Helper function used by the CHECK function when given string
// arguments. Should not be called directly.
......
......@@ -2635,7 +2635,7 @@ class Code: public HeapObject {
int ExecutableSize() {
// Check that the assumptions about the layout of the code object holds.
ASSERT_EQ(instruction_start() - address(),
Code::kHeaderSize);
static_cast<intptr_t>(Code::kHeaderSize));
return instruction_size() + Code::kHeaderSize;
}
......
......@@ -1257,7 +1257,7 @@ Address Serializer::PutObject(HeapObject* obj) {
// Write out the object prologue: type, size, and simulated address of obj.
writer_->PutC('[');
CHECK_EQ(0, size & kObjectAlignmentMask);
CHECK_EQ(static_cast<intptr_t>(0), size & kObjectAlignmentMask);
writer_->PutInt(type);
writer_->PutInt(size >> kObjectAlignmentBits);
PutEncodedAddress(addr); // encodes AllocationSpace
......
......@@ -179,7 +179,7 @@ TEST(HeapObjects) {
TEST(Tagging) {
InitializeVM();
int request = 24;
ASSERT_EQ(request, OBJECT_SIZE_ALIGN(request));
ASSERT_EQ(static_cast<intptr_t>(request), OBJECT_SIZE_ALIGN(request));
CHECK(Smi::FromInt(42)->IsSmi());
CHECK(Failure::RetryAfterGC(request, NEW_SPACE)->IsFailure());
CHECK_EQ(request, Failure::RetryAfterGC(request, NEW_SPACE)->requested());
......
......@@ -158,7 +158,7 @@ TEST(Utils1) {
// int8_t and intptr_t signed integers.
CHECK_EQ(-2, -8 >> 2);
CHECK_EQ(-2, static_cast<int8_t>(-8) >> 2);
CHECK_EQ(-2, static_cast<intptr_t>(-8) >> 2);
CHECK_EQ(static_cast<intptr_t>(-2), static_cast<intptr_t>(-8) >> 2);
}
......
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