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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 10581049: - Implement the filtering store barrier on x64. (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
« runtime/vm/assembler_x64.h ('K') | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 8929)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -657,12 +657,12 @@
// R10: Array length as Smi.
// Store the type argument field.
- __ StoreIntoObject(RAX,
- FieldAddress(RAX, Array::type_arguments_offset()),
- RBX);
+ __ StoreIntoObjectNoBarrier(
+ RAX, FieldAddress(RAX, Array::type_arguments_offset()), RBX);
// Set the length field.
- __ StoreIntoObject(RAX, FieldAddress(RAX, Array::length_offset()), R10);
+ __ StoreIntoObjectNoBarrier(
+ RAX, FieldAddress(RAX, Array::length_offset()), R10);
// Calculate the size tag.
// RAX: new object start as a tagged pointer.
@@ -1068,8 +1068,47 @@
// Helper stub to implement Assembler::StoreIntoObject.
// Input parameters:
+// RAX: Address being stored
void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
- __ Unimplemented("StubCode::GenerateUpdateStoreBufferStub");
+ // Save registers being destroyed.
+ __ pushq(CTX);
+ __ pushq(RBX);
+
+ // Load the isolate out of the context.
+ // RAX: Address being stored
+ __ movq(CTX, FieldAddress(CTX, Context::isolate_offset()));
+
+ // Load top_ out of the StoreBufferBlock and add teh address to the pointers_.
srdjan 2012/06/20 23:28:27 s/teh/the/
+ // RAX: Address being stored
+ // CTX: Isolate
+ intptr_t store_buffer_offset = Isolate::store_buffer_offset();
+ __ movl(RBX,
srdjan 2012/06/20 23:28:27 movq?
Ivan Posva 2012/06/20 23:48:01 top_ in StoreBufferBlock is an int32_t. I had thes
+ Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()));
+ __ movq(Address(CTX,
+ RBX, TIMES_4,
+ store_buffer_offset + StoreBufferBlock::pointers_offset()),
+ RAX);
+
+ // Increment top_ and check for overflow.
+ // RBX: top_
+ // CTX: Isolate
+ Label L;
+ __ incq(RBX);
+ __ movl(Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()),
+ RBX);
srdjan 2012/06/20 23:28:27 movq?
+ __ cmpl(RBX, Immediate(StoreBufferBlock::kSize));
srdjan 2012/06/20 23:28:27 cmpq?
+ __ j(NOT_EQUAL, &L, Assembler::kNearJump);
+
+ // Handle overflow: Reset the top_ pointer.
+ // CTX: Isolate
+ __ movl(RBX, Immediate(0));
+ __ movl(Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()),
srdjan 2012/06/20 23:28:27 movq (both).
+ RBX);
+
+ __ Bind(&L);
+ // Restore values.
+ __ popq(RBX);
+ __ popq(CTX);
__ ret();
}
« runtime/vm/assembler_x64.h ('K') | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698