Commit 57676280 authored by lrn@chromium.org's avatar lrn@chromium.org

Removed 31-bit smis.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3f1db021
...@@ -174,7 +174,7 @@ LIBRARY_FLAGS = { ...@@ -174,7 +174,7 @@ LIBRARY_FLAGS = {
'LINKFLAGS': ['-m32'] 'LINKFLAGS': ['-m32']
}, },
'arch:x64': { 'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'V8_LONG_SMI'], 'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'CCFLAGS': ['-m64'], 'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64'], 'LINKFLAGS': ['-m64'],
}, },
...@@ -200,7 +200,7 @@ LIBRARY_FLAGS = { ...@@ -200,7 +200,7 @@ LIBRARY_FLAGS = {
'ARFLAGS': ['/MACHINE:X86'] 'ARFLAGS': ['/MACHINE:X86']
}, },
'arch:x64': { 'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'V8_LONG_SMI'], 'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'LINKFLAGS': ['/MACHINE:X64'], 'LINKFLAGS': ['/MACHINE:X64'],
'ARFLAGS': ['/MACHINE:X64'] 'ARFLAGS': ['/MACHINE:X64']
}, },
......
...@@ -2720,10 +2720,7 @@ const int kHeapObjectTag = 1; ...@@ -2720,10 +2720,7 @@ const int kHeapObjectTag = 1;
const int kHeapObjectTagSize = 2; const int kHeapObjectTagSize = 2;
const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1;
#ifdef V8_LONG_SMI #ifdef V8_TARGET_ARCH_X64
#ifndef V8_TARGET_ARCH_X64
#error "Large smis on non-64-bit platform."
#endif
// Tag information for Smi. // Tag information for Smi.
const int kSmiTag = 0; const int kSmiTag = 0;
const int kSmiTagSize = 1; const int kSmiTagSize = 1;
...@@ -2774,7 +2771,7 @@ class Internals { ...@@ -2774,7 +2771,7 @@ class Internals {
} }
static inline int SmiValue(internal::Object* value) { static inline int SmiValue(internal::Object* value) {
#ifdef V8_LONG_SMI #ifdef V8_TARGET_ARCH_X64
int shift_bits = kSmiTagSize + kSmiShiftSize; int shift_bits = kSmiTagSize + kSmiShiftSize;
// Shift down and throw away top 32 bits. // Shift down and throw away top 32 bits.
return static_cast<int>(reinterpret_cast<intptr_t>(value) >> shift_bits); return static_cast<int>(reinterpret_cast<intptr_t>(value) >> shift_bits);
......
...@@ -835,7 +835,7 @@ bool Smi::IsValid(intptr_t value) { ...@@ -835,7 +835,7 @@ bool Smi::IsValid(intptr_t value) {
bool in_range = (value >= kMinValue) && (value <= kMaxValue); bool in_range = (value >= kMinValue) && (value <= kMaxValue);
#endif #endif
#ifdef V8_LONG_SMI #ifdef V8_TARGET_ARCH_X64
// To be representable as a long smi, the value must be a 32-bit integer. // To be representable as a long smi, the value must be a 32-bit integer.
bool result = (value == static_cast<int32_t>(value)); bool result = (value == static_cast<int32_t>(value));
#else #else
......
This diff is collapsed.
...@@ -132,7 +132,7 @@ TEST(HeapObjects) { ...@@ -132,7 +132,7 @@ TEST(HeapObjects) {
CHECK(value->IsNumber()); CHECK(value->IsNumber());
CHECK_EQ(Smi::kMaxValue, Smi::cast(value)->value()); CHECK_EQ(Smi::kMaxValue, Smi::cast(value)->value());
#ifndef V8_LONG_SMI #ifndef V8_TARGET_ARCH_X64
// TODO(lrn): We need a NumberFromIntptr function in order to test this. // TODO(lrn): We need a NumberFromIntptr function in order to test this.
value = Heap::NumberFromInt32(Smi::kMinValue - 1); value = Heap::NumberFromInt32(Smi::kMinValue - 1);
CHECK(value->IsHeapNumber()); CHECK(value->IsHeapNumber());
......
...@@ -1071,7 +1071,7 @@ TEST(SmiMul) { ...@@ -1071,7 +1071,7 @@ TEST(SmiMul) {
void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) { void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) {
bool division_by_zero = (y == 0); bool division_by_zero = (y == 0);
bool negative_zero = (x == 0 && y < 0); bool negative_zero = (x == 0 && y < 0);
#ifdef V8_LONG_SMI #ifdef V8_TARGET_ARCH_X64
bool overflow = (x == Smi::kMinValue && y < 0); // Safe approx. used. bool overflow = (x == Smi::kMinValue && y < 0); // Safe approx. used.
#else #else
bool overflow = (x == Smi::kMinValue && y == -1); bool overflow = (x == Smi::kMinValue && y == -1);
......
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