| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 const intptr_t cid = kArrayCid; | 627 const intptr_t cid = kArrayCid; |
| 628 __ MaybeTraceAllocation(cid, R4, &slow_case); | 628 __ MaybeTraceAllocation(cid, R4, &slow_case); |
| 629 | 629 |
| 630 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; | 630 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; |
| 631 __ LoadImmediate(R9, fixed_size); | 631 __ LoadImmediate(R9, fixed_size); |
| 632 __ add(R9, R9, Operand(R3, LSL, 1)); // R3 is a Smi. | 632 __ add(R9, R9, Operand(R3, LSL, 1)); // R3 is a Smi. |
| 633 ASSERT(kSmiTagShift == 1); | 633 ASSERT(kSmiTagShift == 1); |
| 634 __ bic(R9, R9, Operand(kObjectAlignment - 1)); | 634 __ bic(R9, R9, Operand(kObjectAlignment - 1)); |
| 635 | 635 |
| 636 // R9: Allocation size. | 636 // R9: Allocation size. |
| 637 Heap::Space space = Heap::SpaceForAllocation(cid); | 637 Heap::Space space = Heap::kNew; |
| 638 __ LoadIsolate(R8); | 638 __ LoadIsolate(R8); |
| 639 __ ldr(R8, Address(R8, Isolate::heap_offset())); | 639 __ ldr(R8, Address(R8, Isolate::heap_offset())); |
| 640 // Potential new object start. | 640 // Potential new object start. |
| 641 __ ldr(R0, Address(R8, Heap::TopOffset(space))); | 641 __ ldr(R0, Address(R8, Heap::TopOffset(space))); |
| 642 __ adds(NOTFP, R0, Operand(R9)); // Potential next object start. | 642 __ adds(NOTFP, R0, Operand(R9)); // Potential next object start. |
| 643 __ b(&slow_case, CS); // Branch if unsigned overflow. | 643 __ b(&slow_case, CS); // Branch if unsigned overflow. |
| 644 | 644 |
| 645 // Check if the allocation fits into the remaining space. | 645 // Check if the allocation fits into the remaining space. |
| 646 // R0: potential new object start. | 646 // R0: potential new object start. |
| 647 // NOTFP: potential next object start. | 647 // NOTFP: potential next object start. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 __ LoadImmediate(R2, fixed_size); | 856 __ LoadImmediate(R2, fixed_size); |
| 857 __ add(R2, R2, Operand(R1, LSL, 2)); | 857 __ add(R2, R2, Operand(R1, LSL, 2)); |
| 858 ASSERT(kSmiTagShift == 1); | 858 ASSERT(kSmiTagShift == 1); |
| 859 __ bic(R2, R2, Operand(kObjectAlignment - 1)); | 859 __ bic(R2, R2, Operand(kObjectAlignment - 1)); |
| 860 | 860 |
| 861 __ MaybeTraceAllocation(kContextCid, R8, &slow_case); | 861 __ MaybeTraceAllocation(kContextCid, R8, &slow_case); |
| 862 // Now allocate the object. | 862 // Now allocate the object. |
| 863 // R1: number of context variables. | 863 // R1: number of context variables. |
| 864 // R2: object size. | 864 // R2: object size. |
| 865 const intptr_t cid = kContextCid; | 865 const intptr_t cid = kContextCid; |
| 866 Heap::Space space = Heap::SpaceForAllocation(cid); | 866 Heap::Space space = Heap::kNew; |
| 867 __ LoadIsolate(R9); | 867 __ LoadIsolate(R9); |
| 868 __ ldr(R9, Address(R9, Isolate::heap_offset())); | 868 __ ldr(R9, Address(R9, Isolate::heap_offset())); |
| 869 __ ldr(R0, Address(R9, Heap::TopOffset(space))); | 869 __ ldr(R0, Address(R9, Heap::TopOffset(space))); |
| 870 __ add(R3, R2, Operand(R0)); | 870 __ add(R3, R2, Operand(R0)); |
| 871 // Check if the allocation fits into the remaining space. | 871 // Check if the allocation fits into the remaining space. |
| 872 // R0: potential new object. | 872 // R0: potential new object. |
| 873 // R1: number of context variables. | 873 // R1: number of context variables. |
| 874 // R2: object size. | 874 // R2: object size. |
| 875 // R3: potential next object start. | 875 // R3: potential next object start. |
| 876 // R9: heap. | 876 // R9: heap. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 // straight line code. | 1055 // straight line code. |
| 1056 const int kInlineInstanceSize = 12; | 1056 const int kInlineInstanceSize = 12; |
| 1057 const intptr_t instance_size = cls.instance_size(); | 1057 const intptr_t instance_size = cls.instance_size(); |
| 1058 ASSERT(instance_size > 0); | 1058 ASSERT(instance_size > 0); |
| 1059 Isolate* isolate = Isolate::Current(); | 1059 Isolate* isolate = Isolate::Current(); |
| 1060 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) && | 1060 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) && |
| 1061 !cls.TraceAllocation(isolate)) { | 1061 !cls.TraceAllocation(isolate)) { |
| 1062 Label slow_case; | 1062 Label slow_case; |
| 1063 // Allocate the object and update top to point to | 1063 // Allocate the object and update top to point to |
| 1064 // next object start and initialize the allocated object. | 1064 // next object start and initialize the allocated object. |
| 1065 Heap::Space space = Heap::SpaceForAllocation(cls.id()); | 1065 Heap::Space space = Heap::kNew; |
| 1066 __ ldr(R9, Address(THR, Thread::heap_offset())); | 1066 __ ldr(R9, Address(THR, Thread::heap_offset())); |
| 1067 __ ldr(R0, Address(R9, Heap::TopOffset(space))); | 1067 __ ldr(R0, Address(R9, Heap::TopOffset(space))); |
| 1068 __ AddImmediate(R1, R0, instance_size); | 1068 __ AddImmediate(R1, R0, instance_size); |
| 1069 // Check if the allocation fits into the remaining space. | 1069 // Check if the allocation fits into the remaining space. |
| 1070 // R0: potential new object start. | 1070 // R0: potential new object start. |
| 1071 // R1: potential next object start. | 1071 // R1: potential next object start. |
| 1072 // R9: heap. | 1072 // R9: heap. |
| 1073 __ ldr(IP, Address(R9, Heap::EndOffset(space))); | 1073 __ ldr(IP, Address(R9, Heap::EndOffset(space))); |
| 1074 __ cmp(R1, Operand(IP)); | 1074 __ cmp(R1, Operand(IP)); |
| 1075 if (FLAG_use_slow_path) { | 1075 if (FLAG_use_slow_path) { |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 } | 2179 } |
| 2180 | 2180 |
| 2181 | 2181 |
| 2182 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2182 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2183 __ bkpt(0); | 2183 __ bkpt(0); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 } // namespace dart | 2186 } // namespace dart |
| 2187 | 2187 |
| 2188 #endif // defined TARGET_ARCH_ARM | 2188 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |