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

[svn:parrot] r34993 - branches/bcanno/compilers/imcc

From:
jonathan
Date:
January 5, 2009 08:09
Subject:
[svn:parrot] r34993 - branches/bcanno/compilers/imcc
Message ID:
20090105160855.8946ACB9F9@x12.develooper.com
Author: jonathan
Date: Mon Jan  5 08:08:54 2009
New Revision: 34993

Modified:
   branches/bcanno/compilers/imcc/parser_util.c
   branches/bcanno/compilers/imcc/pbc.c

Log:
[imcc] Get annotations now being passed through to code generation stage, so we can start work on storing them.

Modified: branches/bcanno/compilers/imcc/parser_util.c
==============================================================================
--- branches/bcanno/compilers/imcc/parser_util.c	(original)
+++ branches/bcanno/compilers/imcc/parser_util.c	Mon Jan  5 08:08:54 2009
@@ -378,6 +378,14 @@
     op_info_t   *op_info;
     char fullname[64], format[128];
 
+    if (STREQ(name, ".annotate")) {
+        ins = _mk_instruction(name, "", n, r, 0);
+        if (emit)
+            return emitb(interp, unit, ins);
+        else
+            return ins;
+    }
+
     if ((STREQ(name, "set_args"))
     ||  (STREQ(name, "get_results"))
     ||  (STREQ(name, "get_params"))

Modified: branches/bcanno/compilers/imcc/pbc.c
==============================================================================
--- branches/bcanno/compilers/imcc/pbc.c	(original)
+++ branches/bcanno/compilers/imcc/pbc.c	Mon Jan  5 08:08:54 2009
@@ -723,7 +723,12 @@
         if (ins->type & ITLABEL)
             ins->symregs[0]->color = code_size;
 
-        if (ins->opname && *ins->opname) {
+        if (ins->opname && STREQ(ins->opname, ".annotate")) {
+            /* Annotations contribute nothing to code size, since they do not
+             * end up in bytecode segment. */
+            (*src_lines)++;
+        }
+        else if (ins->opname && *ins->opname) {
             (*src_lines)++;
             if (ins->opnum < 0)
                 IMCC_fatal(interp, 1, "get_codesize: "
@@ -2159,6 +2164,7 @@
 
     if (ins->opname && strcmp(ins->opname, ".annotate") == 0) {
         /* It's an annotation. Add annotations seg if we're missing one. */
+        printf("annotation to emit\n");
         if (!interp->code->annotations) {
         }
 



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