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" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 argument_names())); | 220 argument_names())); |
221 __ LoadObject(R4, arguments_descriptor); | 221 __ LoadObject(R4, arguments_descriptor); |
222 | 222 |
223 // R4: Arguments descriptor. | 223 // R4: Arguments descriptor. |
224 // R0: Function. | 224 // R0: Function. |
225 ASSERT(locs()->in(0).reg() == R0); | 225 ASSERT(locs()->in(0).reg() == R0); |
226 __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset())); | 226 __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset())); |
227 __ ldr(R2, FieldAddress(R0, Function::entry_point_offset())); | 227 __ ldr(R2, FieldAddress(R0, Function::entry_point_offset())); |
228 | 228 |
229 // R2: instructions entry point. | 229 // R2: instructions entry point. |
230 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 230 // R9: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
231 __ LoadImmediate(R5, 0); | 231 __ LoadImmediate(R9, 0); |
232 __ blx(R2); | 232 __ blx(R2); |
233 compiler->RecordSafepoint(locs()); | 233 compiler->RecordSafepoint(locs()); |
234 // Marks either the continuation point in unoptimized code or the | 234 // Marks either the continuation point in unoptimized code or the |
235 // deoptimization point in optimized code, after call. | 235 // deoptimization point in optimized code, after call. |
236 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id()); | 236 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id()); |
237 if (compiler->is_optimizing()) { | 237 if (compiler->is_optimizing()) { |
238 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 238 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
239 } | 239 } |
240 // Add deoptimization continuation point after the call and before the | 240 // Add deoptimization continuation point after the call and before the |
241 // arguments are removed. | 241 // arguments are removed. |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 #if defined(USING_SIMULATOR) | 963 #if defined(USING_SIMULATOR) |
964 if (!function().IsNativeAutoSetupScope()) { | 964 if (!function().IsNativeAutoSetupScope()) { |
965 entry = Simulator::RedirectExternalReference( | 965 entry = Simulator::RedirectExternalReference( |
966 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); | 966 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); |
967 } | 967 } |
968 #endif | 968 #endif |
969 } | 969 } |
970 } | 970 } |
971 __ LoadImmediate(R1, argc_tag); | 971 __ LoadImmediate(R1, argc_tag); |
972 ExternalLabel label(entry); | 972 ExternalLabel label(entry); |
973 __ LoadNativeEntry(R5, &label, link_lazily() ? kPatchable : kNotPatchable); | 973 __ LoadNativeEntry(R9, &label, link_lazily() ? kPatchable : kNotPatchable); |
974 compiler->GenerateCall(token_pos(), | 974 compiler->GenerateCall(token_pos(), |
975 *stub_entry, | 975 *stub_entry, |
976 RawPcDescriptors::kOther, | 976 RawPcDescriptors::kOther, |
977 locs()); | 977 locs()); |
978 __ Pop(result); | 978 __ Pop(result); |
979 } | 979 } |
980 | 980 |
981 | 981 |
982 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, | 982 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
983 bool opt) const { | 983 bool opt) const { |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2318 Label* slow_path, | 2318 Label* slow_path, |
2319 Label* done) { | 2319 Label* done) { |
2320 const int kInlineArraySize = 12; // Same as kInlineInstanceSize. | 2320 const int kInlineArraySize = 12; // Same as kInlineInstanceSize. |
2321 const Register kLengthReg = R2; | 2321 const Register kLengthReg = R2; |
2322 const Register kElemTypeReg = R1; | 2322 const Register kElemTypeReg = R1; |
2323 const intptr_t instance_size = Array::InstanceSize(num_elements); | 2323 const intptr_t instance_size = Array::InstanceSize(num_elements); |
2324 | 2324 |
2325 __ TryAllocateArray(kArrayCid, instance_size, slow_path, | 2325 __ TryAllocateArray(kArrayCid, instance_size, slow_path, |
2326 R0, // instance | 2326 R0, // instance |
2327 R3, // end address | 2327 R3, // end address |
2328 R6, | 2328 R8, |
2329 R10); | 2329 R6); |
2330 // R0: new object start as a tagged pointer. | 2330 // R0: new object start as a tagged pointer. |
2331 // R3: new object end address. | 2331 // R3: new object end address. |
2332 | 2332 |
2333 // Store the type argument field. | 2333 // Store the type argument field. |
2334 __ InitializeFieldNoBarrier(R0, | 2334 __ InitializeFieldNoBarrier(R0, |
2335 FieldAddress(R0, Array::type_arguments_offset()), | 2335 FieldAddress(R0, Array::type_arguments_offset()), |
2336 kElemTypeReg); | 2336 kElemTypeReg); |
2337 | 2337 |
2338 // Set the length field. | 2338 // Set the length field. |
2339 __ InitializeFieldNoBarrier(R0, | 2339 __ InitializeFieldNoBarrier(R0, |
2340 FieldAddress(R0, Array::length_offset()), | 2340 FieldAddress(R0, Array::length_offset()), |
2341 kLengthReg); | 2341 kLengthReg); |
2342 | 2342 |
2343 // Initialize all array elements to raw_null. | 2343 // Initialize all array elements to raw_null. |
2344 // R0: new object start as a tagged pointer. | 2344 // R0: new object start as a tagged pointer. |
2345 // R3: new object end address. | 2345 // R3: new object end address. |
2346 // R10: iterator which initially points to the start of the variable | 2346 // R6: iterator which initially points to the start of the variable |
2347 // data area to be initialized. | 2347 // data area to be initialized. |
2348 // R6: null | 2348 // R8: null |
2349 if (num_elements > 0) { | 2349 if (num_elements > 0) { |
2350 const intptr_t array_size = instance_size - sizeof(RawArray); | 2350 const intptr_t array_size = instance_size - sizeof(RawArray); |
2351 __ LoadObject(R6, Object::null_object()); | 2351 __ LoadObject(R8, Object::null_object()); |
2352 if (num_elements >= 2) { | 2352 if (num_elements >= 2) { |
2353 __ mov(R7, Operand(R6)); | 2353 __ mov(R9, Operand(R8)); |
2354 } else { | 2354 } else { |
2355 #if defined(DEBUG) | 2355 #if defined(DEBUG) |
2356 // Clobber R7 with an invalid pointer. | 2356 // Clobber R7 with an invalid pointer. |
2357 __ LoadImmediate(R7, 0x1); | 2357 __ LoadImmediate(R9, 0x1); |
2358 #endif // DEBUG | 2358 #endif // DEBUG |
2359 } | 2359 } |
2360 __ AddImmediate(R10, R0, sizeof(RawArray) - kHeapObjectTag); | 2360 __ AddImmediate(R6, R0, sizeof(RawArray) - kHeapObjectTag); |
2361 if (array_size < (kInlineArraySize * kWordSize)) { | 2361 if (array_size < (kInlineArraySize * kWordSize)) { |
2362 __ InitializeFieldsNoBarrierUnrolled(R0, R10, 0, num_elements * kWordSize, | 2362 __ InitializeFieldsNoBarrierUnrolled(R0, R6, 0, num_elements * kWordSize, |
2363 R6, R7); | 2363 R8, R9); |
2364 } else { | 2364 } else { |
2365 __ InitializeFieldsNoBarrier(R0, R10, R3, R6, R7); | 2365 __ InitializeFieldsNoBarrier(R0, R6, R3, R8, R9); |
2366 } | 2366 } |
2367 } | 2367 } |
2368 __ b(done); | 2368 __ b(done); |
2369 } | 2369 } |
2370 | 2370 |
2371 | 2371 |
2372 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2372 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2373 const Register kLengthReg = R2; | 2373 const Register kLengthReg = R2; |
2374 const Register kElemTypeReg = R1; | 2374 const Register kElemTypeReg = R1; |
2375 const Register kResultReg = R0; | 2375 const Register kResultReg = R0; |
(...skipping 4484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6860 1, | 6860 1, |
6861 locs()); | 6861 locs()); |
6862 __ Drop(1); | 6862 __ Drop(1); |
6863 __ Pop(result); | 6863 __ Pop(result); |
6864 } | 6864 } |
6865 | 6865 |
6866 | 6866 |
6867 } // namespace dart | 6867 } // namespace dart |
6868 | 6868 |
6869 #endif // defined TARGET_ARCH_ARM | 6869 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |