static private ApplyReturnAddress ( |
||
returnAddress | ||
Результат | void |
static void FinishPrimitiveCall( Vm vm, int numArgs, bool saveReturnAddress, Value result) { vm.stack.PopMany (numArgs); if (saveReturnAddress) { vm.programCounter ++; } else { var maybeRa = vm.stack.PopTop (); if (maybeRa.Kind == Value.Kinds.ReturnAddress) { vm.ApplyReturnAddress (maybeRa.ReturnAddressValue); } else { Utils.Panic (); } } vm.stack.Push (result); vm.IncrementCells (1); }
static void HandleReturn(Vm vm) { // SLOW: maybe there's a faster way to manipulate the stack here? var result = vm.stack.PopTop (); var maybeRa = vm.stack.PopTop (); if (maybeRa.Kind == Value.Kinds.ReturnAddress) { vm.ApplyReturnAddress (maybeRa.ReturnAddressValue); } else { Utils.Panic (); } vm.stack.Push (result); }