Now that the DAST interpreter looks quite stable, it would be good to have an equivalence between this interpreter and the bytecode interpreter.
This would allow to switch interpreters when we want in the debugger. If we debug a program and we want a higher granularity, we would be able to resume our debugging process from the same instruction but with the DAST interpreter. On the contrary, when we want to switch back to the bytecode interpreter to have a lower granularity, we would be able to do so.
I did a quick comparison between the 2 interpreters and it looks possible to me.
Bytecode VS DAST:
Now that the DAST interpreter looks quite stable, it would be good to have an equivalence between this interpreter and the bytecode interpreter.
This would allow to switch interpreters when we want in the debugger. If we debug a program and we want a higher granularity, we would be able to resume our debugging process from the same instruction but with the DAST interpreter. On the contrary, when we want to switch back to the bytecode interpreter to have a lower granularity, we would be able to do so.
I did a quick comparison between the 2 interpreters and it looks possible to me.
Bytecode VS DAST:
pc:
-> the equivalence between the bytecode pcs and the AST nodes could be done via the OcBcToASTCache
value stack: is the same for Bytecode and DAST, except that the exception involved is the first value on the stack for bytecode contexts whereas the exception is not on the stack but is an attribute of DASTContext.
context stack:
°
pc:VS no pc butnodes:(nodes to be executed) VScurrentNode:-> the equivalence could be done via the OCBcToASTCache I think°
setSender:receiver:method:arguments:VSsender:/parent:(I'm not sure to grasp what the difference between the 2 is)receiver:methodOrBlock:(DASTClosure that wraps RBMethodNode or RBBlockNode) -> method containsCompiledCodeand we can get an AST node from that. On the contrary, from an AST node, we can get thecompiledMethodfor RBMethodNode; andcompiledBlockfor RBBlockNode via its closure (RBBlockNode>>#evaluate)°
setSender:receiver:method:closure:startpc:VSsender:/parent:receiver:methodOrBlock:°
at:put:/stackp:VSstack:°
exception= 1st element on the stack VS instance variable (unhandledException:° nothing VS
messageNode-> Thanks to the pc of the sender context and the OCBcToASTCache, we can get the message node° Nothing VS
isDead:(false by default)