[pypy-commit] pypy callfamily: create FunctionRepr
rlamy
noreply at buildbot.pypy.org
Wed Oct 7 02:45:36 CEST 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: callfamily
Changeset: r80006:64d0e4527392
Date: 2015-10-01 04:47 +0100
http://bitbucket.org/pypy/pypy/changeset/64d0e4527392/
Log: create FunctionRepr
diff --git a/rpython/rtyper/rpbc.py b/rpython/rtyper/rpbc.py
--- a/rpython/rtyper/rpbc.py
+++ b/rpython/rtyper/rpbc.py
@@ -35,14 +35,17 @@
def rtyper_makerepr(self, rtyper):
kind = self.getKind()
if issubclass(kind, FunctionDesc):
- sample = self.any_description()
- callfamily = sample.querycallfamily()
- if callfamily and callfamily.total_calltable_size > 0:
- getRepr = FunctionsPBCRepr
- if small_cand(rtyper, self):
- getRepr = SmallFunctionSetPBCRepr
+ if len(self.descriptions) == 1 and not self.can_be_None:
+ getRepr = FunctionRepr
else:
- getRepr = getFrozenPBCRepr
+ sample = self.any_description()
+ callfamily = sample.querycallfamily()
+ if callfamily and callfamily.total_calltable_size > 0:
+ getRepr = FunctionsPBCRepr
+ if small_cand(rtyper, self):
+ getRepr = SmallFunctionSetPBCRepr
+ else:
+ getRepr = getFrozenPBCRepr
elif issubclass(kind, ClassDesc):
# user classes
getRepr = ClassesPBCRepr
@@ -357,6 +360,9 @@
else:
return hop.llops.convertvar(v, rresult, hop.r_result)
+class FunctionRepr(FunctionsPBCRepr):
+ pass
+
class __extend__(pairtype(FunctionsPBCRepr, FunctionsPBCRepr)):
def convert_from_to((r_fpbc1, r_fpbc2), v, llops):
# this check makes sense because both source and dest repr are FunctionsPBCRepr
More information about the pypy-commit
mailing list