[pypy-commit] pypy iterator-in-rpython: bah fix
fijal
noreply at buildbot.pypy.org
Sun Jul 8 20:50:14 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: iterator-in-rpython
Changeset: r56006:51c784ae0b2c
Date: 2012-07-08 20:49 +0200
http://bitbucket.org/pypy/pypy/changeset/51c784ae0b2c/
Log: bah fix
diff --git a/pypy/annotation/bookkeeper.py b/pypy/annotation/bookkeeper.py
--- a/pypy/annotation/bookkeeper.py
+++ b/pypy/annotation/bookkeeper.py
@@ -201,6 +201,7 @@
for op in block.operations:
if op.opname in ('simple_call', 'call_args'):
yield op
+
# some blocks are partially annotated
if binding(op.result, None) is None:
break # ignore the unannotated part
diff --git a/pypy/annotation/unaryop.py b/pypy/annotation/unaryop.py
--- a/pypy/annotation/unaryop.py
+++ b/pypy/annotation/unaryop.py
@@ -662,11 +662,13 @@
def iter(ins):
s_iterable = ins._true_getattr('__iter__')
- return s_iterable.call(getbookkeeper().build_args("simple_call", []))
+ bk = getbookkeeper()
+ return bk.emulate_pbc_call(bk.position_key, s_iterable, [])
def next(ins):
s_next = ins._true_getattr('next')
- return s_next.call(getbookkeeper().build_args('simple_call', []))
+ bk = getbookkeeper()
+ return bk.emulate_pbc_call(bk.position_key, s_next, [])
class __extend__(SomeBuiltin):
def _can_only_throw(bltn, *args):
diff --git a/pypy/rpython/rclass.py b/pypy/rpython/rclass.py
--- a/pypy/rpython/rclass.py
+++ b/pypy/rpython/rclass.py
@@ -389,19 +389,12 @@
if '__iter__' in self.allinstancefields:
raise Exception("__iter__ on instance disallowed")
r_method = self.rtyper.makerepr(s_attr)
- v_self = r_method.get_method_from_instance(self, vinst, hop.llops)
+ r_method.get_method_from_instance(self, vinst, hop.llops)
hop2 = hop.copy()
hop2.spaceop.opname = 'simple_call'
hop2.args_r = [r_method]
hop2.args_s = [s_attr]
return hop2.dispatch()
- xxx
- #return hop.r_result.get_method_from_instance(self, vinst,
- # hop.llops)
- if '__iter__' not in self.rclass.allmethods:
- raise Exception("Only supporting iterators with __iter__ as a method")
- viter = self.rclass.getclsfield(vcls, '__iter__', hop.llops)
- return hop.gendirectcall(viter, vinst)
def rtype_next(self, hop):
xxx
diff --git a/pypy/rpython/rpbc.py b/pypy/rpython/rpbc.py
--- a/pypy/rpython/rpbc.py
+++ b/pypy/rpython/rpbc.py
@@ -399,8 +399,6 @@
lowleveltype = Void
def __init__(self, frozendesc):
- import pdb
- pdb.set_trace()
self.frozendesc = frozendesc
def rtype_getattr(_, hop):
More information about the pypy-commit
mailing list