OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 cmpl(value, Immediate( | 1587 cmpl(value, Immediate( |
1588 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + | 1588 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + |
1589 kOldObjectAlignmentOffset + kHeapObjectTag)); | 1589 kOldObjectAlignmentOffset + kHeapObjectTag)); |
1590 j(NOT_ZERO, no_update, Assembler::kNearJump); | 1590 j(NOT_ZERO, no_update, Assembler::kNearJump); |
1591 } | 1591 } |
1592 | 1592 |
1593 | 1593 |
1594 void Assembler::StoreIntoObject(Register object, | 1594 void Assembler::StoreIntoObject(Register object, |
1595 const FieldAddress& dest, | 1595 const FieldAddress& dest, |
1596 Register value) { | 1596 Register value) { |
1597 // TODO(kmillikin): pass temp registers to avoid pushing registers. | 1597 ASSERT(object != value); |
1598 movq(dest, value); | 1598 movq(dest, value); |
1599 | |
1600 Label done; | 1599 Label done; |
1601 pushq(value); | |
1602 StoreIntoObjectFilter(object, value, &done); | 1600 StoreIntoObjectFilter(object, value, &done); |
1603 // A store buffer update is required. | 1601 // A store buffer update is required. |
1604 if (value != RAX) pushq(RAX); | 1602 if (value != RAX) pushq(RAX); |
1605 leaq(RAX, dest); | 1603 leaq(RAX, dest); |
1606 call(&StubCode::UpdateStoreBufferLabel()); | 1604 call(&StubCode::UpdateStoreBufferLabel()); |
1607 if (value != RAX) popq(RAX); | 1605 if (value != RAX) popq(RAX); |
1608 Bind(&done); | 1606 Bind(&done); |
1609 popq(value); | |
1610 } | 1607 } |
1611 | 1608 |
1612 | 1609 |
1613 void Assembler::StoreIntoObjectNoBarrier(Register object, | 1610 void Assembler::StoreIntoObjectNoBarrier(Register object, |
1614 const FieldAddress& dest, | 1611 const FieldAddress& dest, |
1615 Register value) { | 1612 Register value) { |
1616 movq(dest, value); | 1613 movq(dest, value); |
1617 #if defined(DEBUG) | 1614 #if defined(DEBUG) |
1618 Label done; | 1615 Label done; |
1619 pushq(value); | 1616 pushq(value); |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 | 1984 |
1988 const char* Assembler::XmmRegisterName(XmmRegister reg) { | 1985 const char* Assembler::XmmRegisterName(XmmRegister reg) { |
1989 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 1986 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
1990 return xmm_reg_names[reg]; | 1987 return xmm_reg_names[reg]; |
1991 } | 1988 } |
1992 | 1989 |
1993 | 1990 |
1994 } // namespace dart | 1991 } // namespace dart |
1995 | 1992 |
1996 #endif // defined TARGET_ARCH_X64 | 1993 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |