Did this get merged incorrectly at some point? Not sure it really matters, but it makes my debugger happier.
authorbenjamin@smedbergs.us
Thu, 20 Dec 2007 10:55:15 -0500
changeset 26 9b49c7cbe92c
parent 22 0ca31a228535
child 27 c1c4660628af
push id1
push userbsmedberg@mozilla.com
push dateMon, 21 Apr 2008 01:54:18 +0000
Did this get merged incorrectly at some point? Not sure it really matters, but it makes my debugger happier.
assert-non-interiorness
finalizable-merge-fixup
series
deleted file mode 100644
--- a/assert-non-interiorness
+++ /dev/null
@@ -1,79 +0,0 @@
-diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
---- a/MMgc/GC.cpp
-+++ b/MMgc/GC.cpp
-@@ -2567,7 +2567,7 @@ bail:
- 				}
- 				else
- 				{
--					item = FindBeginning((void *) val);
-+					item = GetRealPointer(FindBeginning((void *) val));
- 				}
- #else
- 				// back up to real beginning
-@@ -3184,5 +3184,16 @@ bail:
- 	}
- #endif
- 
--
-+#ifdef _DEBUG
-+	GCWorkItem::GCWorkItem(const void *p, uint32 s, bool isGCItem)
-+		: ptr(p)
-+		, _size(s | uint32(isGCItem))
-+	{
-+		// If a WI is a GC item, it should always point to the
-+		// "real" item, not an interior pointer!
-+		if (IsGCItem()) {
-+			GCAssert(GC::GetGC(p)->FindBeginning(p) == p);
-+		}
-+	}
-+#endif
- }
-diff --git a/MMgc/GC.h b/MMgc/GC.h
---- a/MMgc/GC.h
-+++ b/MMgc/GC.h
-@@ -978,10 +978,17 @@ namespace MMgc
- 		/** @access Requires(request) */
- 		void *FindBeginning(const void *gcItem)
- 		{
-+			GCAcquireSpinlock lock(pageMapLock);
-+			return FindBeginningAlreadyLocked(gcItem);
-+		}
-+
-+		/** @access Requires(pageMapLock) */
-+		void *FindBeginningAlreadyLocked(const void *gcItem)
-+		{
- 			GCAssert(gcItem != NULL);
--			GCAssert(GetPageMapValue((uintptr)gcItem) != 0);
-+			GCAssert(GetPageMapValueAlreadyLocked((uintptr)gcItem) != 0);
- 			void *realItem = NULL;
--			int bits = GetPageMapValue((uintptr)gcItem);
-+			int bits = GetPageMapValueAlreadyLocked((uintptr)gcItem);
- 			switch(bits)
- 			{
- 			case kGCAllocPage:
-@@ -994,7 +1001,7 @@ namespace MMgc
- 				while(bits == kGCLargeAllocPageRest)
- 				{
- 					gcItem = (void*) ((uintptr)gcItem - GCHeap::kBlockSize);
--					bits = GetPageMapValue((uintptr)gcItem);
-+					bits = GetPageMapValueAlreadyLocked((uintptr)gcItem);
- 				}
- 				realItem = GCLargeAlloc::FindBeginning(gcItem);
- 				break;
-diff --git a/MMgc/GCTypes.h b/MMgc/GCTypes.h
---- a/MMgc/GCTypes.h
-+++ b/MMgc/GCTypes.h
-@@ -119,7 +119,12 @@ namespace MMgc
- 	{
- 	public:
- 		GCWorkItem() : ptr(0), _size(0) {}
--		GCWorkItem(const void *p, uint32 s, bool isGCItem) : ptr(p), _size(s | uint32(isGCItem)) {}
-+
-+#ifdef _DEBUG
-+		GCWorkItem(const void *p, uint32 s, bool isGCItem);
-+#else
-+		GCWorkItem(const void *p, uint32 s, bool isGCItem) : ptr(p), _size(s | uint32(isGCItem)) { }
-+#endif
- 		uint32 GetSize() const { return _size & ~1; }
- 		int IsGCItem() const { return _size & 1; }
- 		const void *ptr;
new file mode 100644
--- /dev/null
+++ b/finalizable-merge-fixup
@@ -0,0 +1,30 @@
+diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
+--- a/MMgc/GC.cpp
++++ b/MMgc/GC.cpp
+@@ -2512,7 +2512,7 @@ bail:
+ 					{
+ 						// try custom marking
+ 						if ((bits2 & (GCAlloc::kFinalize<<shift)) != 0
+-							&& ((GCFinalizedObject *) GetUserPointer(item))->CustomMark())
++							&& ((GCFinalizable *) GetUserPointer(item))->CustomMark())
+ 						{
+ 							GCAssert((*pbits & (GCAlloc::kMark<<shift)) != 0);
+ 							continue;
+@@ -2590,7 +2590,7 @@ bail:
+ 					{
+ 						// try custom marking
+ 						if ((b->flags & GCLargeAlloc::kFinalizeFlag) != 0
+-							&& ((GCFinalizedObject *) GetUserPointer(item))->CustomMark())
++							&& ((GCFinalizable *) GetUserPointer(item))->CustomMark())
+ 						{
+ 							GCAssert((b->flags & GCLargeAlloc::kMarkFlag) != 0);
+ 							continue;
+@@ -2776,7 +2776,7 @@ bail:
+ 	// TODO: fix headers so this can be declared there and inlined
+ 	void GC::WriteBarrierWrite(const void *address, const void *value)
+ 	{
+-		GCAssert(!IsRCObject(value));
++		// GCAssert(!IsRCObject(value));
+ 		*(uintptr*)address = (uintptr) value;
+ 	}
+ 
--- a/series
+++ b/series
@@ -5,10 +5,10 @@ workitems-notgc-noassert
 gc-graph #+graphviz
 alloc-backtrace #+graphviz
 configure-with-threadsafe-mmgc #+threadsafe
 mmgc-threadsafe #+threadsafe
 mmgc-threadsafe-gctests #+threadsafe
 mmgc-graphviz #+jorendorff-graphviz
 mmgc-bit-checks #+threadsafe
 enable-traces
-assert-non-interiorness
 debug-print-finalizers
+finalizable-merge-fixup