| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 __ StoreIntoObjectNoBarrier( | 667 __ StoreIntoObjectNoBarrier( |
| 668 R0, | 668 R0, |
| 669 FieldAddress(R0, Array::length_offset()), | 669 FieldAddress(R0, Array::length_offset()), |
| 670 R2); | 670 R2); |
| 671 | 671 |
| 672 // Calculate the size tag. | 672 // Calculate the size tag. |
| 673 // R0: new object start as a tagged pointer. | 673 // R0: new object start as a tagged pointer. |
| 674 // R2: array length as Smi. | 674 // R2: array length as Smi. |
| 675 // R3: array size. | 675 // R3: array size. |
| 676 // R7: new object end address. | 676 // R7: new object end address. |
| 677 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; | 677 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; |
| 678 __ CompareImmediate(R3, RawObject::SizeTag::kMaxSizeTag); | 678 __ CompareImmediate(R3, RawObject::SizeTag::kMaxSizeTag); |
| 679 // If no size tag overflow, shift R1 left, else set R1 to zero. | 679 // If no size tag overflow, shift R1 left, else set R1 to zero. |
| 680 __ mov(R1, ShifterOperand(R3, LSL, shift), LS); | 680 __ mov(R1, ShifterOperand(R3, LSL, shift), LS); |
| 681 __ mov(R1, ShifterOperand(0), HI); | 681 __ mov(R1, ShifterOperand(0), HI); |
| 682 | 682 |
| 683 // Get the class index and insert it into the tags. | 683 // Get the class index and insert it into the tags. |
| 684 __ LoadImmediate(IP, RawObject::ClassIdTag::encode(kArrayCid)); | 684 __ LoadImmediate(IP, RawObject::ClassIdTag::encode(kArrayCid)); |
| 685 __ orr(R1, R1, ShifterOperand(IP)); | 685 __ orr(R1, R1, ShifterOperand(IP)); |
| 686 __ str(R1, FieldAddress(R0, Array::tags_offset())); | 686 __ str(R1, FieldAddress(R0, Array::tags_offset())); |
| 687 | 687 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 // R2: object size. | 900 // R2: object size. |
| 901 // R3: next object start. | 901 // R3: next object start. |
| 902 __ str(R3, Address(R5, 0)); | 902 __ str(R3, Address(R5, 0)); |
| 903 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); | 903 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
| 904 __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5); | 904 __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5); |
| 905 | 905 |
| 906 // Calculate the size tag. | 906 // Calculate the size tag. |
| 907 // R0: new object. | 907 // R0: new object. |
| 908 // R1: number of context variables. | 908 // R1: number of context variables. |
| 909 // R2: object size. | 909 // R2: object size. |
| 910 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; | 910 const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2; |
| 911 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); | 911 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); |
| 912 // If no size tag overflow, shift R2 left, else set R2 to zero. | 912 // If no size tag overflow, shift R2 left, else set R2 to zero. |
| 913 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); | 913 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); |
| 914 __ mov(R2, ShifterOperand(0), HI); | 914 __ mov(R2, ShifterOperand(0), HI); |
| 915 | 915 |
| 916 // Get the class index and insert it into the tags. | 916 // Get the class index and insert it into the tags. |
| 917 // R2: size and bit tags. | 917 // R2: size and bit tags. |
| 918 __ LoadImmediate(IP, RawObject::ClassIdTag::encode(context_class.id())); | 918 __ LoadImmediate(IP, RawObject::ClassIdTag::encode(context_class.id())); |
| 919 __ orr(R2, R2, ShifterOperand(IP)); | 919 __ orr(R2, R2, ShifterOperand(IP)); |
| 920 __ str(R2, FieldAddress(R0, Context::tags_offset())); | 920 __ str(R2, FieldAddress(R0, Context::tags_offset())); |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 const Register right = R0; | 1852 const Register right = R0; |
| 1853 __ ldr(left, Address(SP, 1 * kWordSize)); | 1853 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 1854 __ ldr(right, Address(SP, 0 * kWordSize)); | 1854 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 1855 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1855 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1856 __ Ret(); | 1856 __ Ret(); |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 } // namespace dart | 1859 } // namespace dart |
| 1860 | 1860 |
| 1861 #endif // defined TARGET_ARCH_ARM | 1861 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |