On 6/23/06, Pavel Afremov <[EMAIL PROTECTED]> wrote:
..
Pavel, I think SOE in native code should be avoided. AFAIK internal JIT algorithms use recursion a lot and for a huge control flow graph stack size could be not enough to compile a method. The one option I see is every native component is to be responsible to report an error before SOE happened and not to crash the program. So, if DRLVM would have a public method like 'get_available_stack_size' a component could check it and call to VM helper with failure notification or run some recovery code in case the stack size is too small to complete the compilation. As an example I can propose introducing the recovery mode for JIT compilers: to add the Jitrino.JET (lightweight compiler) as the last JIT in execution manager (EM) configuration. If Jitrino.OPT or any other optimizing JIT fails to compile a method due to the huge method size, it just returns failure to the Execution Manager (EM) and EM can silently ask the next JIT in the configuration to compile the method. The last attempt to compile will be on the Jitrino.JET which requires significantly less resources then other JITs and will compile a method without SOE. Does anyone have other ideas how to handle SOE in native code? -- Mikhail Fursov
