| 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // R3: array size. | 603 // R3: array size. |
| 604 // R7: potential next object start. | 604 // R7: potential next object start. |
| 605 // R8: points to new space object. | 605 // R8: points to new space object. |
| 606 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset()); | 606 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset()); |
| 607 __ cmp(R7, ShifterOperand(IP)); | 607 __ cmp(R7, ShifterOperand(IP)); |
| 608 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 608 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
| 609 | 609 |
| 610 // Successfully allocated the object(s), now update top to point to | 610 // Successfully allocated the object(s), now update top to point to |
| 611 // next object start and initialize the object. | 611 // next object start and initialize the object. |
| 612 // R0: potential new object start. | 612 // R0: potential new object start. |
| 613 // R3: array size. |
| 613 // R7: potential next object start. | 614 // R7: potential next object start. |
| 614 // R8: Points to new space object. | 615 // R8: Points to new space object. |
| 615 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); | 616 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); |
| 616 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); | 617 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
| 618 __ UpdateAllocationStatsWithSize(kArrayCid, R3, R8); |
| 617 | 619 |
| 618 // R0: new object start as a tagged pointer. | 620 // R0: new object start as a tagged pointer. |
| 619 // R1: array element type. | 621 // R1: array element type. |
| 620 // R2: array length as Smi. | 622 // R2: array length as Smi. |
| 621 // R3: array size. | 623 // R3: array size. |
| 622 // R7: new object end address. | 624 // R7: new object end address. |
| 623 | 625 |
| 624 // Store the type argument field. | 626 // Store the type argument field. |
| 625 __ StoreIntoObjectNoBarrier( | 627 __ StoreIntoObjectNoBarrier( |
| 626 R0, | 628 R0, |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 } | 941 } |
| 940 | 942 |
| 941 // Successfully allocated the object, now update top to point to | 943 // Successfully allocated the object, now update top to point to |
| 942 // next object start and initialize the object. | 944 // next object start and initialize the object. |
| 943 // R0: new object. | 945 // R0: new object. |
| 944 // R1: number of context variables. | 946 // R1: number of context variables. |
| 945 // R2: object size. | 947 // R2: object size. |
| 946 // R3: next object start. | 948 // R3: next object start. |
| 947 __ str(R3, Address(R5, 0)); | 949 __ str(R3, Address(R5, 0)); |
| 948 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); | 950 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
| 951 __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5); |
| 949 | 952 |
| 950 // Calculate the size tag. | 953 // Calculate the size tag. |
| 951 // R0: new object. | 954 // R0: new object. |
| 952 // R1: number of context variables. | 955 // R1: number of context variables. |
| 953 // R2: object size. | 956 // R2: object size. |
| 954 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; | 957 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; |
| 955 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); | 958 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); |
| 956 // If no size tag overflow, shift R2 left, else set R2 to zero. | 959 // If no size tag overflow, shift R2 left, else set R2 to zero. |
| 957 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); | 960 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); |
| 958 __ mov(R2, ShifterOperand(0), HI); | 961 __ mov(R2, ShifterOperand(0), HI); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 __ cmp(R3, ShifterOperand(IP)); | 1124 __ cmp(R3, ShifterOperand(IP)); |
| 1122 if (FLAG_use_slow_path) { | 1125 if (FLAG_use_slow_path) { |
| 1123 __ b(&slow_case); | 1126 __ b(&slow_case); |
| 1124 } else { | 1127 } else { |
| 1125 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 1128 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
| 1126 } | 1129 } |
| 1127 | 1130 |
| 1128 // Successfully allocated the object(s), now update top to point to | 1131 // Successfully allocated the object(s), now update top to point to |
| 1129 // next object start and initialize the object. | 1132 // next object start and initialize the object. |
| 1130 __ str(R3, Address(R5, 0)); | 1133 __ str(R3, Address(R5, 0)); |
| 1134 __ UpdateAllocationStats(cls.id(), R5); |
| 1131 | 1135 |
| 1132 if (is_cls_parameterized) { | 1136 if (is_cls_parameterized) { |
| 1133 // Initialize the type arguments field in the object. | 1137 // Initialize the type arguments field in the object. |
| 1134 // R2: new object start. | 1138 // R2: new object start. |
| 1135 // R4: potential new object end and, if R4 != R3, potential new | 1139 // R4: potential new object end and, if R4 != R3, potential new |
| 1136 // InstantiatedTypeArguments object start. | 1140 // InstantiatedTypeArguments object start. |
| 1137 // R3: next object start. | 1141 // R3: next object start. |
| 1138 Label type_arguments_ready; | 1142 Label type_arguments_ready; |
| 1139 __ cmp(R4, ShifterOperand(R3)); | 1143 __ cmp(R4, ShifterOperand(R3)); |
| 1140 __ b(&type_arguments_ready, EQ); | 1144 __ b(&type_arguments_ready, EQ); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 __ cmp(R3, ShifterOperand(IP)); | 1289 __ cmp(R3, ShifterOperand(IP)); |
| 1286 if (FLAG_use_slow_path) { | 1290 if (FLAG_use_slow_path) { |
| 1287 __ b(&slow_case); | 1291 __ b(&slow_case); |
| 1288 } else { | 1292 } else { |
| 1289 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 1293 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
| 1290 } | 1294 } |
| 1291 | 1295 |
| 1292 // Successfully allocated the object, now update top to point to | 1296 // Successfully allocated the object, now update top to point to |
| 1293 // next object start and initialize the object. | 1297 // next object start and initialize the object. |
| 1294 __ str(R3, Address(R5, 0)); | 1298 __ str(R3, Address(R5, 0)); |
| 1295 | 1299 // R3: Size of allocation in bytes. |
| 1300 __ sub(R3, R3, ShifterOperand(R2)); |
| 1301 __ UpdateAllocationStatsWithSize(cls.id(), R3, R5); |
| 1296 // R2: new closure object. | 1302 // R2: new closure object. |
| 1297 // R4: new context object (only if is_implicit_closure). | 1303 // R4: new context object (only if is_implicit_closure). |
| 1298 // Set the tags. | 1304 // Set the tags. |
| 1299 uword tags = 0; | 1305 uword tags = 0; |
| 1300 tags = RawObject::SizeTag::update(closure_size, tags); | 1306 tags = RawObject::SizeTag::update(closure_size, tags); |
| 1301 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1307 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
| 1302 __ LoadImmediate(R0, tags); | 1308 __ LoadImmediate(R0, tags); |
| 1303 __ str(R0, Address(R2, Instance::tags_offset())); | 1309 __ str(R0, Address(R2, Instance::tags_offset())); |
| 1304 | 1310 |
| 1305 // Initialize the function field in the object. | 1311 // Initialize the function field in the object. |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2154 const Register right = R0; | 2160 const Register right = R0; |
| 2155 __ ldr(left, Address(SP, 1 * kWordSize)); | 2161 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 2156 __ ldr(right, Address(SP, 0 * kWordSize)); | 2162 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 2157 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2163 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2158 __ Ret(); | 2164 __ Ret(); |
| 2159 } | 2165 } |
| 2160 | 2166 |
| 2161 } // namespace dart | 2167 } // namespace dart |
| 2162 | 2168 |
| 2163 #endif // defined TARGET_ARCH_ARM | 2169 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |