| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 __ j(ABOVE_EQUAL, failure, Assembler::kNearJump); | 44 __ j(ABOVE_EQUAL, failure, Assembler::kNearJump); |
| 45 // Successfully allocated the object, now update top to point to | 45 // Successfully allocated the object, now update top to point to |
| 46 // next object start and store the class in the class field of object. | 46 // next object start and store the class in the class field of object. |
| 47 __ movq(TMP, Immediate(heap->TopAddress())); | 47 __ movq(TMP, Immediate(heap->TopAddress())); |
| 48 __ movq(Address(TMP, 0), instance_reg); | 48 __ movq(Address(TMP, 0), instance_reg); |
| 49 ASSERT(instance_size >= kHeapObjectTag); | 49 ASSERT(instance_size >= kHeapObjectTag); |
| 50 __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag)); | 50 __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag)); |
| 51 __ StoreIntoObject(instance_reg, | 51 __ StoreIntoObject(instance_reg, |
| 52 FieldAddress(instance_reg, Instance::class_offset()), | 52 FieldAddress(instance_reg, Instance::class_offset()), |
| 53 class_reg); | 53 class_reg); |
| 54 intptr_t tags = 0; | 54 uword tags = 0; |
| 55 tags = RawObject::SizeTag::update(instance_size, tags); | 55 tags = RawObject::SizeTag::update(instance_size, tags); |
| 56 ASSERT(cls.index() != kIllegalObjectKind); | 56 ASSERT(cls.index() != kIllegalObjectKind); |
| 57 tags = RawObject::ClassTag::update(cls.index(), tags); | 57 tags = RawObject::ClassTag::update(cls.index(), tags); |
| 58 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); | 58 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); |
| 59 } else { | 59 } else { |
| 60 __ jmp(failure); | 60 __ jmp(failure); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 #undef __ | 64 #undef __ |
| 65 | 65 |
| 66 } // namespace dart | 66 } // namespace dart |
| 67 | 67 |
| 68 #endif // defined TARGET_ARCH_X64 | 68 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |