Index: runtime/vm/assembler_x64.cc |
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc |
index 20153ad438ceca507c377ac0b4605406633e2cd4..2936d98112c7401a0007b9aa0112c41373a4274e 100644 |
--- a/runtime/vm/assembler_x64.cc |
+++ b/runtime/vm/assembler_x64.cc |
@@ -1594,19 +1594,36 @@ void Assembler::StoreIntoObjectFilter(Register object, |
void Assembler::StoreIntoObject(Register object, |
const FieldAddress& dest, |
Register value) { |
- // TODO(kmillikin): pass temp registers to avoid pushing registers. |
+ ASSERT(object != value); |
movq(dest, value); |
- |
- Label done; |
- pushq(value); |
+ Label done, fail; |
StoreIntoObjectFilter(object, value, &done); |
// A store buffer update is required. |
+ pushq(RCX); |
+ pushq(RDX); |
+ pushq(RBX); |
if (value != RAX) pushq(RAX); |
leaq(RAX, dest); |
call(&StubCode::UpdateStoreBufferLabel()); |
if (value != RAX) popq(RAX); |
+ cmpq(RBX, Address(RSP, 0)); |
Ivan Posva
2012/09/11 11:57:30
?
Vyacheslav Egorov (Google)
2012/09/11 12:18:05
reverted
|
+ j(NOT_ZERO, &fail); |
+ popq(RBX); |
+ |
+ cmpq(RDX, Address(RSP, 0)); |
+ j(NOT_ZERO, &fail); |
+ popq(RDX); |
+ |
+ cmpq(RCX, Address(RSP, 0)); |
+ j(NOT_ZERO, &fail); |
+ popq(RCX); |
+ |
+ jmp(&done); |
+ |
+ Bind(&fail); |
+ int3(); |
+ |
Bind(&done); |
- popq(value); |
} |