Author: leo
Date: Mon Mar 6 05:29:55 2006
New Revision: 11801
Modified:
trunk/ChangeLog
trunk/include/parrot/enums.h
trunk/include/parrot/op.h
trunk/t/compilers/imcc/syn/tail.t
trunk/t/op/calling.t
Log:
Call argument bits changed
* Shifted argument type bits left by 2 according to r11754
* adjust t/op/calling.t
PASM code that is using (slurpy, flatten, optional, or named) needs
fixes.
Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Mon Mar 6 05:29:55 2006
@@ -1,5 +1,10 @@
# $Id$
+2006.03.06 leo
+ * Shifted argument type bits left by 2 according to r11754
+ change of docs/pdds/pdd03_calling_conventions.pod
+ * if you are creating PASM then code needs adjustment
+
2006.02.22 leo
* Released 0.4.2
See NEWS for more.
Modified: trunk/include/parrot/enums.h
==============================================================================
--- trunk/include/parrot/enums.h (original)
+++ trunk/include/parrot/enums.h Mon Mar 6 05:29:55 2006
@@ -47,22 +47,22 @@
/* &gen_from_enum(call_bits.pasm) */
typedef enum {
- /* 2 low bits are argument types */
- PARROT_ARG_INTVAL = 0x00,
- PARROT_ARG_STRING = 0x01,
- PARROT_ARG_PMC = 0x02,
- PARROT_ARG_FLOATVAL = 0x03,
- PARROT_ARG_TYPE_MASK = 0x03,
+ /* 4 low bits are argument types */
+ PARROT_ARG_INTVAL = 0x000,
+ PARROT_ARG_STRING = 0x001,
+ PARROT_ARG_PMC = 0x002,
+ PARROT_ARG_FLOATVAL = 0x003,
+ PARROT_ARG_TYPE_MASK = 0x00f,
/* argument meaning and conversion bits */
- PARROT_ARG_CONSTANT = 0x04,
+ PARROT_ARG_CONSTANT = 0x010,
/* bits a user has to define */
- PARROT_ARG_FLATTEN = 0x08, /* .flatten_arg */
+ PARROT_ARG_FLATTEN = 0x020, /* .flatten_arg */
PARROT_ARG_SLURPY_ARRAY = PARROT_ARG_FLATTEN, /* i.e. foldup */
- PARROT_ARG_MAYBE_FLATTEN = 0x10, /* flatten, if slurping and the
+ PARROT_ARG_MAYBE_FLATTEN = 0x040, /* flatten, if slurping and the
argument is array */
- PARROT_ARG_OPTIONAL = 0x20,
- PARROT_ARG_OPT_FLAG = 0x40, /* prev optional was set */
- PARROT_ARG_NAME = 0x80 /* this String is an arg name */
+ PARROT_ARG_OPTIONAL = 0x080,
+ PARROT_ARG_OPT_FLAG = 0x100, /* prev optional was set */
+ PARROT_ARG_NAME = 0x200 /* this String is an arg name */
/* more to come soon */
} Call_bits_enum_t;
Modified: trunk/include/parrot/op.h
==============================================================================
--- trunk/include/parrot/op.h (original)
+++ trunk/include/parrot/op.h Mon Mar 6 05:29:55 2006
@@ -27,7 +27,7 @@
PARROT_ARG_NC = PARROT_ARG_FLOATVAL | PARROT_ARG_CONSTANT,
PARROT_ARG_PC = PARROT_ARG_PMC | PARROT_ARG_CONSTANT,
PARROT_ARG_SC = PARROT_ARG_STRING | PARROT_ARG_CONSTANT,
- PARROT_ARG_KEYED = 0x10, /* reuse MAYBE_FLATTEN */
+ PARROT_ARG_KEYED = 0x20, /* reuse MAYBE_FLATTEN */
PARROT_ARG_KC = PARROT_ARG_PC | PARROT_ARG_KEYED,
PARROT_ARG_KIC= PARROT_ARG_IC | PARROT_ARG_KEYED,
Modified: trunk/t/compilers/imcc/syn/tail.t
==============================================================================
--- trunk/t/compilers/imcc/syn/tail.t (original)
+++ trunk/t/compilers/imcc/syn/tail.t Mon Mar 6 05:29:55 2006
@@ -50,7 +50,7 @@
.sub _funcall
.local pmc function
.local pmc argv
- get_params "(0,0x8)", function, argv
+ get_params "(0,0x20)", function, argv
print "[doing _funcall]\n"
$I33 = defined function
if $I33 goto doit
@@ -58,7 +58,7 @@
printerr "_funcall: Bad function.\n"
exit 0
doit:
- set_args "(0x8)", argv
+ set_args "(0x20)", argv
tailcall function
.end
Modified: trunk/t/op/calling.t
==============================================================================
--- trunk/t/op/calling.t (original)
+++ trunk/t/op/calling.t Mon Mar 6 05:29:55 2006
@@ -26,7 +26,7 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "set_args - parsing");
noop
- set_args "(0b10, 0)", P0, I0
+ set_args "(0, 0)", P0, I0
print "Ok 1\n"
set_args "()"
print "Ok 2\n"
@@ -39,7 +39,7 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "var_args - parsing");
.pcc_sub main:
print "Ok 1\n"
- set_args "(0b10, 0)", P0, I0
+ set_args "(0, 0)", P0, I0
get_results "(0)", I0
find_name P1, "foo"
print "Ok 2\n"
@@ -47,9 +47,9 @@
print "Ok 5\n"
end
.pcc_sub foo:
- get_params "(0b10, 0)", P0, I0
+ get_params "(0, 0)", P0, I0
print "Ok 3\n"
- set_returns "(0b100)", 42
+ set_returns "(0)", 42
print "Ok 4\n"
returncc
CODE
@@ -63,7 +63,7 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "call - i, ic");
.pcc_sub main:
set I16, 77
- set_args "(0b100, 0)", 42, I16
+ set_args "(0, 0)", 42, I16
find_name P1, "foo"
invokecc P1
print "back\n"
@@ -84,7 +84,7 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "call - i, ic, return i, ic");
.pcc_sub main:
set I16, 77
- set_args "(0b100, 0)", 42, I16
+ set_args "(0, 0)", 42, I16
get_results "(0, 0)", I16, I17
find_name P1, "foo"
invokecc P1
@@ -100,7 +100,7 @@
print I17
print "\n"
set I16, 88
- set_returns "(4, 0)", 99, I16
+ set_returns "(0, 0)", 99, I16
returncc
CODE
42
@@ -202,7 +202,7 @@
push P17, "ok 4\n"
new P18, .String
set P18, "ok 5\n"
- set_args "(0, 0x8, 0)", P16, P17, P18
+ set_args "(0, 0x20, 0)", P16, P17, P18
find_name P1, "foo"
invokecc P1
print "back\n"
@@ -238,7 +238,7 @@
print "back\n"
end
.pcc_sub foo:
- get_params "(0, 0x8)", P1, P2
+ get_params "(0, 0x20)", P1, P2
print P1
set I0, P2
print I0
@@ -293,13 +293,13 @@
push P20, P18
new P21, .String
set P21, "ok 6\n"
- set_args "(0, 0x8, 0x8, 0)", P16, P19, P20, P21
+ set_args "(0, 0x20, 0x20, 0)", P16, P19, P20, P21
find_name P1, "foo"
invokecc P1
print "back\n"
end
.pcc_sub foo:
- get_params "(0, 0x8)", P1, P2
+ get_params "(0, 0x20)", P1, P2
print P1
set I0, P2
print I0
@@ -355,7 +355,7 @@
invokecc $P1
.end
.sub foo
- get_params "(0x8)", $P0
+ get_params "(0x20)", $P0
$S0 = $P0[0]
print_item $S0
$S0 = $P0[1]
@@ -416,13 +416,13 @@
push P20, P18
new P21, .String
set P21, "ok 6\n"
- set_args "(0x10, 0x10, 0x10, 0x10)", P16, P19, P20, P21
+ set_args "(0x40, 0x40, 0x40, 0x40)", P16, P19, P20, P21
find_name P1, "foo"
invokecc P1
print "back\n"
end
.pcc_sub foo:
- get_params "(0, 0x8)", P1, P2
+ get_params "(0, 0x20)", P1, P2
print P1
set I0, P2
print I0
@@ -552,7 +552,7 @@
invokecc $P1
.end
.sub foo
- get_params "(0,0x20,0x40)", $P0, $P1, $I0
+ get_params "(0,0x80,0x100)", $P0, $P1, $I0
print $P0
if_null $P1, ok
print "not "
@@ -591,7 +591,7 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "get_param later");
.pcc_sub main:
set I16, 77
- set_args "(0b100, 0)", 42, I16
+ set_args "(0, 0)", 42, I16
get_results "(0, 0)", I16, I17
find_name P1, "foo"
invokecc P1
@@ -718,7 +718,7 @@
print "back\n"
end
.pcc_sub foo:
- get_params "(0, 0x8)", P1, P2
+ get_params "(0, 0x20)", P1, P2
print P1
set I0, P2
print I0
@@ -754,7 +754,7 @@
invokecc $P1
.end
.sub foo
- get_params "(0x20, 0x40)", $P1, $I0
+ get_params "(0x80, 0x100)", $P1, $I0
if_null $P1, ok
print "not "
ok:
@@ -773,7 +773,7 @@
invokecc $P1
.end
.sub foo
- get_params "(0x20, 0x40)", $P1, $I0
+ get_params "(0x80, 0x100)", $P1, $I0
unless_null $P1, ok
print "not "
ok:
@@ -1731,14 +1731,14 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "named - 1");
.pcc_sub main:
- set_args "(0x80, 0, 0x80, 0)", "b", 10, "a", 20
+ set_args "(0x200, 0, 0x200, 0)", "b", 10, "a", 20
get_results "()"
find_name P1, "foo"
invokecc P1
print "ok\n"
end
.pcc_sub foo:
- get_params "(0x80, 0, 0x80, 0)", "a", I0, "b", I1
+ get_params "(0x200, 0, 0x200, 0)", "a", I0, "b", I1
print_item I1
print_item I0
print_newline
@@ -1753,14 +1753,14 @@
new P0, .Hash
set P0['a'], 20
set P0['b'], 10
- set_args "(0x88)", P0 # :flatten :named
+ set_args "(0x220)", P0 # :flatten :named
get_results "()"
find_name P1, "foo"
invokecc P1
print "ok\n"
end
.pcc_sub foo:
- get_params "(0x80, 0, 0x80, 0)", "a", I0, "b", I1
+ get_params "(0x200, 0, 0x200, 0)", "a", I0, "b", I1
print_item I1
print_item I0
print_newline
@@ -1772,14 +1772,14 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "named - 3 slurpy hash");
.pcc_sub main:
- set_args "(0x80, 0, 0x80, 0,0x80, 0)", "a", 10, "b", 20, 'c', 30
+ set_args "(0x200, 0, 0x200, 0,0x200, 0)", "a", 10, "b", 20, 'c', 30
get_results "()"
find_name P1, "foo"
invokecc P1
print "ok\n"
end
.pcc_sub foo:
- get_params "(0x80, 0, 0x88)", "a", I0, P0
+ get_params "(0x200, 0, 0x220)", "a", I0, P0
print_item I0
elements I1, P0
print_item I1
@@ -1806,7 +1806,7 @@
print "ok\n"
end
.pcc_sub foo:
- get_params "(0x80, 0, 0x80, 0, 0x80, 0)", "a", I0, "b", I1, 'c', I2
+ get_params "(0x200, 0, 0x200, 0, 0x200, 0)", "a", I0, "b", I1, 'c', I2
print_item I0
print_item I1
print_item I2
@@ -1819,14 +1819,14 @@
pasm_output_is(<<'CODE', <<'OUTPUT', "named - 5 slurpy array -> named");
.pcc_sub main:
- set_args "(0, 0, 0, 0x80, 0, 0x80, 0)", 10, 20, 30, 'a', 40, 'b', 50
+ set_args "(0, 0, 0, 0x200, 0, 0x200, 0)", 10, 20, 30, 'a', 40, 'b', 50
get_results "()"
find_name P1, "foo"
invokecc P1
print "ok\n"
end
.pcc_sub foo:
- get_params "(0, 0x08, 0x80, 0, 0x80, 0)", I0, P0, "b", I1, "a", I2
+ get_params "(0, 0x20, 0x200, 0, 0x200, 0)", I0, P0, "b", I1, "a", I2
print_item I0
set I0, P0[0]
print_item I0