[SVN ci] a bigger PackFile patch

0 views
Skip to first unread message

Leopold Toetsch

unread,
Apr 27, 2005, 3:25:36 AM4/27/05
to Perl 6 Internals
A long overdue change is now committed dicussed around more then a year ago.

The short story:

* interpreter->code is now a PackFile_ByteCode pointer
* the "shortcut" pointers to prederef or jit_info are gone
* switching a bytecode segment for a function call or return is now
basically just one C instruction:

interpreter->code = prev_segment; // return only

The longer story:

interpreter->code used to be a PackFile pointer. The PackFile had
shortcuts to byte_code or const_table. But code segments are created or
loaded in terms of PackFile_ByteCode, which has it's own pointers to
code start, constant table and what not.

We had a mixture of both bytecode addressing schemes and additional
shortcuts to get rid of some indirections. This caused a rather
complicated sequence to switch to another code segment. See
Parrot_switch_to_cs() (or the diff thereof).

Unfortunately but not surprisingly interpreter->code is used all over
the interpreter and in platform code like JIT or EXEC core. This makes
the patch rather big and worse: I couldn't test all the changes.

I did replace all the obvious pieces in JIT and EXEC code, but I might
have missed some so that it won't even compile. Needed changes are
basically:

interpreter->code->byte_code => interpreter->code->base.data
interpreter->jit_info => interpreter->code->jit_info

But some of the former might be hidden in assembly generating code or
even macros.

I've tested it on i386/linux and ppc/OS X. If some other platforms stop
compiling or JIT doesn't work anymore please have a look at changes for
i386 or ppc - or just mail a bug report.

Sorry for the inconvenience,
leo

Reply all
Reply to author
Forward
0 new messages