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

[COMMIT] Parrot_Context

Thread Next
Melvin Smith
July 4, 2002 14:11
[COMMIT] Parrot_Context
Message ID:
I added the Parrot_Context struct and inlined all regs and stacks
into it. The save/restore context routines simply copy it in 1 swoop.

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. Using a pointer would slow down the common cases
of access due to an extra dereference.


and would also kill the current JIT design.

So we end up:


changes to:


Also, keep in mind, save_context currently sets COW on stacks, and
will eventually do the same for register frames.

This is only important for co-routines and continuations. Common subs
shouldn't need to switch in their own context.

[large patch omitted, see]


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About