From: Samuele P. <ped...@bl...> - 2002-10-23 13:51:34
|
From: "Finn Bock" <bc...@wo...> > An different idea that I haven't explored in depth could be to avoid > using jsr in the problematic cases and instead regenerate a copy of all > the finally code whereever we generate a jsr at the moment. Since yield > statements in finally also would be duplicated, restarting after a yield > in a finally can be handled by exitsing tableswitch at the beginning of > the generator. > > The result would be codebloat for really complex generators, but my gut > feeling is that we can ignore that. > > Can you see any reason why this scheme would fail? no, just the codebloat and the slower compiling (one have to traverese the finally block suite multiple times), this and using an array f_lasti as a stack are our two possibilities. OTOH - if my messages on a array f_lasti were understandable - with that approach both yields and the code corresponding to JSRs can be compiled in a very uniform way, so the compiler code required is no more complicated (probably less) than your disabled code. From the VM spec reading and my hand-modified example it seems that the verifier should be OK with the produced code. I don't know if you want to try implement that or switch directly to full-expansion approach. It's your choice. regards. |