Commit 830ba4e7 authored by lrn@chromium.org's avatar lrn@chromium.org

X64: Fix incompatability with previous revision.

And fix bug in debug-mode of 32-bit smi.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 82a23141
......@@ -701,7 +701,7 @@ void MacroAssembler::SmiTryAddConstant(Register dst,
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));
......
......@@ -66,7 +66,7 @@ void VirtualFrame::Enter() {
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);
......
......@@ -713,21 +713,27 @@ THREADED_TEST(BigSmiInteger) {
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());
}
}
......
......@@ -109,7 +109,7 @@ TEST(Smi) {
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));
}
}
}
......
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