| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 | 1903 |
| 1904 void LCodeGen::DoConstantS(LConstantS* instr) { | 1904 void LCodeGen::DoConstantS(LConstantS* instr) { |
| 1905 __ Move(ToRegister(instr->result()), Immediate(instr->value())); | 1905 __ Move(ToRegister(instr->result()), Immediate(instr->value())); |
| 1906 } | 1906 } |
| 1907 | 1907 |
| 1908 | 1908 |
| 1909 void LCodeGen::DoConstantD(LConstantD* instr) { | 1909 void LCodeGen::DoConstantD(LConstantD* instr) { |
| 1910 double v = instr->value(); | 1910 double v = instr->value(); |
| 1911 uint64_t int_val = BitCast<uint64_t, double>(v); | 1911 uint64_t int_val = bit_cast<uint64_t, double>(v); |
| 1912 int32_t lower = static_cast<int32_t>(int_val); | 1912 int32_t lower = static_cast<int32_t>(int_val); |
| 1913 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); | 1913 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); |
| 1914 DCHECK(instr->result()->IsDoubleRegister()); | 1914 DCHECK(instr->result()->IsDoubleRegister()); |
| 1915 | 1915 |
| 1916 __ push(Immediate(upper)); | 1916 __ push(Immediate(upper)); |
| 1917 __ push(Immediate(lower)); | 1917 __ push(Immediate(lower)); |
| 1918 X87Register reg = ToX87Register(instr->result()); | 1918 X87Register reg = ToX87Register(instr->result()); |
| 1919 X87Mov(reg, Operand(esp, 0)); | 1919 X87Mov(reg, Operand(esp, 0)); |
| 1920 __ add(Operand(esp), Immediate(kDoubleSize)); | 1920 __ add(Operand(esp), Immediate(kDoubleSize)); |
| 1921 } | 1921 } |
| (...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4081 instr->key(), | 4081 instr->key(), |
| 4082 instr->hydrogen()->key()->representation(), | 4082 instr->hydrogen()->key()->representation(), |
| 4083 FAST_DOUBLE_ELEMENTS, | 4083 FAST_DOUBLE_ELEMENTS, |
| 4084 instr->base_offset()); | 4084 instr->base_offset()); |
| 4085 | 4085 |
| 4086 // Can't use SSE2 in the serializer | 4086 // Can't use SSE2 in the serializer |
| 4087 if (instr->hydrogen()->IsConstantHoleStore()) { | 4087 if (instr->hydrogen()->IsConstantHoleStore()) { |
| 4088 // This means we should store the (double) hole. No floating point | 4088 // This means we should store the (double) hole. No floating point |
| 4089 // registers required. | 4089 // registers required. |
| 4090 double nan_double = FixedDoubleArray::hole_nan_as_double(); | 4090 double nan_double = FixedDoubleArray::hole_nan_as_double(); |
| 4091 uint64_t int_val = BitCast<uint64_t, double>(nan_double); | 4091 uint64_t int_val = bit_cast<uint64_t, double>(nan_double); |
| 4092 int32_t lower = static_cast<int32_t>(int_val); | 4092 int32_t lower = static_cast<int32_t>(int_val); |
| 4093 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); | 4093 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); |
| 4094 | 4094 |
| 4095 __ mov(double_store_operand, Immediate(lower)); | 4095 __ mov(double_store_operand, Immediate(lower)); |
| 4096 Operand double_store_operand2 = BuildFastArrayOperand( | 4096 Operand double_store_operand2 = BuildFastArrayOperand( |
| 4097 instr->elements(), | 4097 instr->elements(), |
| 4098 instr->key(), | 4098 instr->key(), |
| 4099 instr->hydrogen()->key()->representation(), | 4099 instr->hydrogen()->key()->representation(), |
| 4100 FAST_DOUBLE_ELEMENTS, | 4100 FAST_DOUBLE_ELEMENTS, |
| 4101 instr->base_offset() + kPointerSize); | 4101 instr->base_offset() + kPointerSize); |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5704 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5704 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5705 } | 5705 } |
| 5706 | 5706 |
| 5707 | 5707 |
| 5708 #undef __ | 5708 #undef __ |
| 5709 | 5709 |
| 5710 } } // namespace v8::internal | 5710 } } // namespace v8::internal |
| 5711 | 5711 |
| 5712 #endif // V8_TARGET_ARCH_X87 | 5712 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |