| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 ASSERT(value.IsOld()); | 2252 ASSERT(value.IsOld()); |
| 2253 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 2253 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 2254 EmitUint8(0xC7); | 2254 EmitUint8(0xC7); |
| 2255 EmitOperand(0, dest); | 2255 EmitOperand(0, dest); |
| 2256 buffer_.EmitObject(value); | 2256 buffer_.EmitObject(value); |
| 2257 } | 2257 } |
| 2258 // No store buffer update. | 2258 // No store buffer update. |
| 2259 } | 2259 } |
| 2260 | 2260 |
| 2261 | 2261 |
| 2262 void Assembler::StoreIntoSmiField(const Address& dest, Register value) { |
| 2263 movl(dest, value); |
| 2264 #if defined(DEBUG) |
| 2265 Label done; |
| 2266 testl(value, Immediate(kHeapObjectTag)); |
| 2267 j(ZERO, &done); |
| 2268 Stop("Smi expected"); |
| 2269 Bind(&done); |
| 2270 #endif // defined(DEBUG) |
| 2271 } |
| 2272 |
| 2273 |
| 2274 void Assembler::IncrementSmiField(const Address& dest, int32_t increment) { |
| 2275 // TODO(koda): Implement testl for addresses and check that dest is a smi. |
| 2276 addl(dest, Immediate(Smi::RawValue(increment))); |
| 2277 } |
| 2278 |
| 2279 |
| 2262 void Assembler::LoadDoubleConstant(XmmRegister dst, double value) { | 2280 void Assembler::LoadDoubleConstant(XmmRegister dst, double value) { |
| 2263 // TODO(5410843): Need to have a code constants table. | 2281 // TODO(5410843): Need to have a code constants table. |
| 2264 int64_t constant = bit_cast<int64_t, double>(value); | 2282 int64_t constant = bit_cast<int64_t, double>(value); |
| 2265 pushl(Immediate(Utils::High32Bits(constant))); | 2283 pushl(Immediate(Utils::High32Bits(constant))); |
| 2266 pushl(Immediate(Utils::Low32Bits(constant))); | 2284 pushl(Immediate(Utils::Low32Bits(constant))); |
| 2267 movsd(dst, Address(ESP, 0)); | 2285 movsd(dst, Address(ESP, 0)); |
| 2268 addl(ESP, Immediate(2 * kWordSize)); | 2286 addl(ESP, Immediate(2 * kWordSize)); |
| 2269 } | 2287 } |
| 2270 | 2288 |
| 2271 | 2289 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 | 2896 |
| 2879 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2897 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 2880 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2898 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2881 return xmm_reg_names[reg]; | 2899 return xmm_reg_names[reg]; |
| 2882 } | 2900 } |
| 2883 | 2901 |
| 2884 | 2902 |
| 2885 } // namespace dart | 2903 } // namespace dart |
| 2886 | 2904 |
| 2887 #endif // defined TARGET_ARCH_IA32 | 2905 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |