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

Unified Diff: src/objects-inl.h

Issue 882633002: Reland "Only use FreeSpace objects in the free list" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 11 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 | « src/objects.h ('k') | src/serialize.cc » ('j') | 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 5ee91913251c81f4833f9230afc419b59f7db384..402010e91a7d8058eb9d45971cdcc2e27f60dbb3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3334,7 +3334,6 @@ CAST_ACCESSOR(FixedArrayBase)
CAST_ACCESSOR(FixedDoubleArray)
CAST_ACCESSOR(FixedTypedArrayBase)
CAST_ACCESSOR(Foreign)
-CAST_ACCESSOR(FreeSpace)
CAST_ACCESSOR(GlobalObject)
CAST_ACCESSOR(HeapObject)
CAST_ACCESSOR(JSArray)
@@ -3443,6 +3442,39 @@ SMI_ACCESSORS(String, length, kLengthOffset)
SYNCHRONIZED_SMI_ACCESSORS(String, length, kLengthOffset)
+FreeSpace* FreeSpace::next() {
+ DCHECK(map() == GetHeap()->raw_unchecked_free_space_map() ||
+ (!GetHeap()->deserialization_complete() && map() == NULL));
+ DCHECK_LE(kNextOffset + kPointerSize, nobarrier_size());
+ return reinterpret_cast<FreeSpace*>(
+ Memory::Address_at(address() + kNextOffset));
+}
+
+
+FreeSpace** FreeSpace::next_address() {
+ DCHECK(map() == GetHeap()->raw_unchecked_free_space_map() ||
+ (!GetHeap()->deserialization_complete() && map() == NULL));
+ DCHECK_LE(kNextOffset + kPointerSize, nobarrier_size());
+ return reinterpret_cast<FreeSpace**>(address() + kNextOffset);
+}
+
+
+void FreeSpace::set_next(FreeSpace* next) {
+ DCHECK(map() == GetHeap()->raw_unchecked_free_space_map() ||
+ (!GetHeap()->deserialization_complete() && map() == NULL));
+ DCHECK_LE(kNextOffset + kPointerSize, nobarrier_size());
+ base::NoBarrier_Store(
+ reinterpret_cast<base::AtomicWord*>(address() + kNextOffset),
+ reinterpret_cast<base::AtomicWord>(next));
+}
+
+
+FreeSpace* FreeSpace::cast(HeapObject* o) {
+ SLOW_DCHECK(!o->GetHeap()->deserialization_complete() || o->IsFreeSpace());
+ return reinterpret_cast<FreeSpace*>(o);
+}
+
+
uint32_t Name::hash_field() {
return READ_UINT32_FIELD(this, kHashFieldOffset);
}
« no previous file with comments | « src/objects.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698