[pypy-svn] r20289 - pypy/branch/somepbc-refactoring/pypy/rpython
arigo at codespeak.net
arigo at codespeak.net
Sat Nov 26 18:58:51 CET 2005
Author: arigo
Date: Sat Nov 26 18:58:50 2005
New Revision: 20289
Modified:
pypy/branch/somepbc-refactoring/pypy/rpython/normalizecalls.py
Log:
(pedronis, arigo)
maybe fixed call normalization. The test crashes later...
Modified: pypy/branch/somepbc-refactoring/pypy/rpython/normalizecalls.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/rpython/normalizecalls.py (original)
+++ pypy/branch/somepbc-refactoring/pypy/rpython/normalizecalls.py Sat Nov 26 18:58:50 2005
@@ -28,8 +28,7 @@
progress = False
for shape, table in callfamily.calltables.items():
for row in table:
- progress |= normalize_calltable_row_annotation(annotator, shape,
- row)
+ progress |= normalize_calltable_row_annotation(annotator, row)
if not progress:
return # done
@@ -115,35 +114,21 @@
did_something = True
return did_something
-def normalize_calltable_row_annotation(annotator, shape, row):
+def normalize_calltable_row_annotation(annotator, row):
if len(row) <= 1:
return False # nothing to do
graphs = row.values()
-
- shape_cnt, shape_keys, shape_star, shape_stst = shape
- assert not shape_star, "XXX not implemented"
- assert not shape_stst, "XXX not implemented"
-
- call_nbargs = shape_cnt + len(shape_keys)
-
- # for the first 'shape_cnt' arguments we need to generalize to
- # a common type
graph_bindings = {}
for graph in graphs:
- argnames, varargname, kwargname = graph.signature
- assert not varargname, "XXX not implemented"
graph_bindings[graph] = [annotator.binding(v)
for v in graph.getargs()]
- argorder = range(shape_cnt)
- for key in shape_keys:
- i = list(argnames).index(key)
- assert i not in argorder
- argorder.append(i)
- assert argorder == range(call_nbargs)
+ iterbindings = graph_bindings.itervalues()
+ nbargs = len(iterbindings.next())
+ for binding in iterbindings:
+ assert len(binding) == nbargs
- call_nbargs = shape_cnt + len(shape_keys)
generalizedargs = []
- for i in range(call_nbargs):
+ for i in range(nbargs):
args_s = []
for graph, bindings in graph_bindings.items():
args_s.append(bindings[i])
More information about the Pypy-commit
mailing list