[DGD] some questions about interpret.cpp
Carter Cheng
cartercheng at gmail.com
Mon Dec 28 16:37:17 CET 2015
Hi,
I had some questions about the dgd 1.5.2 implementation of interpret.cpp
where I was too sure based on the code the intention of the implementation-
1) in all the kfun style function calls the program counter in the frame
f->pc = pc; and following the call pc = f->pc. What is the purpose of
this? I did a casual grep of the kfun directory and no kfuns seem to update
this variable in the kfun code.
2) both rlimits() and catch() recursively call interpretv1. This would
suggest in someways that for certain opcodes the code behaves like a
call_other function call. I.e. are returns illegal in catch and rlimit
blocks? Since the return in the catch/rlimit block would "return" to the
instruction following the rlimit/catch as opposed to the caller of the
function.
3) catch also uses the C++ try catch but the error code seems to still use
setjmp longjmp which only minimally rewinds the stack and thus would break
C++ classes with custom destructors. Is the intent to use exceptions here
to get better behavior?
Thanks in advance,
Silenus.
More information about the DGD
mailing list