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

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

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 // R3: array size. 591 // R3: array size.
592 // R7: potential next object start. 592 // R7: potential next object start.
593 // R8: points to new space object. 593 // R8: points to new space object.
594 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset()); 594 __ LoadFromOffset(kWord, IP, R8, Scavenger::end_offset());
595 __ cmp(R7, ShifterOperand(IP)); 595 __ cmp(R7, ShifterOperand(IP));
596 __ b(&slow_case, CS); // Branch if unsigned higher or equal. 596 __ b(&slow_case, CS); // Branch if unsigned higher or equal.
597 597
598 // Successfully allocated the object(s), now update top to point to 598 // Successfully allocated the object(s), now update top to point to
599 // next object start and initialize the object. 599 // next object start and initialize the object.
600 // R0: potential new object start. 600 // R0: potential new object start.
601 // R3: array size.
601 // R7: potential next object start. 602 // R7: potential next object start.
602 // R8: Points to new space object. 603 // R8: Points to new space object.
603 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); 604 __ StoreToOffset(kWord, R7, R8, Scavenger::top_offset());
604 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); 605 __ add(R0, R0, ShifterOperand(kHeapObjectTag));
606 __ BumpAllocationCount(Heap::kNew, kArrayCid, R3, R8);
605 607
606 // R0: new object start as a tagged pointer. 608 // R0: new object start as a tagged pointer.
607 // R1: array element type. 609 // R1: array element type.
608 // R2: array length as Smi. 610 // R2: array length as Smi.
609 // R3: array size. 611 // R3: array size.
610 // R7: new object end address. 612 // R7: new object end address.
611 613
612 // Store the type argument field. 614 // Store the type argument field.
613 __ StoreIntoObjectNoBarrier( 615 __ StoreIntoObjectNoBarrier(
614 R0, 616 R0,
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 } 929 }
928 930
929 // Successfully allocated the object, now update top to point to 931 // Successfully allocated the object, now update top to point to
930 // next object start and initialize the object. 932 // next object start and initialize the object.
931 // R0: new object. 933 // R0: new object.
932 // R1: number of context variables. 934 // R1: number of context variables.
933 // R2: object size. 935 // R2: object size.
934 // R3: next object start. 936 // R3: next object start.
935 __ str(R3, Address(R5, 0)); 937 __ str(R3, Address(R5, 0));
936 __ add(R0, R0, ShifterOperand(kHeapObjectTag)); 938 __ add(R0, R0, ShifterOperand(kHeapObjectTag));
939 __ BumpAllocationCount(Heap::kNew, context_class.id(), R2, R5);
937 940
938 // Calculate the size tag. 941 // Calculate the size tag.
939 // R0: new object. 942 // R0: new object.
940 // R1: number of context variables. 943 // R1: number of context variables.
941 // R2: object size. 944 // R2: object size.
942 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; 945 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
943 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag); 946 __ CompareImmediate(R2, RawObject::SizeTag::kMaxSizeTag);
944 // If no size tag overflow, shift R2 left, else set R2 to zero. 947 // If no size tag overflow, shift R2 left, else set R2 to zero.
945 __ mov(R2, ShifterOperand(R2, LSL, shift), LS); 948 __ mov(R2, ShifterOperand(R2, LSL, shift), LS);
946 __ mov(R2, ShifterOperand(0), HI); 949 __ mov(R2, ShifterOperand(0), HI);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 __ cmp(R3, ShifterOperand(IP)); 1112 __ cmp(R3, ShifterOperand(IP));
1110 if (FLAG_use_slow_path) { 1113 if (FLAG_use_slow_path) {
1111 __ b(&slow_case); 1114 __ b(&slow_case);
1112 } else { 1115 } else {
1113 __ b(&slow_case, CS); // Branch if unsigned higher or equal. 1116 __ b(&slow_case, CS); // Branch if unsigned higher or equal.
1114 } 1117 }
1115 1118
1116 // Successfully allocated the object(s), now update top to point to 1119 // Successfully allocated the object(s), now update top to point to
1117 // next object start and initialize the object. 1120 // next object start and initialize the object.
1118 __ str(R3, Address(R5, 0)); 1121 __ str(R3, Address(R5, 0));
1122 __ BumpAllocationCount(Heap::kNew, cls.id(), R5);
1119 1123
1120 if (is_cls_parameterized) { 1124 if (is_cls_parameterized) {
1121 // Initialize the type arguments field in the object. 1125 // Initialize the type arguments field in the object.
1122 // R2: new object start. 1126 // R2: new object start.
1123 // R4: potential new object end and, if R4 != R3, potential new 1127 // R4: potential new object end and, if R4 != R3, potential new
1124 // InstantiatedTypeArguments object start. 1128 // InstantiatedTypeArguments object start.
1125 // R3: next object start. 1129 // R3: next object start.
1126 Label type_arguments_ready; 1130 Label type_arguments_ready;
1127 __ cmp(R4, ShifterOperand(R3)); 1131 __ cmp(R4, ShifterOperand(R3));
1128 __ b(&type_arguments_ready, EQ); 1132 __ b(&type_arguments_ready, EQ);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 __ cmp(R3, ShifterOperand(IP)); 1277 __ cmp(R3, ShifterOperand(IP));
1274 if (FLAG_use_slow_path) { 1278 if (FLAG_use_slow_path) {
1275 __ b(&slow_case); 1279 __ b(&slow_case);
1276 } else { 1280 } else {
1277 __ b(&slow_case, CS); // Branch if unsigned higher or equal. 1281 __ b(&slow_case, CS); // Branch if unsigned higher or equal.
1278 } 1282 }
1279 1283
1280 // Successfully allocated the object, now update top to point to 1284 // Successfully allocated the object, now update top to point to
1281 // next object start and initialize the object. 1285 // next object start and initialize the object.
1282 __ str(R3, Address(R5, 0)); 1286 __ str(R3, Address(R5, 0));
1283 1287 // R3: Size of allocation in bytes.
1288 __ sub(R3, R3, ShifterOperand(R2));
1289 __ BumpAllocationCount(Heap::kNew, cls.id(), R3, R5);
1284 // R2: new closure object. 1290 // R2: new closure object.
1285 // R4: new context object (only if is_implicit_closure). 1291 // R4: new context object (only if is_implicit_closure).
1286 // Set the tags. 1292 // Set the tags.
1287 uword tags = 0; 1293 uword tags = 0;
1288 tags = RawObject::SizeTag::update(closure_size, tags); 1294 tags = RawObject::SizeTag::update(closure_size, tags);
1289 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1295 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1290 __ LoadImmediate(R0, tags); 1296 __ LoadImmediate(R0, tags);
1291 __ str(R0, Address(R2, Instance::tags_offset())); 1297 __ str(R0, Address(R2, Instance::tags_offset()));
1292 1298
1293 // Initialize the function field in the object. 1299 // Initialize the function field in the object.
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 const Register right = R0; 2148 const Register right = R0;
2143 __ ldr(left, Address(SP, 1 * kWordSize)); 2149 __ ldr(left, Address(SP, 1 * kWordSize));
2144 __ ldr(right, Address(SP, 0 * kWordSize)); 2150 __ ldr(right, Address(SP, 0 * kWordSize));
2145 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2151 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2146 __ Ret(); 2152 __ Ret();
2147 } 2153 }
2148 2154
2149 } // namespace dart 2155 } // namespace dart
2150 2156
2151 #endif // defined TARGET_ARCH_ARM 2157 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698