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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 // kInlineInstanceSize is a constant used as a threshold for determining | 1048 // kInlineInstanceSize is a constant used as a threshold for determining |
1049 // when the object initialization should be done as a loop or as | 1049 // when the object initialization should be done as a loop or as |
1050 // straight line code. | 1050 // straight line code. |
1051 const int kInlineInstanceSize = 12; // In words. | 1051 const int kInlineInstanceSize = 12; // In words. |
1052 const intptr_t instance_size = cls.instance_size(); | 1052 const intptr_t instance_size = cls.instance_size(); |
1053 ASSERT(instance_size > 0); | 1053 ASSERT(instance_size > 0); |
1054 if (is_cls_parameterized) { | 1054 if (is_cls_parameterized) { |
1055 __ movl(EDX, Address(ESP, kObjectTypeArgumentsOffset)); | 1055 __ movl(EDX, Address(ESP, kObjectTypeArgumentsOffset)); |
1056 // EDX: instantiated type arguments. | 1056 // EDX: instantiated type arguments. |
1057 } | 1057 } |
1058 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size)) { | 1058 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) && |
| 1059 !cls.trace_allocation()) { |
1059 Label slow_case; | 1060 Label slow_case; |
1060 // Allocate the object and update top to point to | 1061 // Allocate the object and update top to point to |
1061 // next object start and initialize the allocated object. | 1062 // next object start and initialize the allocated object. |
1062 // EDX: instantiated type arguments (if is_cls_parameterized). | 1063 // EDX: instantiated type arguments (if is_cls_parameterized). |
1063 Heap* heap = Isolate::Current()->heap(); | 1064 Heap* heap = Isolate::Current()->heap(); |
1064 Heap::Space space = heap->SpaceForAllocation(cls.id()); | 1065 Heap::Space space = heap->SpaceForAllocation(cls.id()); |
1065 __ movl(EAX, Address::Absolute(heap->TopAddress(space))); | 1066 __ movl(EAX, Address::Absolute(heap->TopAddress(space))); |
1066 __ leal(EBX, Address(EAX, instance_size)); | 1067 __ leal(EBX, Address(EAX, instance_size)); |
1067 // Check if the allocation fits into the remaining space. | 1068 // Check if the allocation fits into the remaining space. |
1068 // EAX: potential new object start. | 1069 // EAX: potential new object start. |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 // EBX: entry point. | 2124 // EBX: entry point. |
2124 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2125 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2125 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); | 2126 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); |
2126 __ ret(); | 2127 __ ret(); |
2127 } | 2128 } |
2128 | 2129 |
2129 | 2130 |
2130 } // namespace dart | 2131 } // namespace dart |
2131 | 2132 |
2132 #endif // defined TARGET_ARCH_IA32 | 2133 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |