[pypy-svn] r35382 - in pypy/branch/jit-real-world/pypy/rpython: . ootypesystem
ac at codespeak.net
ac at codespeak.net
Wed Dec 6 13:14:18 CET 2006
Author: ac
Date: Wed Dec 6 13:14:16 2006
New Revision: 35382
Modified:
pypy/branch/jit-real-world/pypy/rpython/ootypesystem/ooregistry.py
pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rbuiltin.py
pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rclass.py
pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rstr.py
pypy/branch/jit-real-world/pypy/rpython/rtyper.py
Log:
Oops, we forgot this.
svn merge -r 35308:35309 http://codespeak.net/svn/pypy/dist/pypy/rpython
Modified: pypy/branch/jit-real-world/pypy/rpython/ootypesystem/ooregistry.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/ootypesystem/ooregistry.py (original)
+++ pypy/branch/jit-real-world/pypy/rpython/ootypesystem/ooregistry.py Wed Dec 6 13:14:16 2006
@@ -21,8 +21,8 @@
annmodel.SomeFloat,
annmodel.SomeOOInstance,
annmodel.SomeString))
- assert isinstance(hop.args_s[1], annmodel.SomeInteger)
- return hop.genop('oostring', hop.args_v, resulttype = ootype.String)
+ vlist = hop.inputargs(hop.args_r[0], ootype.Signed)
+ return hop.genop('oostring', vlist, resulttype = ootype.String)
class Entry_ootype_string(ExtRegistryEntry):
@@ -44,10 +44,10 @@
def specialize_call(self, hop):
assert isinstance(hop.args_s[0], annmodel.SomeOOInstance)\
and hop.args_s[0].ootype is ootype.String
- assert isinstance(hop.args_s[1], annmodel.SomeInteger)
+ vlist = hop.inputargs(hop.args_r[0], ootype.Signed)
hop.has_implicit_exception(ValueError)
hop.exception_is_here()
- return hop.genop('ooparse_int', hop.args_v, resulttype = ootype.Signed)
+ return hop.genop('ooparse_int', vlist, resulttype = ootype.Signed)
class Entry_oohash(ExtRegistryEntry):
_about_ = ootype.oohash
@@ -60,4 +60,5 @@
def specialize_call(self, hop):
assert isinstance(hop.args_s[0], annmodel.SomeOOInstance)\
and hop.args_s[0].ootype is ootype.String
- return hop.genop('oohash', hop.args_v, resulttype=ootype.Signed)
+ vlist = hop.inputargs(hop.args_r[0])
+ return hop.genop('oohash', vlist, resulttype=ootype.Signed)
Modified: pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rbuiltin.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rbuiltin.py (original)
+++ pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rbuiltin.py Wed Dec 6 13:14:16 2006
@@ -1,5 +1,5 @@
from pypy.annotation import model as annmodel
-from pypy.rpython.ootypesystem import ootype
+from pypy.rpython.ootypesystem import ootype, rootype
from pypy.rpython.ootypesystem import rclass
from pypy.rpython.ootypesystem.rdict import rtype_r_dict
from pypy.objspace.flow.model import Constant
@@ -20,23 +20,24 @@
def rtype_classof(hop):
assert isinstance(hop.args_s[0], annmodel.SomeOOInstance)
- return hop.genop('classof', hop.args_v,
+ vlist = hop.inputargs(hop.args_r[0])
+ return hop.genop('classof', vlist,
resulttype = ootype.Class)
def rtype_subclassof(hop):
- assert isinstance(hop.args_s[0], annmodel.SomeOOClass)
- assert isinstance(hop.args_s[1], annmodel.SomeOOClass)
- return hop.genop('subclassof', hop.args_v,
+ vlist = hop.inputargs(rootype.ooclass_repr, rootype.ooclass_repr)
+ return hop.genop('subclassof', vlist,
resulttype = ootype.Bool)
def rtype_runtimenew(hop):
- assert isinstance(hop.args_s[0], annmodel.SomeOOClass)
- return hop.genop('runtimenew', hop.args_v,
+ vlist = hop.inputargs(rootype.ooclass_repr)
+ return hop.genop('runtimenew', vlist,
resulttype = hop.r_result.lowleveltype)
def rtype_ooidentityhash(hop):
assert isinstance(hop.args_s[0], annmodel.SomeOOInstance)
- return hop.genop('ooidentityhash', hop.args_v,
+ vlist = hop.inputargs(hop.args_r[0])
+ return hop.genop('ooidentityhash', vlist,
resulttype = ootype.Signed)
def rtype_builtin_isinstance(hop):
Modified: pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rclass.py (original)
+++ pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rclass.py Wed Dec 6 13:14:16 2006
@@ -399,12 +399,8 @@
vinst, = hop.inputargs(self)
return hop.genop('oononnull', [vinst], resulttype=ootype.Bool)
- def ll_const(c):
- return c
- ll_const = staticmethod(ll_const)
-
def ll_str(self, instance):
- return ootype.oostring(instance, self.ll_const(-1))
+ return ootype.oostring(instance, -1)
def rtype_type(self, hop):
if hop.s_result.is_constant():
Modified: pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rstr.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rstr.py (original)
+++ pypy/branch/jit-real-world/pypy/rpython/ootypesystem/rstr.py Wed Dec 6 13:14:16 2006
@@ -61,11 +61,8 @@
class LLHelpers(AbstractLLHelpers):
- def ll_const(c):
- return c
-
def ll_chr2str(ch):
- return ootype.oostring(ch, LLHelpers.ll_const(-1))
+ return ootype.oostring(ch, -1)
def ll_strhash(s):
return ootype.oohash(s)
Modified: pypy/branch/jit-real-world/pypy/rpython/rtyper.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/rtyper.py (original)
+++ pypy/branch/jit-real-world/pypy/rpython/rtyper.py Wed Dec 6 13:14:16 2006
@@ -717,6 +717,8 @@
return vars
def genop(self, opname, args_v, resulttype=None):
+ assert args_v is not self.args_v, ("Wrong level! "
+ "You need to pass the result of hop.inputargs() to genop().")
return self.llops.genop(opname, args_v, resulttype)
def gendirectcall(self, ll_function, *args_v):
More information about the Pypy-commit
mailing list