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

Unified Diff: runtime/vm/intrinsifier_ia32.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, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intrinsifier_ia32.cc
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index c334b91a3ec80366bb01f7e6ed65db91d371d1dc..73eb46d6628dd7558efb4dd2d937f2e67193a39f 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -129,6 +129,7 @@ void Intrinsifier::List_Allocate(Assembler* assembler) {
__ addl(EDI, Immediate(kWordSize));
__ jmp(&init_loop, Assembler::kNearJump);
__ Bind(&done);
+ __ BumpAllocationCount(kArrayCid, EBX);
__ ret(); // returns the newly allocated object in EAX.
__ Bind(&fall_through);
@@ -303,6 +304,7 @@ void Intrinsifier::GrowableList_Allocate(Assembler* assembler) {
// Set the length field in the growable array object to 0.
__ movl(FieldAddress(EAX, GrowableObjectArray::length_offset()),
Immediate(0));
+ __ BumpAllocationCount(kGrowableObjectArrayCid, EBX);
__ ret(); // returns the newly allocated object in EAX.
__ Bind(&fall_through);
@@ -535,7 +537,7 @@ void Intrinsifier::GrowableList_add(Assembler* assembler) {
__ addl(EDI, Immediate(kWordSize)); \
__ jmp(&init_loop, Assembler::kNearJump); \
__ Bind(&done); \
- \
+ __ BumpAllocationCount(cid, EBX); \
__ ret(); \
__ Bind(&fall_through); \
@@ -872,12 +874,14 @@ void Intrinsifier::Integer_shl(Assembler* assembler) {
__ xorl(EDI, EDI);
__ shld(EDI, EAX);
// Result in EDI (high) and EBX (low).
+ __ pushl(EBX);
const Class& mint_class = Class::Handle(
Isolate::Current()->object_store()->mint_class());
__ TryAllocate(mint_class,
&fall_through,
Assembler::kNearJump,
EAX); // Result register.
+ __ popl(EBX);
// EBX and EDI are not objects but integer values.
__ movl(FieldAddress(EAX, Mint::value_offset()), EBX);
__ movl(FieldAddress(EAX, Mint::value_offset() + kWordSize), EDI);
@@ -1660,6 +1664,7 @@ static void TryAllocateOnebyteString(Assembler* assembler,
EDI);
// Clear hash.
__ movl(FieldAddress(EAX, String::hash_offset()), Immediate(0));
+ __ BumpAllocationCount(kOneByteStringCid, EBX);
__ jmp(ok, Assembler::kNearJump);
__ Bind(&pop_and_fail);

Powered by Google App Engine
This is Rietveld 408576698