[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] [PATCH] Process>>#isSuspendedInCCall
From: |
Holger Hans Peter Freyther |
Subject: |
Re: [Help-smalltalk] [PATCH] Process>>#isSuspendedInCCall |
Date: |
Fri, 2 May 2014 07:04:05 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Apr 15, 2014 at 05:47:49PM +0200, Gwenaƫl Casaccio wrote:
Hi,
sorry for the delay in reviewing.
> Here is the patch: I've add one slot to ContextPart (ctxtFlags) and
> thisContext is tagged while
> being reentrant. And few primitives (compile, ccall) are extended to tag the
> context.
The C-Call/primitive will only be invoked from a method context
in normal operation. What about just adding the ctxFlags to the
methodContext then?
> asyncCall [
> + <category: 'calling'>
> +
> "Perform the call-out for the function represented by the receiver.
> The arguments (and the receiver if one of the arguments has type
> #self or #selfSmalltalk) are taken from the parent context.
> @@ -140,7 +142,7 @@ to perform the actual call-out to C routines.'>
> ^self isValid
> ifFalse:
> [SystemExceptions.CInterfaceError signal: 'Invalid C call-out '
> , self name]
> - ifTrue: [self asyncCallNoRetryFrom: thisContext parentContext]
> + ifTrue: [self asyncCallNoRetryFrom: thisContext parentContext ]
> ]
unrelated change just creating distraction. :)
> @@ -522,6 +525,7 @@ _gst_interpret (OOP processOOP)
>
> monitor_byte_codes:
> SET_EXCEPT_FLAG (false);
> + finish_debugging_step = false;
>
> /* First, deal with any async signals. */
> if (async_queue_enabled)
> @@ -540,6 +544,7 @@ monitor_byte_codes:
> {
> _gst_async_signal (single_step_semaphore);
> single_step_semaphore = NULL;
> + finish_debugging_step = true;
> }
are you mixing things here? The 'tagging' of a process being
debugged might be good in a separate patch? We will also need
to add this to the JIT.
> +/* Anwser whether execution is going to be reentrant. */
> +#define MCF_IS_REENTRANT 2
What does this mean?
> + this_context = (gst_method_context) OOP_TO_OBJ (_gst_this_context_oop);
> + this_context->ctxtFlags |= MCF_IS_REENTRANT;
> +
> oop2 = POP_OOP ();
> oop1 = POP_OOP ();
> if (IS_CLASS (oop2, _gst_string_class))
> @@ -5231,6 +5235,8 @@ primitive VMpr_Behavior_primCompile [succeed]
>
> if (interrupted)
> stop_execution ();
> + else
> + this_context->ctxtFlags &= ~MCF_IS_REENTRANT;
this and most of the errors look unbalanced. So if the function
is re-entered the first one to leave will unset this flag? Is
this the intention? What does it buy us?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-smalltalk] [PATCH] Process>>#isSuspendedInCCall,
Holger Hans Peter Freyther <=