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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 10658008: - Document the store barrier. (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 | « no previous file | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 9050)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -1384,14 +1384,23 @@
}
+// Destroys the value register.
void Assembler::StoreIntoObjectFilter(Register object,
Register value,
Label* no_update) {
- andl(value, Immediate(0x5));
+ // For the value we are only interested in the new/old bit and the tag bit.
+ andl(value, Immediate(kNewObjectAlignmentOffset | kHeapObjectTag));
+ // Shift the tag bit into the carry.
shrl(value, Immediate(1));
+ // Add the tag bits together, if the value is not a Smi the addition will
+ // overflow into the next bit, leaving us with a zero low bit.
adcl(value, object);
- andl(value, Immediate(0x7));
- cmpl(value, Immediate(0x4));
+ // Mask out higher, uninteresting bits which were polluted by dest.
+ andl(value, Immediate(kObjectAlignment - 1));
+ // Compare with the expected bit pattern.
+ cmpl(value, Immediate(
+ (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag +
+ kOldObjectAlignmentOffset + kHeapObjectTag));
j(NOT_ZERO, no_update, Assembler::kNearJump);
}
« no previous file with comments | « no previous file | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698