| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); | 406 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); |
| 407 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); | 407 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); |
| 408 // Copy arguments from stack to array (starting at the end). | 408 // Copy arguments from stack to array (starting at the end). |
| 409 // R1: address just beyond last argument on stack. | 409 // R1: address just beyond last argument on stack. |
| 410 // R3: address of first argument in array. | 410 // R3: address of first argument in array. |
| 411 Label enter; | 411 Label enter; |
| 412 __ b(&enter); | 412 __ b(&enter); |
| 413 Label loop; | 413 Label loop; |
| 414 __ Bind(&loop); | 414 __ Bind(&loop); |
| 415 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); | 415 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); |
| 416 __ StoreIntoObjectNoBarrier(R0, Address(R3, R2, LSL, 1), IP); | 416 __ InitializeFieldNoBarrier(R0, Address(R3, R2, LSL, 1), IP); |
| 417 __ Bind(&enter); | 417 __ Bind(&enter); |
| 418 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. | 418 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. |
| 419 __ b(&loop, PL); | 419 __ b(&loop, PL); |
| 420 } | 420 } |
| 421 | 421 |
| 422 | 422 |
| 423 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame, | 423 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame, |
| 424 intptr_t deopt_reason, | 424 intptr_t deopt_reason, |
| 425 uword saved_registers_address); | 425 uword saved_registers_address); |
| 426 | 426 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 // Get the class index and insert it into the tags. | 672 // Get the class index and insert it into the tags. |
| 673 // R6: size and bit tags. | 673 // R6: size and bit tags. |
| 674 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); | 674 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); |
| 675 __ orr(R6, R6, Operand(TMP)); | 675 __ orr(R6, R6, Operand(TMP)); |
| 676 __ str(R6, FieldAddress(R0, Array::tags_offset())); // Store tags. | 676 __ str(R6, FieldAddress(R0, Array::tags_offset())); // Store tags. |
| 677 } | 677 } |
| 678 | 678 |
| 679 // R0: new object start as a tagged pointer. | 679 // R0: new object start as a tagged pointer. |
| 680 // R7: new object end address. | 680 // R7: new object end address. |
| 681 // Store the type argument field. | 681 // Store the type argument field. |
| 682 __ StoreIntoObjectNoBarrier(R0, | 682 __ InitializeFieldNoBarrier(R0, |
| 683 FieldAddress(R0, Array::type_arguments_offset()), | 683 FieldAddress(R0, Array::type_arguments_offset()), |
| 684 R1); | 684 R1); |
| 685 | 685 |
| 686 // Set the length field. | 686 // Set the length field. |
| 687 __ StoreIntoObjectNoBarrier(R0, | 687 __ InitializeFieldNoBarrier(R0, |
| 688 FieldAddress(R0, Array::length_offset()), | 688 FieldAddress(R0, Array::length_offset()), |
| 689 R2); | 689 R2); |
| 690 | 690 |
| 691 // Initialize all array elements to raw_null. | 691 // Initialize all array elements to raw_null. |
| 692 // R0: new object start as a tagged pointer. | 692 // R0: new object start as a tagged pointer. |
| 693 // R3: allocation stats address. | 693 // R3: allocation stats address. |
| 694 // R4, R5: null | 694 // R4, R5: null |
| 695 // R6: iterator which initially points to the start of the variable | 695 // R6: iterator which initially points to the start of the variable |
| 696 // data area to be initialized. | 696 // data area to be initialized. |
| 697 // R7: new object end address. | 697 // R7: new object end address. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 // R6: allocation stats address. | 910 // R6: allocation stats address. |
| 911 __ str(R1, FieldAddress(R0, Context::num_variables_offset())); | 911 __ str(R1, FieldAddress(R0, Context::num_variables_offset())); |
| 912 | 912 |
| 913 // Setup the parent field. | 913 // Setup the parent field. |
| 914 // R0: new object. | 914 // R0: new object. |
| 915 // R1: number of context variables. | 915 // R1: number of context variables. |
| 916 // R2: object size. | 916 // R2: object size. |
| 917 // R3: next object start. | 917 // R3: next object start. |
| 918 // R6: allocation stats address. | 918 // R6: allocation stats address. |
| 919 __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null())); | 919 __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null())); |
| 920 __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Context::parent_offset()), | 920 __ InitializeFieldNoBarrier(R0, FieldAddress(R0, Context::parent_offset()), |
| 921 R4); | 921 R4); |
| 922 | 922 |
| 923 // Initialize the context variables. | 923 // Initialize the context variables. |
| 924 // R0: new object. | 924 // R0: new object. |
| 925 // R1: number of context variables. | 925 // R1: number of context variables. |
| 926 // R2: object size. | 926 // R2: object size. |
| 927 // R3: next object start. | 927 // R3: next object start. |
| 928 // R4, R5: raw null. | 928 // R4, R5: raw null. |
| 929 // R6: allocation stats address. | 929 // R6: allocation stats address. |
| 930 Label loop; | 930 Label loop; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 // R0: new object (tagged). | 1120 // R0: new object (tagged). |
| 1121 // R1: next object start. | 1121 // R1: next object start. |
| 1122 // R4: next word to be initialized. | 1122 // R4: next word to be initialized. |
| 1123 // R5: allocation stats table. | 1123 // R5: allocation stats table. |
| 1124 __ InitializeFieldsNoBarrier(R0, R4, R1, R2, R3); | 1124 __ InitializeFieldsNoBarrier(R0, R4, R1, R2, R3); |
| 1125 } | 1125 } |
| 1126 if (is_cls_parameterized) { | 1126 if (is_cls_parameterized) { |
| 1127 // Set the type arguments in the new object. | 1127 // Set the type arguments in the new object. |
| 1128 __ ldr(R4, Address(SP, 0)); | 1128 __ ldr(R4, Address(SP, 0)); |
| 1129 FieldAddress type_args(R0, cls.type_arguments_field_offset()); | 1129 FieldAddress type_args(R0, cls.type_arguments_field_offset()); |
| 1130 __ StoreIntoObjectNoBarrier(R0, type_args, R4); | 1130 __ InitializeFieldNoBarrier(R0, type_args, R4); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 // Done allocating and initializing the instance. | 1133 // Done allocating and initializing the instance. |
| 1134 // R0: new object (tagged). | 1134 // R0: new object (tagged). |
| 1135 // R5: allocation stats table. | 1135 // R5: allocation stats table. |
| 1136 | 1136 |
| 1137 // Update allocation stats. | 1137 // Update allocation stats. |
| 1138 __ IncrementAllocationStats(R5, cls.id(), space); | 1138 __ IncrementAllocationStats(R5, cls.id(), space); |
| 1139 | 1139 |
| 1140 // R0: new object (tagged). | 1140 // R0: new object (tagged). |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 const Register right = R0; | 2048 const Register right = R0; |
| 2049 __ ldr(left, Address(SP, 1 * kWordSize)); | 2049 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 2050 __ ldr(right, Address(SP, 0 * kWordSize)); | 2050 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 2051 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2051 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2052 __ Ret(); | 2052 __ Ret(); |
| 2053 } | 2053 } |
| 2054 | 2054 |
| 2055 } // namespace dart | 2055 } // namespace dart |
| 2056 | 2056 |
| 2057 #endif // defined TARGET_ARCH_ARM | 2057 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |