SlotRef::GetValue INT32 case needs to be 64bit big endian aware

On 64bit big endian systems fetch the correct 32bits from the slot

BUG=v8:3449
LOG=N
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/403003002

Patch from Andrew Low <andrew_low@ca.ibm.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 54b2f8da
......@@ -3268,7 +3268,11 @@ Handle<Object> SlotRef::GetValue(Isolate* isolate) {
return Handle<Object>(Memory::Object_at(addr_), isolate);
case INT32: {
#if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT
int value = Memory::int32_at(addr_ + kIntSize);
#else
int value = Memory::int32_at(addr_);
#endif
if (Smi::IsValid(value)) {
return Handle<Object>(Smi::FromInt(value), isolate);
} else {
......@@ -3277,7 +3281,11 @@ Handle<Object> SlotRef::GetValue(Isolate* isolate) {
}
case UINT32: {
#if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT
uint32_t value = Memory::uint32_at(addr_ + kIntSize);
#else
uint32_t value = Memory::uint32_at(addr_);
#endif
if (value <= static_cast<uint32_t>(Smi::kMaxValue)) {
return Handle<Object>(Smi::FromInt(static_cast<int>(value)), isolate);
} else {
......
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