| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 | 1282 |
| 1283 void Assembler::cmpxchgq(const Address& address, Register reg) { | 1283 void Assembler::cmpxchgq(const Address& address, Register reg) { |
| 1284 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 1284 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 1285 EmitOperandREX(reg, address, REX_W); | 1285 EmitOperandREX(reg, address, REX_W); |
| 1286 EmitUint8(0x0F); | 1286 EmitUint8(0x0F); |
| 1287 EmitUint8(0xB1); | 1287 EmitUint8(0xB1); |
| 1288 EmitOperand(reg & 7, address); | 1288 EmitOperand(reg & 7, address); |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 | 1291 |
| 1292 void Assembler::CompareRegisters(Register a, Register b) { |
| 1293 cmpq(a, b); |
| 1294 } |
| 1295 |
| 1296 |
| 1297 void Assembler::MoveRegister(Register to, Register from) { |
| 1298 if (to != from) { |
| 1299 movq(to, from); |
| 1300 } |
| 1301 } |
| 1302 |
| 1303 |
| 1292 void Assembler::AddImmediate(Register reg, const Immediate& imm) { | 1304 void Assembler::AddImmediate(Register reg, const Immediate& imm) { |
| 1293 int64_t value = imm.value(); | 1305 int64_t value = imm.value(); |
| 1294 if (value > 0) { | 1306 if (value > 0) { |
| 1295 if (value == 1) { | 1307 if (value == 1) { |
| 1296 incq(reg); | 1308 incq(reg); |
| 1297 } else if (value != 0) { | 1309 } else if (value != 0) { |
| 1298 addq(reg, imm); | 1310 addq(reg, imm); |
| 1299 } | 1311 } |
| 1300 } else if (value < 0) { | 1312 } else if (value < 0) { |
| 1301 value = -value; | 1313 value = -value; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 comments.SetCommentAt(i, comments_[i]->comment()); | 1638 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1627 } | 1639 } |
| 1628 | 1640 |
| 1629 return comments; | 1641 return comments; |
| 1630 } | 1642 } |
| 1631 | 1643 |
| 1632 | 1644 |
| 1633 } // namespace dart | 1645 } // namespace dart |
| 1634 | 1646 |
| 1635 #endif // defined TARGET_ARCH_X64 | 1647 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |