Chromium Code Reviews| Index: runtime/vm/assembler_x64.cc |
| =================================================================== |
| --- runtime/vm/assembler_x64.cc (revision 9013) |
| +++ runtime/vm/assembler_x64.cc (working copy) |
| @@ -879,6 +879,15 @@ |
| } |
| +void Assembler::adcl(Register dst, Register src) { |
|
Vyacheslav Egorov (Google)
2012/06/22 10:36:28
please add a test for this instruction in assemble
|
| + AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| + Operand operand(src); |
| + EmitOperandREX(dst, operand, REX_NONE); |
| + EmitUint8(0x13); |
| + EmitOperand(dst & 7, operand); |
| +} |
| + |
| + |
| void Assembler::subl(Register dst, Register src) { |
| AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| Operand operand(src); |
| @@ -1405,14 +1414,11 @@ |
| 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)); |
| + andl(value, Immediate(0x5)); |
| + shrl(value, Immediate(1)); |
| + adcl(value, object); |
| + andl(value, Immediate(0x7)); |
| + cmpl(value, Immediate(0x4)); |
| j(NOT_ZERO, no_update, Assembler::kNearJump); |
| } |
| @@ -1423,13 +1429,15 @@ |
| movq(dest, value); |
| Label done; |
| + pushq(value); |
| StoreIntoObjectFilter(object, value, &done); |
| // A store buffer update is required. |
| - pushq(RAX); |
| + if (value != RAX) pushq(RAX); |
| leaq(RAX, dest); |
| call(&StubCode::UpdateStoreBufferLabel()); |
| - popq(RAX); |
| + if (value != RAX) popq(RAX); |
| Bind(&done); |
| + popq(value); |
| } |
| @@ -1439,9 +1447,11 @@ |
| movq(dest, value); |
| #if defined(DEBUG) |
| Label done; |
| + pushq(value); |
| StoreIntoObjectFilter(object, value, &done); |
| Stop("Store buffer update is required"); |
| Bind(&done); |
| + popq(value); |
| #endif // defined(DEBUG) |
| // No store buffer update. |
| } |