cvsuser 03/09/23 12:19:42
Modified: . build_nativecall.pl call_list.txt
Log:
Added in the B and b types to the NCI, though only for parameters not for return
types. (That's more work)
Unfortunately only working on non-x86/JIT platforms, since this requires JIT
twidding to work there.
Revision Changes Path
1.23 +26 -5 parrot/build_nativecall.pl
Index: build_nativecall.pl
===================================================================
RCS file: /cvs/public/parrot/build_nativecall.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -r1.22 -r1.23
--- build_nativecall.pl 23 Sep 2003 10:33:03 -0000 1.22
+++ build_nativecall.pl 23 Sep 2003 19:19:42 -0000 1.23
@@ -13,6 +13,8 @@
d => [0,0,0,0,1], # returning a double
t => [0,0,1,0,0], # returning a string
v => [0,0,0,0,0], # void return
+# b => [0,0,1,0,0], # Returns a buffer
+# B => [0,0,1,0,0], # Returns a buffer
);
@@ -28,6 +30,8 @@
d => "double",
t => "char *",
v => "void",
+# b => "void *",
+# B => "void **",
);
my (%proto_type) = (p => "void *",
@@ -43,10 +47,15 @@
t => "char *",
v => "void",
I => "struct Parrot_Interp *",
- P => "PMC *"
+ P => "PMC *",
+# b => "void *",
+ B => "void **",
);
-my (%other_decl) = (p => "PMC *final_destination = pmc_new(interpreter,
enum_class_UnManagedStruct);");
+my (%other_decl) = (p => "PMC *final_destination = pmc_new(interpreter,
enum_class_UnManagedStruct);",
+# b => "Buffer *final_destination =
new_buffer_header(interpreter);\nPObj_external_SET(final_destination)",
+# B => "Buffer *final_destination =
new_buffer_header(interpreter);\nPObj_external_SET(final_destination)",
+ );
my (%ret_type_decl) = (p => "void *",
i => "int",
@@ -60,6 +69,8 @@
d => "double",
t => "char *",
v => "void *",
+# b => "void *",
+# B => "void **",
);
my (%ret_assign) = (p => "PMC_data(final_destination) = return_data;\nPMC_REG(5) =
final_destination;",
@@ -73,6 +84,8 @@
f => "NUM_REG(5) = return_data;",
d => "NUM_REG(5) = return_data;",
v => "",
+# b => "final_destination->bufstart = return_data;\nSTR_REG(5) =
final_destination",
+# B => "final_destination->bufstart = *return_data;\nSTR_REG(5) =
final_destination",
);
my (%func_call_assign) = (p => "return_data = ",
@@ -85,7 +98,9 @@
s => "return_data = ",
f => "return_data = ",
d => "return_data = ",
- v => "",
+ b => "return_data = ",
+# B => "return_data = ",
+# v => "",
);
open NCI, ">nci.c" or die "Can't open nci.c!";
@@ -103,7 +118,7 @@
/* nci.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: build_nativecall.pl,v 1.22 2003/09/23 10:33:03 leo Exp $
+ * $Id: build_nativecall.pl,v 1.23 2003/09/23 19:19:42 dan Exp $
* Overview:
* Native Call Interface routines. The code needed to build a
* parrot to C call frame is in here
@@ -242,6 +257,12 @@
};
/t/ && do {my $regnum = $reg_ref->{s}++;
return "string_to_cstring(interpreter, STR_REG($regnum))";
+ };
+ /b/ && do {my $regnum = $reg_ref->{s}++;
+ return "STR_REG($regnum)->bufstart";
+ };
+ /B/ && do {my $regnum = $reg_ref->{s}++;
+ return "&(STR_REG($regnum)->bufstart)";
};
/I/ && do {
return "interpreter";
1.12 +1 -0 parrot/call_list.txt
Index: call_list.txt
===================================================================
RCS file: /cvs/public/parrot/call_list.txt,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -r1.11 -r1.12
--- call_list.txt 23 Sep 2003 14:42:12 -0000 1.11
+++ call_list.txt 23 Sep 2003 19:19:42 -0000 1.12
@@ -52,6 +52,7 @@
i ilsp
i pl
i 4i
+p B
# These are needed for parrotio.pmc
i IP