poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pkl: Return exception value instead of exit_status


From: Jose E. Marchesi
Subject: Re: [PATCH] pkl: Return exception value instead of exit_status
Date: Wed, 12 Jan 2022 22:52:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> +# Instruction: popexite
> +#
> +# Pops the exception on the stack into VM internal state and put the
> +# exit_status on the stack.
> +#
> +# Stack: ( EXCEPTION  -- INT )
> +# Exceptions Stack: ( -- )
> +
> +instruction popexite ()
> +  code
> +    pvm_val exc = JITTER_TOP_STACK ();
> +
> +    JITTER_DROP_STACK ();
> +    PVM_STATE_BACKING_FIELD (exception_value) = exc;
> +    JITTER_PUSH_STACK (pvm_ref_struct_cstr (exc, "exit_status"));
> +  end
> +end

This instruction is way too complex and is unnecessarily coupled to
details it really should not get concerned with, like the contents of
exception structs.  Copying an exception must not depend on any
particular contents of that exception.  What if we rename `exit_status'
or get rid of it or change its semantics?

IMO this instruction should just set the backing state field, and do the
sref "exit_status" in the standard epilogue even if that requires a swap
or two.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]