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" | 5 #include "vm/globals.h" |
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/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 // kInlineInstanceSize is a constant used as a threshold for determining | 1121 // kInlineInstanceSize is a constant used as a threshold for determining |
1122 // when the object initialization should be done as a loop or as | 1122 // when the object initialization should be done as a loop or as |
1123 // straight line code. | 1123 // straight line code. |
1124 const int kInlineInstanceSize = 12; | 1124 const int kInlineInstanceSize = 12; |
1125 const intptr_t instance_size = cls.instance_size(); | 1125 const intptr_t instance_size = cls.instance_size(); |
1126 ASSERT(instance_size > 0); | 1126 ASSERT(instance_size > 0); |
1127 if (is_cls_parameterized) { | 1127 if (is_cls_parameterized) { |
1128 __ ldr(R1, Address(SP)); | 1128 __ ldr(R1, Address(SP)); |
1129 // R1: instantiated type arguments. | 1129 // R1: instantiated type arguments. |
1130 } | 1130 } |
1131 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size)) { | 1131 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) && |
| 1132 !cls.trace_allocation()) { |
1132 Label slow_case; | 1133 Label slow_case; |
1133 // Allocate the object and update top to point to | 1134 // Allocate the object and update top to point to |
1134 // next object start and initialize the allocated object. | 1135 // next object start and initialize the allocated object. |
1135 // R1: instantiated type arguments (if is_cls_parameterized). | 1136 // R1: instantiated type arguments (if is_cls_parameterized). |
1136 Heap* heap = Isolate::Current()->heap(); | 1137 Heap* heap = Isolate::Current()->heap(); |
1137 Heap::Space space = heap->SpaceForAllocation(cls.id()); | 1138 Heap::Space space = heap->SpaceForAllocation(cls.id()); |
1138 __ LoadImmediate(R5, heap->TopAddress(space), kNoPP); | 1139 __ LoadImmediate(R5, heap->TopAddress(space), kNoPP); |
1139 __ ldr(R2, Address(R5)); | 1140 __ ldr(R2, Address(R5)); |
1140 __ AddImmediate(R3, R2, instance_size, kNoPP); | 1141 __ AddImmediate(R3, R2, instance_size, kNoPP); |
1141 // Check if the allocation fits into the remaining space. | 1142 // Check if the allocation fits into the remaining space. |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 // Result: | 2187 // Result: |
2187 // R1: entry point. | 2188 // R1: entry point. |
2188 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2189 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2189 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2190 EmitMegamorphicLookup(assembler, R0, R1, R1); |
2190 __ ret(); | 2191 __ ret(); |
2191 } | 2192 } |
2192 | 2193 |
2193 } // namespace dart | 2194 } // namespace dart |
2194 | 2195 |
2195 #endif // defined TARGET_ARCH_ARM64 | 2196 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |