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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 10578046: - Inline the store buffer update into a stub instead of (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 | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 8921)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1080,6 +1080,53 @@
}
+// Helper stub to implement Assembler::StoreIntoObject.
+// Input parameters:
+// EAX: Address being stored
+void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
+ Label L;
+ // Save values being destroyed.
+ __ pushl(CTX);
+ __ pushl(EBX);
+
+ // Load the isolate out of the context.
+ // EAX: Address being stored
+ __ movl(CTX, FieldAddress(CTX, Context::isolate_offset()));
+
+ // Load top_ out of the StoreBufferBlock and add the address to the pointers_.
+ // EAX: Address being stored
+ // CTX: Isolate
+ intptr_t store_buffer_offset = Isolate::store_buffer_offset();
+ __ movl(EBX,
+ Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()));
+ __ movl(Address(CTX,
+ EBX, TIMES_4,
+ store_buffer_offset + StoreBufferBlock::pointers_offset()),
+ EAX);
+
+ // Increment top_ and check for overflow.
+ // EBX: top_
+ // CTX: Isolate
+ __ incl(EBX);
+ __ movl(Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()),
+ EBX);
+ __ cmpl(EBX, Immediate(StoreBufferBlock::kSize));
+ __ j(NOT_EQUAL, &L, Assembler::kNearJump);
+
+ // Handle overflow: Reset the top_ pointer.
+ // CTX: Isolate
+ __ movl(Address(CTX, store_buffer_offset + StoreBufferBlock::top_offset()),
+ Immediate(0));
+
+ __ Bind(&L);
+
+ // Restore values.
+ __ popl(EBX);
+ __ popl(CTX);
+ __ ret();
+}
+
+
// Called for inline allocation of objects.
// Input parameters:
// ESP + 8 : type arguments object (only if class is parameterized).
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698