OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 __ b(&slow_case, CS); // Branch if unsigned higher or equal. | 654 __ b(&slow_case, CS); // Branch if unsigned higher or equal. |
655 | 655 |
656 // Successfully allocated the object(s), now update top to point to | 656 // Successfully allocated the object(s), now update top to point to |
657 // next object start and initialize the object. | 657 // next object start and initialize the object. |
658 // R0: potential new object start. | 658 // R0: potential new object start. |
659 // R3: array size. | 659 // R3: array size. |
660 // R7: potential next object start. | 660 // R7: potential next object start. |
661 // R8: Points to new space object. | 661 // R8: Points to new space object. |
662 __ StoreToOffset(R7, R8, Scavenger::top_offset(), kNoPP); | 662 __ StoreToOffset(R7, R8, Scavenger::top_offset(), kNoPP); |
663 __ add(R0, R0, Operand(kHeapObjectTag)); | 663 __ add(R0, R0, Operand(kHeapObjectTag)); |
664 __ UpdateAllocationStatsWithSize(kArrayCid, R3, R8, kNoPP); | 664 __ UpdateAllocationStatsWithSize(kArrayCid, R3, kNoPP); |
665 | 665 |
666 // R0: new object start as a tagged pointer. | 666 // R0: new object start as a tagged pointer. |
667 // R1: array element type. | 667 // R1: array element type. |
668 // R2: array length as Smi. | 668 // R2: array length as Smi. |
669 // R3: array size. | 669 // R3: array size. |
670 // R7: new object end address. | 670 // R7: new object end address. |
671 | 671 |
672 // Store the type argument field. | 672 // Store the type argument field. |
673 __ StoreIntoObjectOffsetNoBarrier( | 673 __ StoreIntoObjectOffsetNoBarrier( |
674 R0, Array::type_arguments_offset(), R1, PP); | 674 R0, Array::type_arguments_offset(), R1, PP); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 931 } |
932 | 932 |
933 // Successfully allocated the object, now update top to point to | 933 // Successfully allocated the object, now update top to point to |
934 // next object start and initialize the object. | 934 // next object start and initialize the object. |
935 // R0: new object. | 935 // R0: new object. |
936 // R1: number of context variables. | 936 // R1: number of context variables. |
937 // R2: object size. | 937 // R2: object size. |
938 // R3: next object start. | 938 // R3: next object start. |
939 __ str(R3, Address(R5)); | 939 __ str(R3, Address(R5)); |
940 __ add(R0, R0, Operand(kHeapObjectTag)); | 940 __ add(R0, R0, Operand(kHeapObjectTag)); |
941 __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5, kNoPP); | 941 __ UpdateAllocationStatsWithSize(context_class.id(), R2, kNoPP); |
942 | 942 |
943 // Calculate the size tag. | 943 // Calculate the size tag. |
944 // R0: new object. | 944 // R0: new object. |
945 // R1: number of context variables. | 945 // R1: number of context variables. |
946 // R2: object size. | 946 // R2: object size. |
947 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; | 947 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; |
948 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag, kNoPP); | 948 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag, kNoPP); |
949 // If no size tag overflow, shift R2 left, else set R2 to zero. | 949 // If no size tag overflow, shift R2 left, else set R2 to zero. |
950 __ Lsl(TMP, R2, shift); | 950 __ Lsl(TMP, R2, shift); |
951 __ csel(R2, TMP, R2, LS); | 951 __ csel(R2, TMP, R2, LS); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 // R3: potential next object start. | 1113 // R3: potential next object start. |
1114 __ LoadImmediate(TMP, heap->EndAddress(), kNoPP); | 1114 __ LoadImmediate(TMP, heap->EndAddress(), kNoPP); |
1115 __ ldr(TMP, Address(TMP)); | 1115 __ ldr(TMP, Address(TMP)); |
1116 __ CompareRegisters(R3, TMP); | 1116 __ CompareRegisters(R3, TMP); |
1117 if (FLAG_use_slow_path) { | 1117 if (FLAG_use_slow_path) { |
1118 __ b(&slow_case); | 1118 __ b(&slow_case); |
1119 } else { | 1119 } else { |
1120 __ b(&slow_case, CS); // Unsigned higher or equal. | 1120 __ b(&slow_case, CS); // Unsigned higher or equal. |
1121 } | 1121 } |
1122 __ str(R3, Address(R5)); | 1122 __ str(R3, Address(R5)); |
1123 __ UpdateAllocationStats(cls.id(), R5, kNoPP); | 1123 __ UpdateAllocationStats(cls.id(), kNoPP); |
1124 | 1124 |
1125 // R2: new object start. | 1125 // R2: new object start. |
1126 // R3: next object start. | 1126 // R3: next object start. |
1127 // R1: new object type arguments (if is_cls_parameterized). | 1127 // R1: new object type arguments (if is_cls_parameterized). |
1128 // Set the tags. | 1128 // Set the tags. |
1129 uword tags = 0; | 1129 uword tags = 0; |
1130 tags = RawObject::SizeTag::update(instance_size, tags); | 1130 tags = RawObject::SizeTag::update(instance_size, tags); |
1131 ASSERT(cls.id() != kIllegalCid); | 1131 ASSERT(cls.id() != kIllegalCid); |
1132 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1132 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
1133 __ LoadImmediate(R0, tags, kNoPP); | 1133 __ LoadImmediate(R0, tags, kNoPP); |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 const Register right = R0; | 1914 const Register right = R0; |
1915 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); | 1915 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); |
1916 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); | 1916 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); |
1917 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1917 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
1918 __ ret(); | 1918 __ ret(); |
1919 } | 1919 } |
1920 | 1920 |
1921 } // namespace dart | 1921 } // namespace dart |
1922 | 1922 |
1923 #endif // defined TARGET_ARCH_ARM64 | 1923 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |