You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
pcs are different according to context VS pcs are common between all contexts
one step = one bytecode = several bytes = several pcs VS one step = one node = one 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:
class Context VS class DASTContext (DASTMethodContext and DASTBlockContext):
° pc: VS no pc but nodes: (nodes to be executed) VS currentNode: -> the equivalence could be done via the OCBcToASTCache I think
° setSender:receiver:method:arguments: VS sender:/ parent: (I'm not sure to grasp what the difference between the 2 is) receiver:methodOrBlock: (DASTClosure that wraps RBMethodNode or RBBlockNode) -> method contains CompiledCodeand we can get an AST node from that. On the contrary, from an AST node, we can get the compiledMethod for RBMethodNode; and compiledBlock for RBBlockNode via its closure (RBBlockNode>>#evaluate)
° setSender:receiver:method:closure:startpc: VS sender:/ parent:receiver:methodOrBlock:
° at:put: / stackp: VS stack:
° 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)
The text was updated successfully, but these errors were encountered:
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 containsCompiledCode
and we can get an AST node from that. On the contrary, from an AST node, we can get thecompiledMethod
for RBMethodNode; andcompiledBlock
for 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)The text was updated successfully, but these errors were encountered: