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 = {
'LINKFLAGS': ['-m32']
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'V8_LONG_SMI'],
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64'],
},
......@@ -200,7 +200,7 @@ LIBRARY_FLAGS = {
'ARFLAGS': ['/MACHINE:X86']
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'V8_LONG_SMI'],
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'LINKFLAGS': ['/MACHINE:X64'],
'ARFLAGS': ['/MACHINE:X64']
},
......
......@@ -756,7 +756,7 @@ class V8EXPORT Value : public Data {
/** JS == */
bool Equals(Handle<Value> that) const;
bool StrictEquals(Handle<Value> that) const;
private:
inline bool QuickIsString() const;
bool FullIsString() const;
......@@ -1036,7 +1036,7 @@ class V8EXPORT String : public Primitive {
Value(const Value&);
void operator=(const Value&);
};
private:
void VerifyExternalStringResource(ExternalStringResource* val) const;
static void CheckCast(v8::Value* obj);
......@@ -1194,7 +1194,7 @@ class V8EXPORT Object : public Value {
/** Gets a native pointer from an internal field. */
inline void* GetPointerFromInternalField(int index);
/** Sets a native pointer in an internal field. */
void SetPointerInInternalField(int index, void* value);
......@@ -1247,7 +1247,7 @@ class V8EXPORT Object : public Value {
bool SetHiddenValue(Handle<String> key, Handle<Value> value);
Local<Value> GetHiddenValue(Handle<String> key);
bool DeleteHiddenValue(Handle<String> key);
/**
* Returns true if this is an instance of an api function (one
* created from a function created from a function template) and has
......@@ -1281,7 +1281,7 @@ class V8EXPORT Object : public Value {
/**
* If quick access to the internal field is possible this method
* returns the value. Otherwise an empty handle is returned.
* returns the value. Otherwise an empty handle is returned.
*/
inline Local<Value> UncheckedGetInternalField(int index);
};
......@@ -2720,10 +2720,7 @@ const int kHeapObjectTag = 1;
const int kHeapObjectTagSize = 2;
const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1;
#ifdef V8_LONG_SMI
#ifndef V8_TARGET_ARCH_X64
#error "Large smis on non-64-bit platform."
#endif
#ifdef V8_TARGET_ARCH_X64
// Tag information for Smi.
const int kSmiTag = 0;
const int kSmiTagSize = 1;
......@@ -2774,7 +2771,7 @@ class Internals {
}
static inline int SmiValue(internal::Object* value) {
#ifdef V8_LONG_SMI
#ifdef V8_TARGET_ARCH_X64
int shift_bits = kSmiTagSize + kSmiShiftSize;
// Shift down and throw away top 32 bits.
return static_cast<int>(reinterpret_cast<intptr_t>(value) >> shift_bits);
......
......@@ -835,7 +835,7 @@ bool Smi::IsValid(intptr_t value) {
bool in_range = (value >= kMinValue) && (value <= kMaxValue);
#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.
bool result = (value == static_cast<int32_t>(value));
#else
......
This diff is collapsed.
......@@ -132,7 +132,7 @@ TEST(HeapObjects) {
CHECK(value->IsNumber());
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.
value = Heap::NumberFromInt32(Smi::kMinValue - 1);
CHECK(value->IsHeapNumber());
......
......@@ -1071,7 +1071,7 @@ TEST(SmiMul) {
void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) {
bool division_by_zero = (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.
#else
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