reference counting gc

Hi,

I am doing a research on garbage collectors. I am implementing a reference counting gc for java. I found that Jnode is a great place for my research. I signed up, downloaded and went through the code. I am getting stuck at a specific point and need help.

When a method returns, current frame will be discarded(Frames as explained in vmspec 3.6). I need to capture this and decrement the reference counters for all references in the frame. I am unable to see where this is happenning.

I looked at method visit_ret() and visit_return() org.jnode.vm.x86.compiler.l1a.X86BytecodeVisitor. I expect the code that will release the memory occupied by frame, which inturn reset some of the bits in memory bitmap elsewhere. But what I found is just a JMP statement being emitted. Am I looking at the wrong place?...

Is there any documentation available that puts memory management in perspective?.. Otherwise I can help create one after understanding it.

ABOUT JNODE
jnode is extremely interesting.. I wanted to get involved in some opensource project for a long time but never got into one since they generally tend to be either too complex and entry inertia is very high or they are too simple. But I think having a OS in a package as small as jnode is very inviting. With little bit of help and some time, I should entirely understand the core module.

ABOUT ME
I passed my computer science diploma in Chennai, India by 1993. Designed my own 4-bit microprocessor when I was 16years(my 2nd year at diploma). Took to java in 1999 and never looked back. Have interests in machine learning.

Thanks & Cheers
prem

made progress

Hi,

I spent some more time and think have made progress...

emitTrailer() method in org.jnode.vm.x86.compiler.l1a.X86StackFrame is where all the action is. My understanding is that, the footer emitter simply discards the current EBP and loads the previous EBP from stack.

os.writeLEA(asp, abp, EbpFrameRefOffset); // load the previous stack address saved away in this frame and set SP
os.writePOP(abp); // previous BP was pushed in header.. so pop it out.. at the end of this instruction frame switches
os.writeRET()...

So all references in the frame will still point to valid objects. But when the gc is performed, reachability check will fail and that is when the memory is reclaimed. (And memory bitmap updation)

Someone PLEASE validate my understanding...

Thanks & cheers
prem

Correct

These remarks are correct.

Ewout