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

Side by Side Diff: runtime/vm/stub_code_arm.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/profiler_test.cc ('k') | runtime/vm/stub_code_arm64.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_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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 // The generated code is different if the class is parameterized. 1076 // The generated code is different if the class is parameterized.
1077 const bool is_cls_parameterized = cls.NumTypeArguments() > 0; 1077 const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
1078 ASSERT(!is_cls_parameterized || 1078 ASSERT(!is_cls_parameterized ||
1079 (cls.type_arguments_field_offset() != Class::kNoTypeArguments)); 1079 (cls.type_arguments_field_offset() != Class::kNoTypeArguments));
1080 // kInlineInstanceSize is a constant used as a threshold for determining 1080 // kInlineInstanceSize is a constant used as a threshold for determining
1081 // when the object initialization should be done as a loop or as 1081 // when the object initialization should be done as a loop or as
1082 // straight line code. 1082 // straight line code.
1083 const int kInlineInstanceSize = 12; 1083 const int kInlineInstanceSize = 12;
1084 const intptr_t instance_size = cls.instance_size(); 1084 const intptr_t instance_size = cls.instance_size();
1085 ASSERT(instance_size > 0); 1085 ASSERT(instance_size > 0);
1086 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size)) { 1086 if (FLAG_inline_alloc && Heap::IsAllocatableInNewSpace(instance_size) &&
1087 !cls.trace_allocation()) {
1087 Label slow_case; 1088 Label slow_case;
1088 // Allocate the object and update top to point to 1089 // Allocate the object and update top to point to
1089 // next object start and initialize the allocated object. 1090 // next object start and initialize the allocated object.
1090 Heap* heap = Isolate::Current()->heap(); 1091 Heap* heap = Isolate::Current()->heap();
1091 Heap::Space space = heap->SpaceForAllocation(cls.id()); 1092 Heap::Space space = heap->SpaceForAllocation(cls.id());
1092 __ LoadImmediate(R5, heap->TopAddress(space)); 1093 __ LoadImmediate(R5, heap->TopAddress(space));
1093 __ ldr(R0, Address(R5, 0)); 1094 __ ldr(R0, Address(R5, 0));
1094 __ AddImmediate(R1, R0, instance_size); 1095 __ AddImmediate(R1, R0, instance_size);
1095 // Check if the allocation fits into the remaining space. 1096 // Check if the allocation fits into the remaining space.
1096 // R0: potential new object start. 1097 // R0: potential new object start.
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 // Result: 2123 // Result:
2123 // R1: entry point. 2124 // R1: entry point.
2124 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2125 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2125 EmitMegamorphicLookup(assembler, R0, R1, R1); 2126 EmitMegamorphicLookup(assembler, R0, R1, R1);
2126 __ Ret(); 2127 __ Ret();
2127 } 2128 }
2128 2129
2129 } // namespace dart 2130 } // namespace dart
2130 2131
2131 #endif // defined TARGET_ARCH_ARM 2132 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/profiler_test.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698