| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); | 364 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); |
| 365 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); | 365 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); |
| 366 // Copy arguments from stack to array (starting at the end). | 366 // Copy arguments from stack to array (starting at the end). |
| 367 // R1: address just beyond last argument on stack. | 367 // R1: address just beyond last argument on stack. |
| 368 // R3: address of first argument in array. | 368 // R3: address of first argument in array. |
| 369 Label enter; | 369 Label enter; |
| 370 __ b(&enter); | 370 __ b(&enter); |
| 371 Label loop; | 371 Label loop; |
| 372 __ Bind(&loop); | 372 __ Bind(&loop); |
| 373 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); | 373 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); |
| 374 __ InitializeFieldNoBarrier(R0, Address(R3, R2, LSL, 1), IP); | 374 // Generational barrier is needed, array is not necessarily in new space. |
| 375 __ StoreIntoObject(R0, Address(R3, R2, LSL, 1), IP); |
| 375 __ Bind(&enter); | 376 __ Bind(&enter); |
| 376 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. | 377 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. |
| 377 __ b(&loop, PL); | 378 __ b(&loop, PL); |
| 378 } | 379 } |
| 379 | 380 |
| 380 | 381 |
| 381 // Used by eager and lazy deoptimization. Preserve result in R0 if necessary. | 382 // Used by eager and lazy deoptimization. Preserve result in R0 if necessary. |
| 382 // This stub translates optimized frame into unoptimized frame. The optimized | 383 // This stub translates optimized frame into unoptimized frame. The optimized |
| 383 // frame can contain values in registers and on stack, the unoptimized | 384 // frame can contain values in registers and on stack, the unoptimized |
| 384 // frame contains all values on stack. | 385 // frame contains all values on stack. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // Get the class index and insert it into the tags. | 672 // Get the class index and insert it into the tags. |
| 672 // R8: size and bit tags. | 673 // R8: size and bit tags. |
| 673 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); | 674 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); |
| 674 __ orr(R8, R8, Operand(TMP)); | 675 __ orr(R8, R8, Operand(TMP)); |
| 675 __ str(R8, FieldAddress(R0, Array::tags_offset())); // Store tags. | 676 __ str(R8, FieldAddress(R0, Array::tags_offset())); // Store tags. |
| 676 } | 677 } |
| 677 | 678 |
| 678 // R0: new object start as a tagged pointer. | 679 // R0: new object start as a tagged pointer. |
| 679 // NOTFP: new object end address. | 680 // NOTFP: new object end address. |
| 680 // Store the type argument field. | 681 // Store the type argument field. |
| 681 __ InitializeFieldNoBarrier(R0, | 682 __ StoreIntoObjectNoBarrier(R0, |
| 682 FieldAddress(R0, Array::type_arguments_offset()), | 683 FieldAddress(R0, Array::type_arguments_offset()), |
| 683 R1); | 684 R1); |
| 684 | 685 |
| 685 // Set the length field. | 686 // Set the length field. |
| 686 __ InitializeFieldNoBarrier(R0, | 687 __ StoreIntoObjectNoBarrier(R0, |
| 687 FieldAddress(R0, Array::length_offset()), | 688 FieldAddress(R0, Array::length_offset()), |
| 688 R2); | 689 R2); |
| 689 | 690 |
| 690 // Initialize all array elements to raw_null. | 691 // Initialize all array elements to raw_null. |
| 691 // R0: new object start as a tagged pointer. | 692 // R0: new object start as a tagged pointer. |
| 692 // R3: allocation stats address. | 693 // R3: allocation stats address. |
| 693 // R8, R9: null | 694 // R8, R9: null |
| 694 // R4: iterator which initially points to the start of the variable | 695 // R4: iterator which initially points to the start of the variable |
| 695 // data area to be initialized. | 696 // data area to be initialized. |
| 696 // NOTFP: new object end address. | 697 // NOTFP: new object end address. |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 // R4: allocation stats address. | 920 // R4: allocation stats address. |
| 920 __ str(R1, FieldAddress(R0, Context::num_variables_offset())); | 921 __ str(R1, FieldAddress(R0, Context::num_variables_offset())); |
| 921 | 922 |
| 922 // Setup the parent field. | 923 // Setup the parent field. |
| 923 // R0: new object. | 924 // R0: new object. |
| 924 // R1: number of context variables. | 925 // R1: number of context variables. |
| 925 // R2: object size. | 926 // R2: object size. |
| 926 // R3: next object start. | 927 // R3: next object start. |
| 927 // R4: allocation stats address. | 928 // R4: allocation stats address. |
| 928 __ LoadObject(R8, Object::null_object()); | 929 __ LoadObject(R8, Object::null_object()); |
| 929 __ InitializeFieldNoBarrier(R0, FieldAddress(R0, Context::parent_offset()), | 930 __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Context::parent_offset()), |
| 930 R8); | 931 R8); |
| 931 | 932 |
| 932 // Initialize the context variables. | 933 // Initialize the context variables. |
| 933 // R0: new object. | 934 // R0: new object. |
| 934 // R1: number of context variables. | 935 // R1: number of context variables. |
| 935 // R2: object size. | 936 // R2: object size. |
| 936 // R3: next object start. | 937 // R3: next object start. |
| 937 // R8, R9: raw null. | 938 // R8, R9: raw null. |
| 938 // R4: allocation stats address. | 939 // R4: allocation stats address. |
| 939 Label loop; | 940 Label loop; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 // R0: new object (tagged). | 1124 // R0: new object (tagged). |
| 1124 // R1: next object start. | 1125 // R1: next object start. |
| 1125 // R4: next word to be initialized. | 1126 // R4: next word to be initialized. |
| 1126 // R9: allocation stats table. | 1127 // R9: allocation stats table. |
| 1127 __ InitializeFieldsNoBarrier(R0, R4, R1, R2, R3); | 1128 __ InitializeFieldsNoBarrier(R0, R4, R1, R2, R3); |
| 1128 } | 1129 } |
| 1129 if (is_cls_parameterized) { | 1130 if (is_cls_parameterized) { |
| 1130 // Set the type arguments in the new object. | 1131 // Set the type arguments in the new object. |
| 1131 __ ldr(R4, Address(SP, 0)); | 1132 __ ldr(R4, Address(SP, 0)); |
| 1132 FieldAddress type_args(R0, cls.type_arguments_field_offset()); | 1133 FieldAddress type_args(R0, cls.type_arguments_field_offset()); |
| 1133 __ InitializeFieldNoBarrier(R0, type_args, R4); | 1134 __ StoreIntoObjectNoBarrier(R0, type_args, R4); |
| 1134 } | 1135 } |
| 1135 | 1136 |
| 1136 // Done allocating and initializing the instance. | 1137 // Done allocating and initializing the instance. |
| 1137 // R0: new object (tagged). | 1138 // R0: new object (tagged). |
| 1138 // R9: allocation stats table. | 1139 // R9: allocation stats table. |
| 1139 | 1140 |
| 1140 // Update allocation stats. | 1141 // Update allocation stats. |
| 1141 NOT_IN_PRODUCT(__ IncrementAllocationStats(R9, cls.id(), space)); | 1142 NOT_IN_PRODUCT(__ IncrementAllocationStats(R9, cls.id(), space)); |
| 1142 | 1143 |
| 1143 // R0: new object (tagged). | 1144 // R0: new object (tagged). |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 } | 2180 } |
| 2180 | 2181 |
| 2181 | 2182 |
| 2182 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2183 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2183 __ bkpt(0); | 2184 __ bkpt(0); |
| 2184 } | 2185 } |
| 2185 | 2186 |
| 2186 } // namespace dart | 2187 } // namespace dart |
| 2187 | 2188 |
| 2188 #endif // defined TARGET_ARCH_ARM | 2189 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |