Fix gcstack and workitem goofiness
authorbenjamin@smedbergs.us
Wed, 21 Nov 2007 21:46:01 -0500
changeset 5 399ff94b3d77e32c0b43ba646ea5ebc54f86589d
parent 4 2696e7fd59fb342037a49d4823cb86606b2d3fc7
child 6 b0246d10657e45b3622cad612f53a2b6d5efce1d
push id1
push userbsmedberg@mozilla.com
push dateMon, 21 Apr 2008 01:54:18 +0000
Fix gcstack and workitem goofiness
const-workitem.patch
gcstack-access
series
workitems-notgc-noassert
--- a/const-workitem.patch
+++ b/const-workitem.patch
@@ -1,45 +1,12 @@
-diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
---- a/MMgc/GC.cpp
-+++ b/MMgc/GC.cpp
-@@ -2730,7 +2730,7 @@ bail:
- 		}
- 	}
- 
--	void GC::PushWorkItem(GCStack<GCWorkItem> &stack, GCWorkItem item)
-+	void GC::PushWorkItem(GCStack<GCWorkItem> &stack, const GCWorkItem item)
- 	{
- 		if(item.ptr) {
- 			stack.Push(item);
 diff --git a/MMgc/GC.h b/MMgc/GC.h
 --- a/MMgc/GC.h
 +++ b/MMgc/GC.h
-@@ -289,7 +289,7 @@ namespace MMgc
- 		 * only from lastmark().
- 		 */
- 		void PushWorkItem(GCStack<GCWorkItem>& work,
--		                  GCWorkItem item);
-+		                  const GCWorkItem item);
- 
- 		/**
- 		 * Mark all gray nodes, recursively, until none are
-@@ -1093,7 +1093,7 @@ private:
- 
- 		void CheckThread();
+@@ -901,7 +901,7 @@ namespace MMgc
  
--		void PushWorkItem(GCStack<GCWorkItem> &stack, GCWorkItem item);
-+		void PushWorkItem(GCStack<GCWorkItem> &stack, const GCWorkItem item);
+ 		uintptr	GetStackTop() const;		
+ 		
+-		void PushWorkItem(GCWorkItem &item) { PushWorkItem(m_incrementalWork, item); }
++		void PushWorkItem(const GCWorkItem &item) { PushWorkItem(m_incrementalWork, item); }
  
- #ifdef DEBUGGER
- 		// sent for Collect (fullgc)
-diff --git a/MMgc/GCStack.h b/MMgc/GCStack.h
---- a/MMgc/GCStack.h
-+++ b/MMgc/GCStack.h
-@@ -64,7 +64,7 @@ namespace MMgc
- 			m_iCount = m_iAllocSize = 0;
- 		}
+ 	private:
  
--		void Push(T item)
-+		void Push(const T item)
- 		{
- 			if ( ( m_iCount + 1 ) > m_iAllocSize ) 
- 			{
--- a/gcstack-access
+++ b/gcstack-access
@@ -40,18 +40,27 @@ diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
 +
 +		m_currentQueue = NULL;
  
  #ifdef DEBUGGER
  		if(GC::gcstats) {
 diff --git a/MMgc/GC.h b/MMgc/GC.h
 --- a/MMgc/GC.h
 +++ b/MMgc/GC.h
-@@ -549,6 +549,9 @@ namespace MMgc
+@@ -548,6 +548,9 @@ namespace MMgc
  
  		bool incremental;
  
 +		// This member is only available during tracing
 +		GCStack<GCWorkItem> *m_currentQueue;
 +
  		// -- Interface
  		GC(GCHeap *heap);
  		virtual ~GC();
+@@ -901,7 +904,7 @@ namespace MMgc
+ 
+ 		uintptr	GetStackTop() const;		
+ 		
+-		void PushWorkItem(const GCWorkItem &item) { PushWorkItem(m_incrementalWork, item); }
++		void PushWorkItem(const GCWorkItem &item) { PushWorkItem(*m_currentQueue, item); }
+ 
+ 	private:
+ 
--- a/series
+++ b/series
@@ -1,7 +1,8 @@
 mmgc-threasafe-build.patch
 finalized-base.patch
 explicit-namespaces.patch
 x86-64
 const-workitem.patch
 gcstack-access
+workitems-notgc-noassert
 alloc-backtrace
new file mode 100644
--- /dev/null
+++ b/workitems-notgc-noassert
@@ -0,0 +1,13 @@
+diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
+--- a/MMgc/GC.cpp
++++ b/MMgc/GC.cpp
+@@ -2191,7 +2191,9 @@ bail:
+ 		}
+ 		else
+ 		{
++#if 0 // We want to pass GCWorkItems which are interior pointers to a GC object
+ 			GCAssert(!IsPointerToGCPage(wi.ptr));
++#endif
+ 		}
+ 
+ 		uintptr _memStart = memStart;