Revision: 3039 Author: [email protected] Date: Thu Oct 8 06:09:28 2009 Log: X64: Fix incompatability with previous revision. And fix bug in debug-mode of 32-bit smi.
Review URL: http://codereview.chromium.org/261024 http://code.google.com/p/v8/source/detail?r=3039 Modified: /branches/bleeding_edge/src/x64/macro-assembler-x64.cc /branches/bleeding_edge/src/x64/virtual-frame-x64.cc /branches/bleeding_edge/test/cctest/test-api.cc /branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc ======================================= --- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Oct 8 05:54:29 2009 +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Oct 8 06:09:28 2009 @@ -701,7 +701,7 @@ Smi* constant, Label* on_not_smi_result) { // Does not assume that src is a smi. - ASSERT_EQ(1, kSmiTagMask); + ASSERT_EQ(static_cast<intptr_t>(1), kSmiTagMask); ASSERT_EQ(0, kSmiTag); ASSERT(!dst.is(kScratchRegister)); ASSERT(!src.is(kScratchRegister)); ======================================= --- /branches/bleeding_edge/src/x64/virtual-frame-x64.cc Thu Oct 8 05:36:12 2009 +++ /branches/bleeding_edge/src/x64/virtual-frame-x64.cc Thu Oct 8 06:09:28 2009 @@ -66,7 +66,7 @@ if (FLAG_debug_code) { // Verify that rdi contains a JS function. The following code // relies on rax being available for use. - Condition not_smi = masm()->CheckNotSmi(rdi); + Condition not_smi = NegateCondition(masm()->CheckSmi(rdi)); __ Check(not_smi, "VirtualFrame::Enter - rdi is not a function (smi check)."); __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); ======================================= --- /branches/bleeding_edge/test/cctest/test-api.cc Thu Oct 8 05:54:29 2009 +++ /branches/bleeding_edge/test/cctest/test-api.cc Thu Oct 8 06:09:28 2009 @@ -713,21 +713,27 @@ v8::HandleScope scope; LocalContext env; int32_t value = i::Smi::kMaxValue; - CHECK(i::Smi::IsValid(value)); - CHECK(!i::Smi::IsValid(value + 1)); - Local<v8::Integer> value_obj = v8::Integer::New(value); - CHECK_EQ(static_cast<int64_t>(value), value_obj->Value()); + // We cannot add one to a Smi::kMaxValue without wrapping. + if (i::kSmiValueSize < 32) { + CHECK(i::Smi::IsValid(value)); + CHECK(!i::Smi::IsValid(value + 1)); + Local<v8::Integer> value_obj = v8::Integer::New(value); + CHECK_EQ(static_cast<int64_t>(value), value_obj->Value()); + } } THREADED_TEST(BigInteger) { v8::HandleScope scope; LocalContext env; - int32_t value = i::Smi::kMaxValue + 1; - CHECK(value > i::Smi::kMaxValue); - CHECK(!i::Smi::IsValid(value)); - Local<v8::Integer> value_obj = v8::Integer::New(value); - CHECK_EQ(static_cast<int64_t>(value), value_obj->Value()); + // We cannot add one to a Smi::kMaxValue without wrapping. + if (i::kSmiValueSize < 32) { + int32_t value = i::Smi::kMaxValue + 1; + CHECK(value > i::Smi::kMaxValue); + CHECK(!i::Smi::IsValid(value)); + Local<v8::Integer> value_obj = v8::Integer::New(value); + CHECK_EQ(static_cast<int64_t>(value), value_obj->Value()); + } } ======================================= --- /branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc Thu Oct 8 05:36:12 2009 +++ /branches/bleeding_edge/test/cctest/test-macro-assembler-x64.cc Thu Oct 8 06:09:28 2009 @@ -109,7 +109,7 @@ CHECK_EQ(smi_from_int, smi_from_intptr); } int smi_value = smi_from_intptr->value(); - CHECK_EQ(number, smi_value); + CHECK_EQ(number, static_cast<intptr_t>(smi_value)); } } } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
