| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 | 1398 |
| 1399 | 1399 |
| 1400 void Assembler::TryAllocateArray(intptr_t cid, | 1400 void Assembler::TryAllocateArray(intptr_t cid, |
| 1401 intptr_t instance_size, | 1401 intptr_t instance_size, |
| 1402 Label* failure, | 1402 Label* failure, |
| 1403 Register instance, | 1403 Register instance, |
| 1404 Register end_address, | 1404 Register end_address, |
| 1405 Register temp1, | 1405 Register temp1, |
| 1406 Register temp2) { | 1406 Register temp2) { |
| 1407 if (FLAG_inline_alloc) { | 1407 if (FLAG_inline_alloc) { |
| 1408 // If this allocation is traced, program will jump to failure path |
| 1409 // (i.e. the allocation stub) which will allocate the object and trace the |
| 1410 // allocation call site. |
| 1411 MaybeTraceAllocation(cid, temp1, PP, failure); |
| 1408 Isolate* isolate = Isolate::Current(); | 1412 Isolate* isolate = Isolate::Current(); |
| 1409 Heap* heap = isolate->heap(); | 1413 Heap* heap = isolate->heap(); |
| 1410 Heap::Space space = heap->SpaceForAllocation(cid); | 1414 Heap::Space space = heap->SpaceForAllocation(cid); |
| 1411 LoadImmediate(temp1, heap->TopAddress(space), PP); | 1415 LoadImmediate(temp1, heap->TopAddress(space), PP); |
| 1412 ldr(instance, Address(temp1, 0)); // Potential new object start. | 1416 ldr(instance, Address(temp1, 0)); // Potential new object start. |
| 1413 AddImmediateSetFlags(end_address, instance, instance_size, PP); | 1417 AddImmediateSetFlags(end_address, instance, instance_size, PP); |
| 1414 b(failure, CS); // Fail on unsigned overflow. | 1418 b(failure, CS); // Fail on unsigned overflow. |
| 1415 | 1419 |
| 1416 // Check if the allocation fits into the remaining space. | 1420 // Check if the allocation fits into the remaining space. |
| 1417 // instance: potential new object start. | 1421 // instance: potential new object start. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 add(base, array, Operand(index, LSL, shift)); | 1481 add(base, array, Operand(index, LSL, shift)); |
| 1478 } | 1482 } |
| 1479 const OperandSize size = Address::OperandSizeFor(cid); | 1483 const OperandSize size = Address::OperandSizeFor(cid); |
| 1480 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1484 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1481 return Address(base, offset, Address::Offset, size); | 1485 return Address(base, offset, Address::Offset, size); |
| 1482 } | 1486 } |
| 1483 | 1487 |
| 1484 } // namespace dart | 1488 } // namespace dart |
| 1485 | 1489 |
| 1486 #endif // defined TARGET_ARCH_ARM64 | 1490 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |