[pypy-svn] rev 1438 - pypy/trunk/doc/objspace

arigo at codespeak.net arigo at codespeak.net
Mon Sep 29 15:24:49 CEST 2003


Author: arigo
Date: Mon Sep 29 15:24:49 2003
New Revision: 1438

Added:
   pypy/trunk/doc/objspace/basicblock.asc
Log:
FlowObjSpace interface definition

Added: pypy/trunk/doc/objspace/basicblock.asc
==============================================================================
--- (empty file)
+++ pypy/trunk/doc/objspace/basicblock.asc	Mon Sep 29 15:24:49 2003
@@ -0,0 +1,36 @@
+the CtlFlowObjSpace is supposed to produce the following object-model
+(currently just a linear list of objects referencing each other, sorry
+no UML diagream :-)
+
+the reason we want this objectmodel as the source for doing the
+translation is that otherwise we get very-hard-to-read low-level/pyrex
+code with lots of gotos etc.pp.
+
+With the CtlFlow-object model we can basically reconstruct some
+source-structure (without examining the bytecode).
+
+class BasicBlock:
+ .inputargs = [list-of-input-locals]
+ .locals = [list-of-all-locals-incluing-inputargs]
+ .operations = [list-of-operations]
+ .branch = <Branch or ConditionalBranch instance>
+
+class Variable:
+  pass
+
+class Constant:
+  .value = ...
+
+class SpaceOperation:
+  .opname = 'add'
+  .args = [list-of-variables]
+  .result = <Variable/Constant instance>
+
+class Branch:
+  .args = [list-of-variables]
+  .target = <BasicBlock instance>
+
+class ConditionalBranch:
+  .condition = <Variable instance>
+  .iftrue = <Branch instance>
+  .iffalse = <Branch instance>


More information about the Pypy-commit mailing list