[Python-checkins] python/dist/src/Python compile.c, 2.247.2.4, 2.247.2.5 newcompile.c, 1.1.2.124, NONE
jhylton@users.sourceforge.net
jhylton at users.sourceforge.net
Tue Oct 18 15:36:10 CEST 2005
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14036/Python
Modified Files:
Tag: ast-branch
compile.c
Removed Files:
Tag: ast-branch
newcompile.c
Log Message:
Replace compile.c with newcompile.c.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.247.2.4
retrieving revision 2.247.2.5
diff -u -d -r2.247.2.4 -r2.247.2.5
--- compile.c 16 Oct 2005 05:24:05 -0000 2.247.2.4
+++ compile.c 18 Oct 2005 13:36:07 -0000 2.247.2.5
@@ -1,328 +1,379 @@
-/* Compile an expression node to intermediate code */
-
-/* XXX TO DO:
- XXX add __doc__ attribute == co_doc to code object attributes?
- XXX (it's currently the first item of the co_const tuple)
- XXX Generate simple jump for break/return outside 'try...finally'
- XXX Allow 'continue' inside finally clause of try-finally
- XXX New opcode for loading the initial index for a for loop
- XXX other JAR tricks?
-*/
+/*
[...8429 lines suppressed...]
+ goto error;
+
+ /* Emit code in reverse postorder from dfs. */
+ for (i = a.a_nblocks - 1; i >= 0; i--) {
+ basicblock *b = a.a_postorder[i];
+ for (j = 0; j < b->b_iused; j++)
+ if (!assemble_emit(&a, &b->b_instr[j]))
+ goto error;
}
+
+ if (_PyString_Resize(&a.a_lnotab, a.a_lnotab_off) < 0)
+ goto error;
+ if (_PyString_Resize(&a.a_bytecode, a.a_offset) < 0)
+ goto error;
+
+ co = makecode(c, &a);
+ error:
+ assemble_free(&a);
+ return co;
}
--- newcompile.c DELETED ---
More information about the Python-checkins
mailing list