| 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 // when the object initialization should be done as a loop or as | 1082 // when the object initialization should be done as a loop or as |
| 1083 // straight line code. | 1083 // straight line code. |
| 1084 const int kInlineInstanceSize = 12; // In words. | 1084 const int kInlineInstanceSize = 12; // In words. |
| 1085 const intptr_t instance_size = cls.instance_size(); | 1085 const intptr_t instance_size = cls.instance_size(); |
| 1086 ASSERT(instance_size > 0); | 1086 ASSERT(instance_size > 0); |
| 1087 __ LoadObject(R12, Object::null_object(), PP); | 1087 __ LoadObject(R12, Object::null_object(), PP); |
| 1088 if (is_cls_parameterized) { | 1088 if (is_cls_parameterized) { |
| 1089 __ movq(RDX, Address(RSP, kObjectTypeArgumentsOffset)); | 1089 __ movq(RDX, Address(RSP, kObjectTypeArgumentsOffset)); |
| 1090 // RDX: instantiated type arguments. | 1090 // RDX: instantiated type arguments. |
| 1091 } | 1091 } |
| 1092 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size)) { | 1092 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) && |
| 1093 !cls.trace_allocation()) { |
| 1093 Label slow_case; | 1094 Label slow_case; |
| 1094 // Allocate the object and update top to point to | 1095 // Allocate the object and update top to point to |
| 1095 // next object start and initialize the allocated object. | 1096 // next object start and initialize the allocated object. |
| 1096 // RDX: instantiated type arguments (if is_cls_parameterized). | 1097 // RDX: instantiated type arguments (if is_cls_parameterized). |
| 1097 Heap* heap = Isolate::Current()->heap(); | 1098 Heap* heap = Isolate::Current()->heap(); |
| 1098 Heap::Space space = heap->SpaceForAllocation(cls.id()); | 1099 Heap::Space space = heap->SpaceForAllocation(cls.id()); |
| 1099 __ movq(RCX, Immediate(heap->TopAddress(space))); | 1100 __ movq(RCX, Immediate(heap->TopAddress(space))); |
| 1100 __ movq(RAX, Address(RCX, 0)); | 1101 __ movq(RAX, Address(RCX, 0)); |
| 1101 __ leaq(RBX, Address(RAX, instance_size)); | 1102 __ leaq(RBX, Address(RAX, instance_size)); |
| 1102 // Check if the allocation fits into the remaining space. | 1103 // Check if the allocation fits into the remaining space. |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2176 // Result: | 2177 // Result: |
| 2177 // RCX: entry point. | 2178 // RCX: entry point. |
| 2178 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2179 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2179 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2180 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
| 2180 __ ret(); | 2181 __ ret(); |
| 2181 } | 2182 } |
| 2182 | 2183 |
| 2183 } // namespace dart | 2184 } // namespace dart |
| 2184 | 2185 |
| 2185 #endif // defined TARGET_ARCH_X64 | 2186 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |