Re: [Sablevm-developer] adventures in not understanding the java stack
Brought to you by:
egagnon
From: Etienne G. <gag...@uq...> - 2004-01-19 21:49:53
|
Chris, some answers below. Chris Pickett wrote: > 2) Do all calls to _svmf_interpreter() end in INTERNAL_CALL_END (it > appears this way from invoke_interface.c)? No. They can also end: - at line 636 of interpreter.c: initializing the interpreter. - at line 400 of interpreter.c: exception path. > 3) If I keep track of _svmf_interpreter() call depth and Java call > depth, abort speculative children on GC or exceptions in the parent > non-speculative thread, and abort speculative children on global > memory-writing (Java heap or not) instructions in the speculative child, > 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? 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). > 4) Can I furthermore assert that the next instruction to be executed > after a method call has completed, in the absence of an exception being > thrown in the call, is the next instruction in the code array? Yes. > 5) Do calls to _svmf_interpreter() enter and exit cleanly? In other > words, am I right to assume that there is nothing like a Java exception > that can occur to screw up control flow, and that when the height of the > call stack returns you are back where you started? _svmf_interpreter sets a longjump handler, so it never exits other than through "return" (at one of 3 identified locations: 2 above + INTERNAL_CALL_END) as far as I remember. -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |