Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
extend.c:Parrot_call
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leopold Toetsch  
View profile  
 More options Oct 27 2004, 6:43 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 27 Oct 2004 12:43:51 +0200
Local: Wed, Oct 27 2004 6:43 am
Subject: extend.c:Parrot_call
Parrot_call() runs a Parrot subroutine, but it takes PMC arguments only
and provides no return value.

If no one hollers, I'll replace this function with a more flexible set
of functions that are wrappers to the *runops* functions in src/inter_run.c:

   void *        Parrot_call_sub_(interp, sub, signature, ...) [1]
   Parrot_Int    Parrot_call_sub_ret_int
   Parrot_Float  Parrot_call_sub_ret_float

   void *        Parrot_call_meth(interp, sub, object, meth, sig, ...)
   ...

The signature of the current Parrot_call is "vPPP..."

[1] return values covered: void, Parrot_STRING, Parrot_PMC

leo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Horwitz  
View profile  
 More options Oct 27 2004, 10:48 am
Newsgroups: perl.perl6.internals
From: j...@sixgeeks.org (Jeff Horwitz)
Date: Wed, 27 Oct 2004 10:48:15 -0400 (EDT)
Local: Wed, Oct 27 2004 10:48 am
Subject: Re: extend.c:Parrot_call
this would be great -- i'm currently pulling the return values of my
called subs directly out of I5, and it would be nice to have that bit
taken care of for me, especially if calling conventions change somewhere
down the line (but i certainly hope they don't).  :)

-jeff


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Oct 27 2004, 12:21 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 27 Oct 2004 18:21:53 +0200
Local: Wed, Oct 27 2004 12:21 pm
Subject: Re: extend.c:Parrot_call

Jeff Horwitz <j...@sixgeeks.org> wrote:

[ Please don't top post ]

> this would be great -- i'm currently pulling the return values of my
> called subs directly out of I5, and it would be nice to have that bit
> taken care of for me, especially if calling conventions change somewhere
> down the line (but i certainly hope they don't).  :)

Calling conventions don't change. But trying the get I5 or such from a
void function will not work anymore, because arguments and return values
are copied now.

E.g. when you have a sub that ends with:

  set P5, 100 # ret value
  set I0, 0   # non-prototyped
  set I3, 0   # no return value
  invoke P1   # return

then P5 will not be passed to the caller.

> -jeff

leo

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Horwitz  
View profile  
 More options Oct 27 2004, 3:11 pm
Newsgroups: perl.perl6.internals
From: j...@sixgeeks.org (Jeff Horwitz)
Date: Wed, 27 Oct 2004 15:11:11 -0400 (EDT)
Local: Wed, Oct 27 2004 3:11 pm
Subject: Re: extend.c:Parrot_call

On Wed, 27 Oct 2004, Leopold Toetsch wrote:
> E.g. when you have a sub that ends with:

>   set P5, 100 # ret value
>   set I0, 0   # non-prototyped
>   set I3, 0   # no return value
>   invoke P1   # return

> then P5 will not be passed to the caller.

right.  but i'm explicitly using .pcc_begin_return/.return/.pcc_end_return
to return values from subs run with  Parrot_call.  my C code then
retrieves the return value from I5, which is where the return integer
value would be copied.  your changes would save me from having to fetch
directly from I5, but until those changes are made, is this the "right
way" to be doing this?

-jeff


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Oct 27 2004, 3:57 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 27 Oct 2004 21:57:06 +0200
Local: Wed, Oct 27 2004 3:57 pm
Subject: Re: extend.c:Parrot_call

Yep that's ok. If the sub indicates an return value it is and will be
availabe, in your case as REG_INT(5) in C.

> -jeff

leo

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Oct 28 2004, 8:20 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Thu, 28 Oct 2004 14:20:12 +0200
Local: Thurs, Oct 28 2004 8:20 am
Subject: Re: extend.c:Parrot_call

Leopold Toetsch wrote:
> Parrot_call() runs a Parrot subroutine, but it takes PMC arguments only
> and provides no return value.

> If no one hollers, I'll replace this function with a more flexible set
> of functions that are wrappers to the *runops* functions in
> src/inter_run.c:

>   void *        Parrot_call_sub_(interp, sub, signature, ...) [1]
>   Parrot_Int    Parrot_call_sub_ret_int
>   Parrot_Float  Parrot_call_sub_ret_float

>   void *        Parrot_call_meth(interp, sub, object, meth, sig, ...)

Done that now. The latter is:

    void *        Parrot_call_method(interp, sub, object, meth, sig, ...)

and other 2 accordingly.

leo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google