[svn:parrot] r45082 - in branches/pcc_hackathon_6Mar10: src/ops t/op

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Mar 21 09:39:50 UTC 2010


Author: bacek
Date: Sun Mar 21 09:39:49 2010
New Revision: 45082
URL: https://trac.parrot.org/parrot/changeset/45082

Log:
Implement op set_result_info

Modified:
   branches/pcc_hackathon_6Mar10/src/ops/core.ops
   branches/pcc_hackathon_6Mar10/src/ops/ops.num
   branches/pcc_hackathon_6Mar10/t/op/calling.t

Modified: branches/pcc_hackathon_6Mar10/src/ops/core.ops
==============================================================================
--- branches/pcc_hackathon_6Mar10/src/ops/core.ops	Sun Mar 21 09:08:28 2010	(r45081)
+++ branches/pcc_hackathon_6Mar10/src/ops/core.ops	Sun Mar 21 09:39:49 2010	(r45082)
@@ -540,6 +540,19 @@
     goto OFFSET(argc + 2);
 }
 
+=item B<set_result_info>(in PMC)
+
+Set result_info. See also C<result_info>.
+
+=cut
+
+inline op set_result_info(in PMC) {
+    PMC *ctx = CURRENT_CONTEXT(interp);
+    VTABLE_set_attr_str(interp, ctx,
+            Parrot_str_new_constant(interp, "return_flags"),
+            $1);
+}
+
 =item B<result_info>(out PMC)
 
 Returns the get_results signature PMC of the caller. This PMC is a
@@ -551,8 +564,7 @@
 
 inline op result_info(out PMC) {
     PMC *caller_ctx  = Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp));
-    PMC *call_object = Parrot_pcc_get_signature(interp, caller_ctx);
-    PMC *sig = VTABLE_get_attr_str(interp, call_object,
+    PMC *sig = VTABLE_get_attr_str(interp, caller_ctx,
             Parrot_str_new_constant(interp, "return_flags"));
 
     /* If no elements, hand back empty array; otherwise PMC. */

Modified: branches/pcc_hackathon_6Mar10/src/ops/ops.num
==============================================================================
--- branches/pcc_hackathon_6Mar10/src/ops/ops.num	Sun Mar 21 09:08:28 2010	(r45081)
+++ branches/pcc_hackathon_6Mar10/src/ops/ops.num	Sun Mar 21 09:39:49 2010	(r45082)
@@ -1271,3 +1271,5 @@
 find_name_p_sc                 1247
 find_sub_not_null_p_s          1248
 find_sub_not_null_p_sc         1249
+set_result_info_p              1250
+set_result_info_pc             1251

Modified: branches/pcc_hackathon_6Mar10/t/op/calling.t
==============================================================================
--- branches/pcc_hackathon_6Mar10/t/op/calling.t	Sun Mar 21 09:08:28 2010	(r45081)
+++ branches/pcc_hackathon_6Mar10/t/op/calling.t	Sun Mar 21 09:39:49 2010	(r45082)
@@ -1455,10 +1455,16 @@
 
 # result_info op
 
-pir_output_is( <<'CODE', <<'OUTPUT', "result_info op", todo => "Broken TT#1511" );
+pir_output_is( <<'CODE', <<'OUTPUT', "result_info op" );
 .sub main :main
     test()
+    $P0 = new 'FixedIntegerArray'
+    set_result_info $P0
+    $P0 = 1
     $I0 = test()
+    $P0 = new 'FixedIntegerArray'
+    $P0 = 3
+    set_result_info $P0
     ($I1, $I2, $I3) = test()
 .end
 
@@ -1475,7 +1481,7 @@
 3
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "result_info op with eval", todo => "Broken TT#1511" );
+pir_output_is( <<'CODE', <<'OUTPUT', "result_info op with eval" );
 .sub main :main
     $S0 = <<"TESTSUB"
 .sub test
@@ -1487,8 +1493,18 @@
 TESTSUB
     $P0 = compreg "PIR"
     $P1 = $P0($S0)
+    $P0 = new 'FixedIntegerArray'
+    set_result_info $P0
     test()
+
+    $P0 = new 'FixedIntegerArray'
+    $P0 = 1
+    set_result_info $P0
     $I0 = test()
+
+    $P0 = new 'FixedIntegerArray'
+    $P0 = 3
+    set_result_info $P0
     ($I1, $I2, $I3) = test()
 .end
 CODE


More information about the parrot-commits mailing list