Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: runtime/vm/assembler_x64.cc

Issue 10909169: Add support for WritableRegister policy in the register allocator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1599 Label done, fail;
1600 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.
1602 pushq(RCX);
1603 pushq(RDX);
1604 pushq(RBX);
1604 if (value != RAX) pushq(RAX); 1605 if (value != RAX) pushq(RAX);
1605 leaq(RAX, dest); 1606 leaq(RAX, dest);
1606 call(&StubCode::UpdateStoreBufferLabel()); 1607 call(&StubCode::UpdateStoreBufferLabel());
1607 if (value != RAX) popq(RAX); 1608 if (value != RAX) popq(RAX);
1609 cmpq(RBX, Address(RSP, 0));
Ivan Posva 2012/09/11 11:57:30 ?
Vyacheslav Egorov (Google) 2012/09/11 12:18:05 reverted
1610 j(NOT_ZERO, &fail);
1611 popq(RBX);
1612
1613 cmpq(RDX, Address(RSP, 0));
1614 j(NOT_ZERO, &fail);
1615 popq(RDX);
1616
1617 cmpq(RCX, Address(RSP, 0));
1618 j(NOT_ZERO, &fail);
1619 popq(RCX);
1620
1621 jmp(&done);
1622
1623 Bind(&fail);
1624 int3();
1625
1608 Bind(&done); 1626 Bind(&done);
1609 popq(value);
1610 } 1627 }
1611 1628
1612 1629
1613 void Assembler::StoreIntoObjectNoBarrier(Register object, 1630 void Assembler::StoreIntoObjectNoBarrier(Register object,
1614 const FieldAddress& dest, 1631 const FieldAddress& dest,
1615 Register value) { 1632 Register value) {
1616 movq(dest, value); 1633 movq(dest, value);
1617 #if defined(DEBUG) 1634 #if defined(DEBUG)
1618 Label done; 1635 Label done;
1619 pushq(value); 1636 pushq(value);
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 2004
1988 const char* Assembler::XmmRegisterName(XmmRegister reg) { 2005 const char* Assembler::XmmRegisterName(XmmRegister reg) {
1989 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2006 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
1990 return xmm_reg_names[reg]; 2007 return xmm_reg_names[reg];
1991 } 2008 }
1992 2009
1993 2010
1994 } // namespace dart 2011 } // namespace dart
1995 2012
1996 #endif // defined TARGET_ARCH_X64 2013 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698