| 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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 ASSERT(object.IsZoneHandle()); | 1503 ASSERT(object.IsZoneHandle()); |
| 1504 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 1504 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 1505 EmitRegisterREX(dst, REX_W); | 1505 EmitRegisterREX(dst, REX_W); |
| 1506 EmitUint8(0xB8 | (dst & 7)); | 1506 EmitUint8(0xB8 | (dst & 7)); |
| 1507 buffer_.EmitObject(object); | 1507 buffer_.EmitObject(object); |
| 1508 } | 1508 } |
| 1509 } | 1509 } |
| 1510 | 1510 |
| 1511 | 1511 |
| 1512 void Assembler::StoreObject(const Address& dst, const Object& object) { | 1512 void Assembler::StoreObject(const Address& dst, const Object& object) { |
| 1513 LoadObject(TMP, object); | 1513 if (object.IsSmi()) { |
| 1514 movq(dst, TMP); | 1514 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); |
| 1515 } else { |
| 1516 LoadObject(TMP, object); |
| 1517 movq(dst, TMP); |
| 1518 } |
| 1515 } | 1519 } |
| 1516 | 1520 |
| 1517 | 1521 |
| 1518 void Assembler::PushObject(const Object& object) { | 1522 void Assembler::PushObject(const Object& object) { |
| 1519 if (object.IsSmi()) { | 1523 if (object.IsSmi()) { |
| 1520 pushq(Immediate(reinterpret_cast<int64_t>(object.raw()))); | 1524 pushq(Immediate(reinterpret_cast<int64_t>(object.raw()))); |
| 1521 } else { | 1525 } else { |
| 1522 LoadObject(TMP, object); | 1526 LoadObject(TMP, object); |
| 1523 pushq(TMP); | 1527 pushq(TMP); |
| 1524 } | 1528 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 | 1911 |
| 1908 const char* Assembler::RegisterName(Register reg) { | 1912 const char* Assembler::RegisterName(Register reg) { |
| 1909 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); | 1913 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); |
| 1910 return cpu_reg_names[reg]; | 1914 return cpu_reg_names[reg]; |
| 1911 } | 1915 } |
| 1912 | 1916 |
| 1913 | 1917 |
| 1914 } // namespace dart | 1918 } // namespace dart |
| 1915 | 1919 |
| 1916 #endif // defined TARGET_ARCH_X64 | 1920 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |