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

Unified Diff: src/objects-inl.h

Issue 227133007: Allow race-full access of map instance size when sweeping concurrently. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index d6665d6f0165c32d2c891e5056e9169effac7496..4c9f160c4afd04d73100bfb23e4b9caf3b43c76d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1232,9 +1232,16 @@ MaybeObject* Object::GetProperty(Name* key, PropertyAttributes* attributes) {
#define READ_BYTE_FIELD(p, offset) \
(*reinterpret_cast<byte*>(FIELD_ADDR(p, offset)))
+#define NOBARRIER_READ_BYTE_FIELD(p, offset) \
+ static_cast<byte>(NoBarrier_Load( \
+ reinterpret_cast<Atomic8*>(FIELD_ADDR(p, offset))) )
+
#define WRITE_BYTE_FIELD(p, offset, value) \
(*reinterpret_cast<byte*>(FIELD_ADDR(p, offset)) = value)
+#define NOBARRIER_WRITE_BYTE_FIELD(p, offset, value) \
+ NoBarrier_Store(reinterpret_cast<Atomic8*>(FIELD_ADDR(p, offset)), \
+ static_cast<Atomic8>(value));
Object** HeapObject::RawField(HeapObject* obj, int byte_offset) {
return &READ_FIELD(obj, byte_offset);
@@ -4151,7 +4158,8 @@ void Map::set_visitor_id(int id) {
int Map::instance_size() {
- return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2;
+ return NOBARRIER_READ_BYTE_FIELD(
+ this, kInstanceSizeOffset) << kPointerSizeLog2;
}
@@ -4221,7 +4229,8 @@ void Map::set_instance_size(int value) {
ASSERT_EQ(0, value & (kPointerSize - 1));
value >>= kPointerSizeLog2;
ASSERT(0 <= value && value < 256);
- WRITE_BYTE_FIELD(this, kInstanceSizeOffset, static_cast<byte>(value));
+ NOBARRIER_WRITE_BYTE_FIELD(
+ this, kInstanceSizeOffset, static_cast<byte>(value));
}
@@ -7075,11 +7084,15 @@ void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj,
#undef ACCESSORS
#undef ACCESSORS_TO_SMI
#undef SMI_ACCESSORS
+#undef SYNCHRONIZED_SMI_ACCESSORS
+#undef NOBARRIER_SMI_ACCESSORS
#undef BOOL_GETTER
#undef BOOL_ACCESSORS
#undef FIELD_ADDR
#undef READ_FIELD
+#undef NOBARRIER_READ_FIELD
#undef WRITE_FIELD
+#undef NOBARRIER_WRITE_FIELD
#undef WRITE_BARRIER
#undef CONDITIONAL_WRITE_BARRIER
#undef READ_DOUBLE_FIELD
@@ -7094,6 +7107,8 @@ void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj,
#undef WRITE_SHORT_FIELD
#undef READ_BYTE_FIELD
#undef WRITE_BYTE_FIELD
+#undef NOBARRIER_READ_BYTE_FIELD
+#undef NOBARRIER_WRITE_BYTE_FIELD
} } // namespace v8::internal
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698