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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 // R3: array size. | 616 // R3: array size. |
617 // R7: potential next object start. | 617 // R7: potential next object start. |
618 // R8: points to new space object. | 618 // R8: points to new space object. |
619 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset()); | 619 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset()); |
620 __ cmp(R7, ShifterOperand(IP)); | 620 __ cmp(R7, ShifterOperand(IP)); |
621 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 621 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
622 | 622 |
623 // Successfully allocated the object(s), now update top to point to | 623 // Successfully allocated the object(s), now update top to point to |
624 // next object start and initialize the object. | 624 // next object start and initialize the object. |
625 // R0: potential new object start. | 625 // R0: potential new object start. |
| 626 // R3: array size. |
626 // R7: potential next object start. | 627 // R7: potential next object start. |
627 // R8: Points to new space object. | 628 // R8: Points to new space object. |
628 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); | 629 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); |
629 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); | 630 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
| 631 __ UpdateAllocationStatsWithSize(kArrayCid, R3, R8); |
630 | 632 |
631 // R0: new object start as a tagged pointer. | 633 // R0: new object start as a tagged pointer. |
632 // R1: array element type. | 634 // R1: array element type. |
633 // R2: array length as Smi. | 635 // R2: array length as Smi. |
634 // R3: array size. | 636 // R3: array size. |
635 // R7: new object end address. | 637 // R7: new object end address. |
636 | 638 |
637 // Store the type argument field. | 639 // Store the type argument field. |
638 __ StoreIntoObjectNoBarrier( | 640 __ StoreIntoObjectNoBarrier( |
639 R0, | 641 R0, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 } | 954 } |
953 | 955 |
954 // Successfully allocated the object, now update top to point to | 956 // Successfully allocated the object, now update top to point to |
955 // next object start and initialize the object. | 957 // next object start and initialize the object. |
956 // R0: new object. | 958 // R0: new object. |
957 // R1: number of context variables. | 959 // R1: number of context variables. |
958 // R2: object size. | 960 // R2: object size. |
959 // R3: next object start. | 961 // R3: next object start. |
960 __ str(R3, Address(R5, 0)); | 962 __ str(R3, Address(R5, 0)); |
961 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); | 963 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
| 964 __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5); |
962 | 965 |
963 // Calculate the size tag. | 966 // Calculate the size tag. |
964 // R0: new object. | 967 // R0: new object. |
965 // R1: number of context variables. | 968 // R1: number of context variables. |
966 // R2: object size. | 969 // R2: object size. |
967 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; | 970 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; |
968 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); | 971 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); |
969 // If no size tag overflow, shift R2 left, else set R2 to zero. | 972 // If no size tag overflow, shift R2 left, else set R2 to zero. |
970 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); | 973 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); |
971 __ mov(R2, ShifterOperand(0), HI); | 974 __ mov(R2, ShifterOperand(0), HI); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 __ cmp(R3, ShifterOperand(IP)); | 1137 __ cmp(R3, ShifterOperand(IP)); |
1135 if (FLAG_use_slow_path) { | 1138 if (FLAG_use_slow_path) { |
1136 __ b(&slow_case); | 1139 __ b(&slow_case); |
1137 } else { | 1140 } else { |
1138 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 1141 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
1139 } | 1142 } |
1140 | 1143 |
1141 // Successfully allocated the object(s), now update top to point to | 1144 // Successfully allocated the object(s), now update top to point to |
1142 // next object start and initialize the object. | 1145 // next object start and initialize the object. |
1143 __ str(R3, Address(R5, 0)); | 1146 __ str(R3, Address(R5, 0)); |
| 1147 __ UpdateAllocationStats(cls.id(), R5); |
1144 | 1148 |
1145 if (is_cls_parameterized) { | 1149 if (is_cls_parameterized) { |
1146 // Initialize the type arguments field in the object. | 1150 // Initialize the type arguments field in the object. |
1147 // R2: new object start. | 1151 // R2: new object start. |
1148 // R4: potential new object end and, if R4 != R3, potential new | 1152 // R4: potential new object end and, if R4 != R3, potential new |
1149 // InstantiatedTypeArguments object start. | 1153 // InstantiatedTypeArguments object start. |
1150 // R3: next object start. | 1154 // R3: next object start. |
1151 Label type_arguments_ready; | 1155 Label type_arguments_ready; |
1152 __ cmp(R4, ShifterOperand(R3)); | 1156 __ cmp(R4, ShifterOperand(R3)); |
1153 __ b(&type_arguments_ready, EQ); | 1157 __ b(&type_arguments_ready, EQ); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 if (FLAG_use_slow_path) { | 1303 if (FLAG_use_slow_path) { |
1300 __ b(&slow_case); | 1304 __ b(&slow_case); |
1301 } else { | 1305 } else { |
1302 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 1306 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
1303 } | 1307 } |
1304 | 1308 |
1305 // Successfully allocated the object, now update top to point to | 1309 // Successfully allocated the object, now update top to point to |
1306 // next object start and initialize the object. | 1310 // next object start and initialize the object. |
1307 __ str(R3, Address(R5, 0)); | 1311 __ str(R3, Address(R5, 0)); |
1308 | 1312 |
| 1313 if (is_implicit_instance_closure) { |
| 1314 // This closure allocates a context, update allocation stats. |
| 1315 // R3: context size. |
| 1316 __ LoadImmediate(R3, context_size); |
| 1317 // R5: Clobbered. |
| 1318 __ UpdateAllocationStatsWithSize(kContextCid, R3, R5); |
| 1319 } |
| 1320 // The closure allocation is attributed to the signature class. |
| 1321 // R5: Will be clobbered. |
| 1322 __ UpdateAllocationStats(cls.id(), R5); |
| 1323 |
1309 // R2: new closure object. | 1324 // R2: new closure object. |
1310 // R4: new context object (only if is_implicit_closure). | 1325 // R4: new context object (only if is_implicit_closure). |
1311 // Set the tags. | 1326 // Set the tags. |
1312 uword tags = 0; | 1327 uword tags = 0; |
1313 tags = RawObject::SizeTag::update(closure_size, tags); | 1328 tags = RawObject::SizeTag::update(closure_size, tags); |
1314 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1329 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
1315 __ LoadImmediate(R0, tags); | 1330 __ LoadImmediate(R0, tags); |
1316 __ str(R0, Address(R2, Instance::tags_offset())); | 1331 __ str(R0, Address(R2, Instance::tags_offset())); |
1317 | 1332 |
1318 // Initialize the function field in the object. | 1333 // Initialize the function field in the object. |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 const Register right = R0; | 2135 const Register right = R0; |
2121 __ ldr(left, Address(SP, 1 * kWordSize)); | 2136 __ ldr(left, Address(SP, 1 * kWordSize)); |
2122 __ ldr(right, Address(SP, 0 * kWordSize)); | 2137 __ ldr(right, Address(SP, 0 * kWordSize)); |
2123 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2138 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
2124 __ Ret(); | 2139 __ Ret(); |
2125 } | 2140 } |
2126 | 2141 |
2127 } // namespace dart | 2142 } // namespace dart |
2128 | 2143 |
2129 #endif // defined TARGET_ARCH_ARM | 2144 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |