develooper Front page | perl.perl6.internals | Postings from July 2002

Re: [COMMIT] Parrot_Context

Thread Previous | Thread Next
From:
Jerome Vouillon
Date:
July 4, 2002 15:44
Subject:
Re: [COMMIT] Parrot_Context
Message ID:
20020704224348.GA27808@strontium.pps.jussieu.fr
On Thu, Jul 04, 2002 at 05:08:25PM -0400, Melvin Smith wrote:
> Since context switches are not the norm (and register/stack accesses _are_)
> we decided to use a memcpy to switch them rather than using a
> pointer to a context.

So, more than 2 kilobyte will be copied for each co-routine call?
(Save the caller context, restore the co-routine context, execute the
 co-routine, save the co-routine context, restore the caller context.)

This looks rather expansive to me!
(Think about an iterator over a list, for instance.)

> Using a pointer would slow down the common cases
> of access due to an extra dereference.
> 
>    interpreter->ctx->int_reg.registers

Why not access them by:

     ctx->int_reg.registers

and access the interpreter by:

     ctx->interpreter

Then, there is no extra dereference for the common cases.

> and would also kill the current JIT design.

Because it assumes there is only one interpreter ?

It seems to me it would be just as efficient to keep the interpreter
pointer in a register, instead of hardcoding the address of the
interpreter.

-- Jerome

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About