Re: [Sablevm-developer] adventures in not understanding the java stack
Brought to you by:
egagnon
From: Chris P. <chr...@ma...> - 2004-01-19 23:00:05
|
Hi Etienne, Thanks kindly for your response. I've compressed the unanswered bits for you at the end, and tried to cut out as much as possible. >> 3) Am I correct to assume that the "speculative" stack obtained after >> jumping over a method call will not differ from the actual stack when >> that point is reached non-speculatively? > > > Which stack? The operand stack, or the Java stack? > The entire Java stack, which includes the operand stack. I am getting errors where portions of the Java stack differ if I compare a saved Java stack (that was generated by skipping over a void method and popping parameters) with the actual stack. My plan is to keep track of a) _svmf_interpreter() depth b) height of the current frame on the Java stack c) whether an exception is thrown in the skipped method d) whether GC is called in the skipped method to determine when I have actually returned (and can thus join the speculative thread). Ignore the bit about safety of speculative instructions in the original question -- it doesn't apply to the problem of determining join points. > Do not forget about _svmf_ensure_stack_capacity() which can actually > change the "absolute" location of the Java stack (and thus the absolute > location of the operand stack). Right, I'm sure that this is not the problem, the comparison is value-by-value between saved and actual stacks. ========== Now, summarized: 1a) If I mark relevant threads for GC being called at line 418 in thread.c, will this catch them all? 1b) If I put the code to abort speculative children because the non-speculative parent threw an exception, natively or not, at line 364 in interpreter.c, will this catch everything? 6) Can you think of anything to do with class initialization, object finalization, or native method calls that would cause problems with what I'm describing? As in, problems that I won't detect safely? I'm asking about non-speculative parent threads, with or without children, executing these sections, possibly forking children. Speculative instructions are themselves safe with respect to global memory, exception handling, GC, native methods, and code preparation. Thank-you very very much. I apologize if any of this seems exceedingly obvious to you, but I made some incorrect assumptions in the past and I want to prevent that this time around (I've disabled almost everything and am turning features on one at a time). Cheers, Chris P.S. In the future, I would like to help design and possibly implement some kind of high-level CFG for the VM, which is (partially) built from directives in the source. Discussions like this and the GC one make me think about stuff like that. |