| 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 21 matching lines...) Expand all Loading... |
| 32 __ cmpq(instance_reg, Address(TMP, 0)); | 32 __ cmpq(instance_reg, Address(TMP, 0)); |
| 33 __ j(ABOVE_EQUAL, failure, Assembler::kNearJump); | 33 __ j(ABOVE_EQUAL, failure, Assembler::kNearJump); |
| 34 // Successfully allocated the object, now update top to point to | 34 // Successfully allocated the object, now update top to point to |
| 35 // next object start and store the class in the class field of object. | 35 // next object start and store the class in the class field of object. |
| 36 __ movq(TMP, Immediate(heap->TopAddress())); | 36 __ movq(TMP, Immediate(heap->TopAddress())); |
| 37 __ movq(Address(TMP, 0), instance_reg); | 37 __ movq(Address(TMP, 0), instance_reg); |
| 38 ASSERT(instance_size >= kHeapObjectTag); | 38 ASSERT(instance_size >= kHeapObjectTag); |
| 39 __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag)); | 39 __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag)); |
| 40 uword tags = 0; | 40 uword tags = 0; |
| 41 tags = RawObject::SizeTag::update(instance_size, tags); | 41 tags = RawObject::SizeTag::update(instance_size, tags); |
| 42 ASSERT(cls.id() != kIllegalObjectKind); | 42 ASSERT(cls.id() != kIllegalCid); |
| 43 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 43 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
| 44 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); | 44 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); |
| 45 } else { | 45 } else { |
| 46 __ jmp(failure); | 46 __ jmp(failure); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 void AssemblerMacros::EnterDartFrame(Assembler* assembler, | 51 void AssemblerMacros::EnterDartFrame(Assembler* assembler, |
| 52 intptr_t frame_size) { | 52 intptr_t frame_size) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 83 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { | 83 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { |
| 84 __ EnterFrame(0); | 84 __ EnterFrame(0); |
| 85 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. | 85 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. |
| 86 } | 86 } |
| 87 | 87 |
| 88 #undef __ | 88 #undef __ |
| 89 | 89 |
| 90 } // namespace dart | 90 } // namespace dart |
| 91 | 91 |
| 92 #endif // defined TARGET_ARCH_X64 | 92 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |