OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 addl(instance_reg, Immediate(instance_size)); | 2636 addl(instance_reg, Immediate(instance_size)); |
2637 // instance_reg: potential next object start. | 2637 // instance_reg: potential next object start. |
2638 cmpl(instance_reg, Address(temp_reg, Heap::EndOffset(space))); | 2638 cmpl(instance_reg, Address(temp_reg, Heap::EndOffset(space))); |
2639 j(ABOVE_EQUAL, failure, near_jump); | 2639 j(ABOVE_EQUAL, failure, near_jump); |
2640 // Successfully allocated the object, now update top to point to | 2640 // Successfully allocated the object, now update top to point to |
2641 // next object start and store the class in the class field of object. | 2641 // next object start and store the class in the class field of object. |
2642 movl(Address(temp_reg, Heap::TopOffset(space)), instance_reg); | 2642 movl(Address(temp_reg, Heap::TopOffset(space)), instance_reg); |
2643 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space)); | 2643 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space)); |
2644 ASSERT(instance_size >= kHeapObjectTag); | 2644 ASSERT(instance_size >= kHeapObjectTag); |
2645 subl(instance_reg, Immediate(instance_size - kHeapObjectTag)); | 2645 subl(instance_reg, Immediate(instance_size - kHeapObjectTag)); |
2646 uword tags = 0; | 2646 uint32_t tags = 0; |
2647 tags = RawObject::SizeTag::update(instance_size, tags); | 2647 tags = RawObject::SizeTag::update(instance_size, tags); |
2648 ASSERT(cls.id() != kIllegalCid); | 2648 ASSERT(cls.id() != kIllegalCid); |
2649 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 2649 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
2650 movl(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); | 2650 movl(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); |
2651 } else { | 2651 } else { |
2652 jmp(failure); | 2652 jmp(failure); |
2653 } | 2653 } |
2654 } | 2654 } |
2655 | 2655 |
2656 | 2656 |
(...skipping 26 matching lines...) Expand all Loading... |
2683 j(ABOVE_EQUAL, failure); | 2683 j(ABOVE_EQUAL, failure); |
2684 | 2684 |
2685 // Successfully allocated the object(s), now update top to point to | 2685 // Successfully allocated the object(s), now update top to point to |
2686 // next object start and initialize the object. | 2686 // next object start and initialize the object. |
2687 movl(Address(temp_reg, Heap::TopOffset(space)), end_address); | 2687 movl(Address(temp_reg, Heap::TopOffset(space)), end_address); |
2688 addl(instance, Immediate(kHeapObjectTag)); | 2688 addl(instance, Immediate(kHeapObjectTag)); |
2689 NOT_IN_PRODUCT( | 2689 NOT_IN_PRODUCT( |
2690 UpdateAllocationStatsWithSize(cid, instance_size, temp_reg, space)); | 2690 UpdateAllocationStatsWithSize(cid, instance_size, temp_reg, space)); |
2691 | 2691 |
2692 // Initialize the tags. | 2692 // Initialize the tags. |
2693 uword tags = 0; | 2693 uint32_t tags = 0; |
2694 tags = RawObject::ClassIdTag::update(cid, tags); | 2694 tags = RawObject::ClassIdTag::update(cid, tags); |
2695 tags = RawObject::SizeTag::update(instance_size, tags); | 2695 tags = RawObject::SizeTag::update(instance_size, tags); |
2696 movl(FieldAddress(instance, Object::tags_offset()), Immediate(tags)); | 2696 movl(FieldAddress(instance, Object::tags_offset()), Immediate(tags)); |
2697 } else { | 2697 } else { |
2698 jmp(failure); | 2698 jmp(failure); |
2699 } | 2699 } |
2700 } | 2700 } |
2701 | 2701 |
2702 | 2702 |
2703 void Assembler::PushCodeObject() { | 2703 void Assembler::PushCodeObject() { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3022 | 3022 |
3023 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3023 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
3024 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3024 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
3025 return xmm_reg_names[reg]; | 3025 return xmm_reg_names[reg]; |
3026 } | 3026 } |
3027 | 3027 |
3028 | 3028 |
3029 } // namespace dart | 3029 } // namespace dart |
3030 | 3030 |
3031 #endif // defined TARGET_ARCH_IA32 | 3031 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |