November 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #10 from David Simcha <dsimcha@yahoo.com> 2009-11-03 08:18:35 PST ---
Just one thing to keep in mind:  Heap scanning is only precise if the mask information is passed to GC.malloc.  This only happens if you use one of my templates or call GC.malloc directly.  I couldn't get it to work with new. (This is where the idea of templating TypeInfo and ClassInfo originated.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 06, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg@gmail.com


--- Comment #11 from nfxjfg@gmail.com 2010-05-06 04:28:59 PDT ---
What is the status of this?

Also, did the newest changes in the runtime (for array appending) trash this
patch?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 08, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #12 from Sean Kelly <sean@invisibleduck.org> 2010-06-08 12:22:20 PDT ---
Yeah, the patch doesn't work any more.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #13 from nfxjfg@gmail.com 2010-06-27 14:07:33 PDT ---
Created an attachment (id=680)
D1 - patch for dmd for creating pointer bitmasks

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #14 from nfxjfg@gmail.com 2010-06-27 14:08:34 PDT ---
Created an attachment (id=681)
D1 - patch for Tango's runtime to enable precise GC scanning

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #15 from nfxjfg@gmail.com 2010-06-27 14:21:58 PDT ---
I posted two patches to enable precise GC heap scanning under D1/Tango. All user programs will make use of the precise scanning; no modifications required.

The dmd patch makes dmd generate an additional field in TypeInfo_Struct and ClassInfo. These fields point to pointer bitmasks for the referenced type. The patch is written in such a way, that it won't break unpatched Tango or Phobos1 runtimes. In particular, this means the patched compiler should be useable with an unpatched Phobos1. (And I don't intend to write a Phobos1 patch. Phobos1 is deaaaad.)

The tango patch makes use of the generated bitmasks. It is based on dsimcha's patch. The mark phase and the bitmask format are completely different, but the brain-drilling changes to add bitmask pointers to the memory blocks are the same. This patch is also designed in such a way, that the patched runtime can be used with an unpatched compiler (in this case, it defaults to conservative scanning). The patch also contains a test program (pm.d) for the compiler generated bitmasks.

The patch should be able to handle all D types. The internal nodes for associative arrays are still scanned conservatively. You would have to dynamically allocate and fill pointer maps for each AA, and I'll just say: sorry, but no.

Note that the bitmask format is different compared to dsimcha's patch. Now it's a bitmap, where each bit represents an aligned, pointer sized chunk of memory.

Also, I don't use templated TypeInfos as dsimcha was suggesting. I'm convinced this approach would slow down compile times and generate masses of bloat. It also would be hard to implement. The question what the TypeInfo of a TypeInfo template instance should be was unsolved, too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #680 is|0                           |1
           obsolete|                            |


--- Comment #16 from nfxjfg@gmail.com 2010-06-27 14:36:30 PDT ---
Created an attachment (id=682)
D1 - patch for dmd for creating pointer bitmasks

(forgot some minor stuff - also, this patch is loosely against dmd 1.062; Walter forgot to tag the 1.062 release in svn)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #17 from nfxjfg@gmail.com 2010-06-27 14:49:50 PDT ---
PS: I forgot to handle TypeInfo_Typedef. Apply this change in object_.d:

@@ -370,6 +370,7 @@ class TypeInfo_Typedef : TypeInfo

     override TypeInfo next() { return base; }
     override uint flags() { return base.flags(); }
+    override PointerMap pointermap() { return base.pointermap(); }
     override void[] init() { return m_init.length ? m_init : base.init(); }

     TypeInfo base;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 02, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #682 is|0                           |1
           obsolete|                            |


--- Comment #18 from nfxjfg@gmail.com 2010-07-02 02:39:32 PDT ---
Created an attachment (id=689)
D1 - patch for dmd for creating pointer bitmasks

Fix writing of ClassInfo for interfaces.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 02, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #19 from nfxjfg@gmail.com 2010-07-02 03:02:40 PDT ---
I also wanted to make scanning of AA nodes precise, but it turned out the compiler never passes the TypeInfo of AA values to the runtime functions. I guess I could hack the compiler to fix this, but I'd rather not.

The idea I wanted to implement was to dynamically allocate & build a PointerMap for the aaA type each time an associative array is instantiated. As an alternative solution, one could expose the aaA type to the compiler (would have to move aaA to object.d), and then let the compiler put a PointerMap into TypeInfo_AssociativeArray. Any opinions what would be preferable?

PS: does anyone care about this stuff, or am I wasting my time?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------