Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: n.oje.bar@gmail.com Newsgroups: comp.compilers Subject: how to find gc roots in stack machine? Date: Mon, 1 Jul 2013 05:19:01 -0700 (PDT) Organization: Compilers Central Lines: 20 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-07-002@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: leila.iecc.com 1372691736 42453 64.57.183.58 (1 Jul 2013 15:15:36 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 1 Jul 2013 15:15:36 +0000 (UTC) Keywords: GC, question Posted-Date: 01 Jul 2013 11:15:36 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:933 Hi all, I am writing a simple compiler for a simple stack machine. Now I want to add a garbage collector. To do this I need a way to be able to find all roots in the stack at any given time (or at least at some special points in time). I can see that I would probably be able to generate some kind of "stack map" that would tell me which variables in the stack are roots. But I don't know how to deal with the other intermediate values that are generated on the stack during execution. I would appreciate any pointers/literature on how to: 1. Find all the roots in the stack, including those that are pushed to the stack as intermediate results during execution. 2. How to generate stack maps, common formats, etc... 3. How to decide and where to check if gc is necessary. Thank you very much for any help! Best wishes, Nicolas