Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 1210283003: Extend allocation profile testing (Closed) Base URL: git@github.com:dart-lang/sdk.git@profile_model_public
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698