develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35055 - trunk/compilers/pirc/src

From:
kjs
Date:
January 6, 2009 09:41
Subject:
[svn:parrot] r35055 - trunk/compilers/pirc/src
Message ID:
20090106174055.3BFCBCB9F9@x12.develooper.com
Author: kjs
Date: Tue Jan  6 09:40:54 2009
New Revision: 35055

Modified:
   trunk/compilers/pirc/src/pircompunit.c
   trunk/compilers/pirc/src/pirpcc.c

Log:
[pirc] work on methodtailcall. probably fixed, need more tests.

Modified: trunk/compilers/pirc/src/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.c	(original)
+++ trunk/compilers/pirc/src/pircompunit.c	Tue Jan  6 09:40:54 2009
@@ -785,6 +785,8 @@
 =cut
 
 */
+PARROT_IGNORABLE_RESULT
+PARROT_CANNOT_RETURN_NULL
 argument *
 unshift_arg(invocation * const inv, argument * const newarg) {
     ++inv->num_arguments;

Modified: trunk/compilers/pirc/src/pirpcc.c
==============================================================================
--- trunk/compilers/pirc/src/pirpcc.c	(original)
+++ trunk/compilers/pirc/src/pirpcc.c	Tue Jan  6 09:40:54 2009
@@ -649,16 +649,20 @@
 */
 static void
 convert_pcc_methodtailcall(lexer_state * const lexer, invocation * const inv) {
+    unshift_arg(inv, new_argument(lexer, expr_from_target(lexer, inv->sub)));
     new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc", inv->num_arguments);
+
     arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
 
     /* check out the type of the method expression; it may be a PMC or a STRING. */
     switch (inv->method->type) {
         case EXPR_TARGET:
             new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_p", 0);
+            add_operands(lexer, "%T%E", inv->sub, inv->method);
             break;
         case EXPR_CONSTANT:
             new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_sc, "tailcallmethod_p_sc", 0);
+            add_operands(lexer, "%T%E", inv->sub, inv->method);
             break;
         default:
             panic(lexer, "unknown expression type in tailcallmethod instruction");



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