[COMMIT] IMCC changes

2 views
Skip to first unread message

Melvin Smith

unread,
Nov 15, 2003, 11:51:19 PM11/15/03
to perl6-i...@perl.org
More IMCC rearchitecture and directive changes.

.pcc_sub is now deprecated (but supported for a while).
(All other .pcc_* directives are still enabled).
Use .sub for all subroutines from now on. Even though .sub is now a PCC sub,
this should not break existing code that uses the old stack passing
method (I'm not sure which compilers do this other than Cola).

The plan is to remove all .pcc specific directives and make them
generic. We are adding support for multiple calling conventions and
prototyping/non-prototyping to IMCC in an attempt to hide the implementation
behind generic IMCC instructions.

If done correctly, this will allow us to change internal guts without
breaking high level
compilers. Currently we expose to much of the specifics in IMCC.

Summary:

* .sub directive now deprecates .pcc_sub directive.
.sub now uses PCC convention by default.
* All other .pcc directives are still used but will
be eventually deprecated.
* Modularize calling conventions and add generic API.
sub.c is the generic API and wraps pcc.c and fastcall.c
* Add stubs for a 2nd FASTCALL convention which can be enabled by
compiler pragma. Currently fastcall does not work.
* Add .pragma directive to the lexer.
* Add check for 0 arguments in PCC subs to skip code generate for
proto/nonproto
argument checking if there are no args. (Leo check this if it is the right
thing to do?)
* Various comments and optional tracing added to existing code.

Cheers,

-Melvin


Leopold Toetsch

unread,
Nov 17, 2003, 5:18:57 AM11/17/03
to Melvin Smith, perl6-i...@perl.org
Melvin Smith <mrjol...@mindspring.com> wrote:
> * Add check for 0 arguments in PCC subs to skip code generate for
> proto/nonproto
> argument checking if there are no args. (Leo check this if it is the right
> thing to do?)

Looks good, but might not be compliant with Dan's runtime check
philosophy. Or, its ok for the "we don't check" case and not for the
paranoid one.

> Cheers,

> -Melvin

leo

Dan Sugalski

unread,
Nov 17, 2003, 9:03:59 AM11/17/03
to Leopold Toetsch, Melvin Smith, perl6-i...@perl.org

Nope, it's fine -- while we need to provide the information to make the
checks, nobody's obligated to make them. (Though I would like there to be
a means for subs declared in IMCC to validate their parameters against
what they expect)

Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Reply all
Reply to author
Forward
0 new messages