more on continuation passsing
This commit is contained in:
parent
60df7ea5e2
commit
039256de6a
|
@ -213,7 +213,6 @@ proc applyMessage*(computation: BaseComputation, opCode: static[Op]) =
|
|||
postExecuteVM(computation)
|
||||
|
||||
executeOpcodes(computation)
|
||||
computation.nextProc()
|
||||
|
||||
proc addChildComputation*(computation: BaseComputation, child: BaseComputation) =
|
||||
if child.isError:
|
||||
|
|
|
@ -593,6 +593,7 @@ op create, inline = false, value, startPosition, size:
|
|||
var childComp = setupCreate(computation, memPos, len, value)
|
||||
if childComp.isNil: return
|
||||
|
||||
computation.child = childComp
|
||||
continuation(childComp):
|
||||
computation.addChildComputation(childComp)
|
||||
|
||||
|
@ -763,6 +764,7 @@ template genCall(callName: untyped, opCode: Op): untyped =
|
|||
## STATICCALL, 0xfa, Static message-call into an account.
|
||||
var childComp = `callName Setup`(computation, callName.astToStr)
|
||||
|
||||
computation.child = childComp
|
||||
continuation(childComp):
|
||||
addChildComputation(computation, childComp)
|
||||
|
||||
|
|
|
@ -234,6 +234,7 @@ proc opTableToCaseStmt(opTable: array[Op, NimNode], computation: NimNode): NimNo
|
|||
try:
|
||||
let fork = `computation`.getFork
|
||||
if `computation`.execPrecompiles(fork):
|
||||
computation.nextProc()
|
||||
return
|
||||
|
||||
if `computation`.tracingEnabled:
|
||||
|
@ -248,6 +249,7 @@ proc opTableToCaseStmt(opTable: array[Op, NimNode], computation: NimNode): NimNo
|
|||
let msg = getCurrentExceptionMsg()
|
||||
let errorMsg = "Opcode Dispatch Error msg=" & msg & ", depth=" & $computation.msg.depth
|
||||
`computation`.setError(errorMsg, true)
|
||||
computation.nextProc()
|
||||
|
||||
macro genFrontierDispatch(computation: BaseComputation): untyped =
|
||||
result = opTableToCaseStmt(FrontierOpDispatch, computation)
|
||||
|
|
|
@ -71,6 +71,7 @@ type
|
|||
nextProc*: proc()
|
||||
memOutLen*: int
|
||||
memOutPos*: int
|
||||
child*: BaseComputation
|
||||
|
||||
Error* = ref object
|
||||
info*: string
|
||||
|
|
Loading…
Reference in New Issue