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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 10607002: - Remove a few jumps from store barrier code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 8953)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -1387,15 +1387,12 @@
void Assembler::StoreIntoObjectFilter(Register object,
Register value,
Label* no_update) {
- // Check that 'value' is a new object. Store buffer updates are not
- // required when storing a smi or an old object.
- testl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag));
- j(PARITY_ODD, no_update, Assembler::kNearJump);
- j(ZERO, no_update, Assembler::kNearJump);
- // Check that 'object' is an old object. A store buffer update is
- // not required when storing into a new object.
- testl(object, Immediate(kNewObjectAlignmentOffset));
- j(NOT_ZERO, no_update, Assembler::kNearJump);
+ andl(value, Immediate(0x5));
kasperl 2012/06/21 05:05:47 I think you should add a comment here explaning th
Ivan Posva 2012/06/22 06:56:22 Thanks! Half of the credit goes to Slava... I wil
+ shrl(value, Immediate(1));
+ adcl(value, object);
+ andl(value, Immediate(0x7));
+ cmpl(value, Immediate(0x4));
+ j(NOT_ZERO, no_update);
sra1 2012/06/22 05:17:44 and value,7 lea value,[object*8 + value] and value
Ivan Posva 2012/06/22 06:56:22 Thanks for the suggestion to use lea to separate t
}
@@ -1404,13 +1401,15 @@
Register value) {
movl(dest, value);
Label done;
+ pushl(value);
StoreIntoObjectFilter(object, value, &done);
// A store buffer update is required.
- pushl(EAX); // Preserve EAX.
+ if (value != EAX) pushl(EAX); // Preserve EAX.
leal(EAX, dest);
call(&StubCode::UpdateStoreBufferLabel());
- popl(EAX); // Restore EAX.
+ if (value != EAX) popl(EAX); // Restore EAX.
Bind(&done);
+ popl(value);
}
@@ -1420,9 +1419,11 @@
movl(dest, value);
#if defined(DEBUG)
Label done;
+ pushl(value);
StoreIntoObjectFilter(object, value, &done);
Stop("Store buffer update is required");
Bind(&done);
+ popl(value);
#endif // defined(DEBUG)
// No store buffer update.
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698