Comment #4 on issue 1925 by [email protected]: Non-Deterministic behavior on simple benchmark
http://code.google.com/p/v8/issues/detail?id=1925

re 1): v8 explicitly says that the stack overflows, in a very non-silent way, and you can use --stack-size to increase the limit. Using deep recursion in *any* language where the stack is not on the heap relies on luck, because you have to guess how much memory each level uses, something which is a bit tricky.

re 2): If you want a robust algorithm, do not rely on deep recursion. v8/JavaScript is not much different than the rest of the programming languages/implementations. The only exception here are tail-calls in languages which guarantee to have them (JavaScript does not).

re 3): With the current HEAD I get an exception within DFS, so I added a simple depth counter, and the depth was about 8800 when the exception occurred (with a debug version of HEAD). If the algorithm should really have a shallow recursion depth, then there is a bug in your code.

re 5): Different runs may result in different decisions when and how the code is being Crankshafted (i.e. compiled in an optimized way), this is not totally deterministic. This may lead to different frame sizes, which can explain the variations you see. You can use various flags like --trace-opt, --trace-deopt, --print-opt-code, ... to see what's going on.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to