| 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_macros.h" | 8 #include "vm/assembler_macros.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 DECLARE_FLAG(bool, inline_alloc); | 14 DECLARE_FLAG(bool, inline_alloc); |
| 15 | 15 |
| 16 #define __ assembler-> | 16 #define __ assembler-> |
| 17 | 17 |
| 18 // Static. | 18 // Static. |
| 19 void AssemblerMacros::TryAllocate(Assembler* assembler, | 19 void AssemblerMacros::TryAllocate(Assembler* assembler, |
| 20 const Class& cls, | 20 const Class& cls, |
| 21 Label* failure, | 21 Label* failure, |
| 22 Register instance_reg) { | 22 Register instance_reg) { |
| 23 #if defined(DEBUG) | |
| 24 __ Untested("AssemblerMacros::TryAllocate"); | |
| 25 #endif | |
| 26 ASSERT(failure != NULL); | 23 ASSERT(failure != NULL); |
| 27 if (FLAG_inline_alloc) { | 24 if (FLAG_inline_alloc) { |
| 28 Heap* heap = Isolate::Current()->heap(); | 25 Heap* heap = Isolate::Current()->heap(); |
| 29 const intptr_t instance_size = cls.instance_size(); | 26 const intptr_t instance_size = cls.instance_size(); |
| 30 __ movq(TMP, Immediate(heap->TopAddress())); | 27 __ movq(TMP, Immediate(heap->TopAddress())); |
| 31 __ movq(instance_reg, Address(TMP, 0)); | 28 __ movq(instance_reg, Address(TMP, 0)); |
| 32 __ addq(instance_reg, Immediate(instance_size)); | 29 __ addq(instance_reg, Immediate(instance_size)); |
| 33 // instance_reg: potential next object start. | 30 // instance_reg: potential next object start. |
| 34 __ movq(TMP, Immediate(heap->EndAddress())); | 31 __ movq(TMP, Immediate(heap->EndAddress())); |
| 35 __ cmpq(instance_reg, Address(TMP, 0)); | 32 __ cmpq(instance_reg, Address(TMP, 0)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { | 69 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { |
| 73 __ EnterFrame(0); | 70 __ EnterFrame(0); |
| 74 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. | 71 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. |
| 75 } | 72 } |
| 76 | 73 |
| 77 #undef __ | 74 #undef __ |
| 78 | 75 |
| 79 } // namespace dart | 76 } // namespace dart |
| 80 | 77 |
| 81 #endif // defined TARGET_ARCH_X64 | 78 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |