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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 // R0: potential new object start. | 671 // R0: potential new object start. |
672 // R7: potential next object start. | 672 // R7: potential next object start. |
673 // R9: allocation size. | 673 // R9: allocation size. |
674 __ LoadImmediate(R3, heap->EndAddress(space)); | 674 __ LoadImmediate(R3, heap->EndAddress(space)); |
675 __ ldr(R3, Address(R3, 0)); | 675 __ ldr(R3, Address(R3, 0)); |
676 __ cmp(R7, Operand(R3)); | 676 __ cmp(R7, Operand(R3)); |
677 __ b(&slow_case, CS); | 677 __ b(&slow_case, CS); |
678 | 678 |
679 // Successfully allocated the object(s), now update top to point to | 679 // Successfully allocated the object(s), now update top to point to |
680 // next object start and initialize the object. | 680 // next object start and initialize the object. |
681 __ LoadAllocationStatsAddress(R3, cid, space); | 681 __ LoadAllocationStatsAddress(R3, cid); |
682 __ str(R7, Address(R6, 0)); | 682 __ str(R7, Address(R6, 0)); |
683 __ add(R0, R0, Operand(kHeapObjectTag)); | 683 __ add(R0, R0, Operand(kHeapObjectTag)); |
684 | 684 |
685 // Initialize the tags. | 685 // Initialize the tags. |
686 // R0: new object start as a tagged pointer. | 686 // R0: new object start as a tagged pointer. |
687 // R3: allocation stats address. | 687 // R3: allocation stats address. |
688 // R7: new object end address. | 688 // R7: new object end address. |
689 // R9: allocation size. | 689 // R9: allocation size. |
690 { | 690 { |
691 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; | 691 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 906 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
907 } | 907 } |
908 | 908 |
909 // Successfully allocated the object, now update top to point to | 909 // Successfully allocated the object, now update top to point to |
910 // next object start and initialize the object. | 910 // next object start and initialize the object. |
911 // R0: new object start (untagged). | 911 // R0: new object start (untagged). |
912 // R1: number of context variables. | 912 // R1: number of context variables. |
913 // R2: object size. | 913 // R2: object size. |
914 // R3: next object start. | 914 // R3: next object start. |
915 // R5: top address. | 915 // R5: top address. |
916 __ LoadAllocationStatsAddress(R6, cid, space); | 916 __ LoadAllocationStatsAddress(R6, cid); |
917 __ str(R3, Address(R5, 0)); | 917 __ str(R3, Address(R5, 0)); |
918 __ add(R0, R0, Operand(kHeapObjectTag)); | 918 __ add(R0, R0, Operand(kHeapObjectTag)); |
919 | 919 |
920 // Calculate the size tag. | 920 // Calculate the size tag. |
921 // R0: new object (tagged). | 921 // R0: new object (tagged). |
922 // R1: number of context variables. | 922 // R1: number of context variables. |
923 // R2: object size. | 923 // R2: object size. |
924 // R3: next object start. | 924 // R3: next object start. |
925 // R6: allocation stats address. | 925 // R6: allocation stats address. |
926 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; | 926 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 __ cmp(R1, Operand(IP)); | 1101 __ cmp(R1, Operand(IP)); |
1102 if (FLAG_use_slow_path) { | 1102 if (FLAG_use_slow_path) { |
1103 __ b(&slow_case); | 1103 __ b(&slow_case); |
1104 } else { | 1104 } else { |
1105 __ b(&slow_case, CS); // Unsigned higher or equal. | 1105 __ b(&slow_case, CS); // Unsigned higher or equal. |
1106 } | 1106 } |
1107 __ str(R1, Address(R5, 0)); | 1107 __ str(R1, Address(R5, 0)); |
1108 | 1108 |
1109 // Load the address of the allocation stats table. We split up the load | 1109 // Load the address of the allocation stats table. We split up the load |
1110 // and the increment so that the dependent load is not too nearby. | 1110 // and the increment so that the dependent load is not too nearby. |
1111 __ LoadAllocationStatsAddress(R5, cls.id(), space); | 1111 __ LoadAllocationStatsAddress(R5, cls.id()); |
1112 | 1112 |
1113 // R0: new object start. | 1113 // R0: new object start. |
1114 // R1: next object start. | 1114 // R1: next object start. |
1115 // R5: allocation stats table. | 1115 // R5: allocation stats table. |
1116 // Set the tags. | 1116 // Set the tags. |
1117 uword tags = 0; | 1117 uword tags = 0; |
1118 tags = RawObject::SizeTag::update(instance_size, tags); | 1118 tags = RawObject::SizeTag::update(instance_size, tags); |
1119 ASSERT(cls.id() != kIllegalCid); | 1119 ASSERT(cls.id() != kIllegalCid); |
1120 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1120 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
1121 __ LoadImmediate(R2, tags); | 1121 __ LoadImmediate(R2, tags); |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 // Result: | 2123 // Result: |
2124 // R1: entry point. | 2124 // R1: entry point. |
2125 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2125 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2126 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2126 EmitMegamorphicLookup(assembler, R0, R1, R1); |
2127 __ Ret(); | 2127 __ Ret(); |
2128 } | 2128 } |
2129 | 2129 |
2130 } // namespace dart | 2130 } // namespace dart |
2131 | 2131 |
2132 #endif // defined TARGET_ARCH_ARM | 2132 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |