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

Unified Diff: runtime/vm/intrinsifier_mips.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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intrinsifier_mips.cc
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 8e80db146745df0346c8b9ae95f23810ae7d93e6..98b8c0a8470166f7c8d50ca5ea7b6526770ffe42 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -71,6 +71,7 @@ void Intrinsifier::List_Allocate(Assembler* assembler) {
// next object start and initialize the object.
__ sw(T1, Address(T3, 0));
__ addiu(T0, T0, Immediate(kHeapObjectTag));
+ __ BumpAllocationCount(Heap::kNew, kArrayCid, T2, T4);
// Initialize the tags.
// T0: new object start as a tagged pointer.
@@ -126,7 +127,6 @@ void Intrinsifier::List_Allocate(Assembler* assembler) {
__ b(&init_loop);
__ delay_slot()->addiu(T2, T2, Immediate(kWordSize));
__ Bind(&done);
-
__ Ret(); // Returns the newly allocated object in V0.
__ delay_slot()->mov(V0, T0);
__ Bind(&fall_through);
@@ -306,7 +306,7 @@ void Intrinsifier::GrowableList_Allocate(Assembler* assembler) {
V0,
FieldAddress(V0, GrowableObjectArray::type_arguments_offset()),
T1);
-
+ __ BumpAllocationCount(Heap::kNew, kGrowableObjectArrayCid, T1);
// Set the length field in the growable array object to 0.
__ Ret(); // Returns the newly allocated object in V0.
__ delay_slot()->sw(ZR,
@@ -498,7 +498,7 @@ void Intrinsifier::GrowableList_add(Assembler* assembler) {
__ LoadImmediate(T3, heap->TopAddress()); \
__ sw(T1, Address(T3, 0)); \
__ AddImmediate(V0, kHeapObjectTag); \
- \
+ __ BumpAllocationCount(Heap::kNew, cid, T2, T4); \
/* Initialize the tags. */ \
/* V0: new object start as a tagged pointer. */ \
/* T1: new object end address. */ \
@@ -540,7 +540,6 @@ void Intrinsifier::GrowableList_add(Assembler* assembler) {
__ b(&init_loop); \
__ delay_slot()->addiu(T2, T2, Immediate(kWordSize)); \
__ Bind(&done); \
- \
__ Ret(); \
__ Bind(&fall_through); \
@@ -854,7 +853,7 @@ void Intrinsifier::Integer_shl(Assembler* assembler) {
const Class& mint_class = Class::Handle(
Isolate::Current()->object_store()->mint_class());
- __ TryAllocate(mint_class, &fall_through, V0);
+ __ TryAllocate(mint_class, &fall_through, V0, T1);
__ sw(T0, FieldAddress(V0, Mint::value_offset()));
__ Ret();
@@ -1194,7 +1193,7 @@ static void DoubleArithmeticOperations(Assembler* assembler, Token::Kind kind) {
}
const Class& double_class = Class::Handle(
Isolate::Current()->object_store()->double_class());
- __ TryAllocate(double_class, &fall_through, V0); // Result register.
+ __ TryAllocate(double_class, &fall_through, V0, T1); // Result register.
__ swc1(F0, FieldAddress(V0, Double::value_offset()));
__ Ret();
__ delay_slot()->swc1(F1,
@@ -1242,7 +1241,7 @@ void Intrinsifier::Double_mulFromInteger(Assembler* assembler) {
__ muld(D0, D0, D1);
const Class& double_class = Class::Handle(
Isolate::Current()->object_store()->double_class());
- __ TryAllocate(double_class, &fall_through, V0); // Result register.
+ __ TryAllocate(double_class, &fall_through, V0, T1); // Result register.
__ swc1(F0, FieldAddress(V0, Double::value_offset()));
__ Ret();
__ delay_slot()->swc1(F1,
@@ -1264,7 +1263,7 @@ void Intrinsifier::Double_fromInteger(Assembler* assembler) {
__ cvtdw(D0, F4);
const Class& double_class = Class::Handle(
Isolate::Current()->object_store()->double_class());
- __ TryAllocate(double_class, &fall_through, V0); // Result register.
+ __ TryAllocate(double_class, &fall_through, V0, T1); // Result register.
__ swc1(F0, FieldAddress(V0, Double::value_offset()));
__ Ret();
__ delay_slot()->swc1(F1,
@@ -1350,7 +1349,7 @@ void Intrinsifier::Math_sqrt(Assembler* assembler) {
__ sqrtd(D0, D1);
const Class& double_class = Class::Handle(
Isolate::Current()->object_store()->double_class());
- __ TryAllocate(double_class, &fall_through, V0); // Result register.
+ __ TryAllocate(double_class, &fall_through, V0, T1); // Result register.
__ swc1(F0, FieldAddress(V0, Double::value_offset()));
__ Ret();
__ delay_slot()->swc1(F1,
@@ -1607,6 +1606,8 @@ static void TryAllocateOnebyteString(Assembler* assembler,
__ sw(T1, Address(T3, 0));
__ AddImmediate(V0, kHeapObjectTag);
+ __ BumpAllocationCount(Heap::kNew, kOneByteStringCid, T2, T3);
+
// Initialize the tags.
// V0: new object start as a tagged pointer.
// T1: new object end address.

Powered by Google App Engine
This is Rietveld 408576698