| 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 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 decq(reg); | 1284 decq(reg); |
| 1285 } else if (value != 0) { | 1285 } else if (value != 0) { |
| 1286 subq(reg, Immediate(value)); | 1286 subq(reg, Immediate(value)); |
| 1287 } | 1287 } |
| 1288 } | 1288 } |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 | 1291 |
| 1292 void Assembler::Drop(intptr_t stack_elements) { | 1292 void Assembler::Drop(intptr_t stack_elements) { |
| 1293 ASSERT(stack_elements >= 0); | 1293 ASSERT(stack_elements >= 0); |
| 1294 if (stack_elements > 0) { | 1294 if (stack_elements <= 4) { |
| 1295 // TODO(fschneider): When optimizing for code size, we could | 1295 for (intptr_t i = 0; i < stack_elements; i++) { |
| 1296 // consider using pop for stack_elements < 4 instead. | 1296 popq(TMP); |
| 1297 addq(RSP, Immediate(stack_elements * kWordSize)); | 1297 } |
| 1298 return; |
| 1298 } | 1299 } |
| 1300 addq(RSP, Immediate(stack_elements * kWordSize)); |
| 1299 } | 1301 } |
| 1300 | 1302 |
| 1301 | 1303 |
| 1302 void Assembler::LoadObject(Register dst, const Object& object) { | 1304 void Assembler::LoadObject(Register dst, const Object& object) { |
| 1303 if (object.IsSmi()) { | 1305 if (object.IsSmi()) { |
| 1304 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); | 1306 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); |
| 1305 } else { | 1307 } else { |
| 1306 ASSERT(object.IsZoneHandle()); | 1308 ASSERT(object.IsZoneHandle()); |
| 1307 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 1309 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 1308 EmitRegisterREX(dst, REX_W); | 1310 EmitRegisterREX(dst, REX_W); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 comments.SetCommentAt(i, comments_[i]->comment()); | 1565 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1564 } | 1566 } |
| 1565 | 1567 |
| 1566 return comments; | 1568 return comments; |
| 1567 } | 1569 } |
| 1568 | 1570 |
| 1569 | 1571 |
| 1570 } // namespace dart | 1572 } // namespace dart |
| 1571 | 1573 |
| 1572 #endif // defined TARGET_ARCH_X64 | 1574 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |