Chromium Code Reviews| 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. |
| } |