develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34524 - trunk/compilers/pirc/new

From:
kjs
Date:
December 28, 2008 14:27
Subject:
[svn:parrot] r34524 - trunk/compilers/pirc/new
Message ID:
20081228222653.BB6ADCB9FA@x12.develooper.com
Author: kjs
Date: Sun Dec 28 14:26:52 2008
New Revision: 34524

Modified:
   trunk/compilers/pirc/new/bcgen.c
   trunk/compilers/pirc/new/pircompunit.h
   trunk/compilers/pirc/new/piremit.c

Log:
[pirc] start with generate_multi_signature function.
+ some brackets.

Modified: trunk/compilers/pirc/new/bcgen.c
==============================================================================
--- trunk/compilers/pirc/new/bcgen.c	(original)
+++ trunk/compilers/pirc/new/bcgen.c	Sun Dec 28 14:26:52 2008
@@ -364,8 +364,8 @@
 void
 emit_opcode(bytecode * const bc, opcode_t op) {
     *bc->opcursor++ = op;
-/*    fprintf(stderr, "[%d]", op);
-*/
+    fprintf(stderr, "[%d]", op);
+
 }
 
 /*
@@ -383,8 +383,8 @@
 void
 emit_int_arg(bytecode * const bc, int intval) {
     *bc->opcursor++ = intval;
-/*    fprintf(stderr, "[%d]", intval);
-*/
+    fprintf(stderr, "[%d]", intval);
+
 }
 
 
@@ -405,7 +405,29 @@
 }
 
 
+/*
+
+=item C<PMC *
+generate_multi_signature(bytecode * const bc)>
+
+Generate a PMC for the multi signature, based on the types defined in C<multi_types>
+C<type_count> indicates the number of types in the list.
 
+=cut
+
+*/
+static PMC *
+generate_multi_signature(bytecode * const bc, struct key * const multi_types, unsigned type_count) {
+    unsigned i;
+    PMC * const multi_signature = pmc_new(bc->interp, enum_class_FixedPMCArray);
+    VTABLE_set_integer_native(bc->interp, multi_signature, type_count);
+
+    for (i = 0; i < type_count; ++i) {
+
+
+    }
+    return multi_signature;
+}
 
 /*
 

Modified: trunk/compilers/pirc/new/pircompunit.h
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.h	(original)
+++ trunk/compilers/pirc/new/pircompunit.h	Sun Dec 28 14:26:52 2008
@@ -279,11 +279,11 @@
 } bucket;
 
 /* accessors for the bucket union */
-#define bucket_string(B)    B->u.str
-#define bucket_symbol(B)    B->u.sym
-#define bucket_local(B)     B->u.loc
-#define bucket_global(B)    B->u.glob
-#define bucket_constant(B)  B->u.cons
+#define bucket_string(B)    (B)->u.str
+#define bucket_symbol(B)    (B)->u.sym
+#define bucket_local(B)     (B)->u.loc
+#define bucket_global(B)    (B)->u.glob
+#define bucket_constant(B)  (B)->u.cons
 
 /* hashtable structure */
 typedef struct hashtable {
@@ -326,8 +326,8 @@
 } subroutine;
 
 /* accessors for current sub and current instruction; makes code a bit more readable */
-#define CURRENT_SUB(L)          L->subs
-#define CURRENT_INSTRUCTION(L)  L->subs->statements
+#define CURRENT_SUB(L)          (L)->subs
+#define CURRENT_INSTRUCTION(L)  (L)->subs->statements
 
 /* forward declaration */
 struct lexer_state;

Modified: trunk/compilers/pirc/new/piremit.c
==============================================================================
--- trunk/compilers/pirc/new/piremit.c	(original)
+++ trunk/compilers/pirc/new/piremit.c	Sun Dec 28 14:26:52 2008
@@ -556,6 +556,7 @@
 */
 static void
 emit_pbc_key(lexer_state * const lexer, key * const k) {
+    fprintf(stderr, "emit pbc key\n");
     emit_pbc_expr(lexer, k->expr);
     /* XXX finish this. */
 }



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