Author: Alex Gaynor <[email protected]>
Branch: 
Changeset: r62639:4b1033320d32
Date: 2013-03-21 22:04 -0700
http://bitbucket.org/pypy/pypy/changeset/4b1033320d32/

Log:    (alex, fijal): removed annenforce args from rlist, also contains fix
        to rtypes

diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -178,13 +178,11 @@
             # a graph that has already been rtyped.  Safety-check the new
             # annotations that are passed in, and don't annotate the old
             # graph -- it's already low-level operations!
-            for a, s_newarg in zip(graph.getargs(), cells):
+            for a, s_newarg in zip(block.inputargs, cells):
                 s_oldarg = self.binding(a)
                 assert annmodel.unionof(s_oldarg, s_newarg) == s_oldarg
         else:
             assert not self.frozen
-            for a in cells:
-                assert isinstance(a, annmodel.SomeObject)
             if block not in self.annotated:
                 self.bindinputargs(graph, block, cells)
             else:
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -598,7 +598,7 @@
             return result
 
         return decorate
-        
+
 
     def clone(self):
         assert self.inline_jit_merge_point, 'JitDriver.clone works only after 
@inline'
@@ -844,7 +844,7 @@
         assert s_name.is_constant()
         if s_name.const == 'enable_opts':
             assert annmodel.SomeString(can_be_None=True).contains(s_value)
-        else: 
+        else:
             assert (s_value == annmodel.s_None or
                     annmodel.SomeInteger().contains(s_value))
         return annmodel.s_None
@@ -876,7 +876,7 @@
 
 class AsmInfo(object):
     """ An addition to JitDebugInfo concerning assembler. Attributes:
-    
+
     ops_offset - dict of offsets of operations or None
     asmaddr - (int) raw address of assembler block
     asmlen - assembler block length
@@ -986,7 +986,7 @@
 
     def specialize_call(self, hop):
         from rpython.rtyper.lltypesystem import rclass, lltype
-        
+
         classrepr = rclass.get_type_repr(hop.rtyper)
 
         hop.exception_cannot_occur()
diff --git a/rpython/rtyper/rlist.py b/rpython/rtyper/rlist.py
--- a/rpython/rtyper/rlist.py
+++ b/rpython/rtyper/rlist.py
@@ -1,16 +1,18 @@
-from rpython.tool.pairtype import pairtype, pair
+from rpython.annotator import model as annmodel
 from rpython.flowspace.model import Constant
-from rpython.annotator import model as annmodel
+from rpython.rlib import rgc, jit, types
+from rpython.rlib.debug import ll_assert
+from rpython.rlib.objectmodel import malloc_zero_filled
+from rpython.rlib.signature import signature
+from rpython.rlib.rarithmetic import ovfcheck, widen, r_uint, intmask
+from rpython.rtyper.annlowlevel import ADTInterface
 from rpython.rtyper.error import TyperError
+from rpython.rtyper.lltypesystem.lltype import typeOf, Ptr, Void, Signed, Bool
+from rpython.rtyper.lltypesystem.lltype import nullptr, Char, UniChar, Number
 from rpython.rtyper.rmodel import Repr, IteratorRepr, IntegerRepr
 from rpython.rtyper.rstr import AbstractStringRepr, AbstractCharRepr
-from rpython.rtyper.lltypesystem.lltype import typeOf, Ptr, Void, Signed, Bool
-from rpython.rtyper.lltypesystem.lltype import nullptr, Char, UniChar, Number
-from rpython.rlib.objectmodel import malloc_zero_filled
-from rpython.rlib.debug import ll_assert
-from rpython.rlib.rarithmetic import ovfcheck, widen, r_uint, intmask
-from rpython.rtyper.annlowlevel import ADTInterface
-from rpython.rlib import rgc, jit
+from rpython.tool.pairtype import pairtype, pair
+
 
 ADTIFixedList = ADTInterface(None, {
     'll_newlist':      (['SELF', Signed        ], 'self'),
@@ -521,6 +523,7 @@
     return LIST.ITEM
 
 
+@signature(types.any(), types.any(), types.int(), types.int(), types.int(), 
returns=types.none())
 def ll_arraycopy(source, dest, source_start, dest_start, length):
     SRCTYPE = typeOf(source)
     if isinstance(SRCTYPE, Ptr):
@@ -534,8 +537,7 @@
             item = source.ll_getitem_fast(source_start + i)
             dest.ll_setitem_fast(dest_start + i, item)
             i += 1
-ll_arraycopy._annenforceargs_ = [None, None, int, int, int]
-# no oopspec -- the function is inlined by the JIT
+
 
 def ll_copy(RESLIST, l):
     length = l.ll_length()
@@ -873,8 +875,9 @@
     while j < newlength:
         lst.ll_setitem_fast(j, char)
         j += 1
-# not inlined by the JIT -- contains a loop
 
+
+@signature(types.any(), types.any(), types.int(), returns=types.any())
 def ll_listslice_startonly(RESLIST, l1, start):
     len1 = l1.ll_length()
     ll_assert(start >= 0, "unexpectedly negative list slice start")
@@ -883,8 +886,7 @@
     l = RESLIST.ll_newlist(newlength)
     ll_arraycopy(l1, l, start, 0, newlength)
     return l
-ll_listslice_startonly._annenforceargs_ = (None, None, int)
-# no oopspec -- the function is inlined by the JIT
+
 
 def ll_listslice_startstop(RESLIST, l1, start, stop):
     length = l1.ll_length()
diff --git a/rpython/tool/sourcetools.py b/rpython/tool/sourcetools.py
--- a/rpython/tool/sourcetools.py
+++ b/rpython/tool/sourcetools.py
@@ -272,7 +272,7 @@
 
 
 def rpython_wrapper(f, template, templateargs=None, **globaldict):
-    """  
+    """
     We cannot simply wrap the function using *args, **kwds, because it's not
     RPython. Instead, we generate a function from ``template`` with exactly
     the same argument list.
@@ -280,8 +280,8 @@
     if templateargs is None:
         templateargs = {}
     srcargs, srcvarargs, srckeywords, defaults = inspect.getargspec(f)
-    assert not srcvarargs, '*args not supported by enforceargs'
-    assert not srckeywords, '**kwargs not supported by enforceargs'
+    assert not srcvarargs, '*args not supported by rpython_wrapper'
+    assert not srckeywords, '**kwargs not supported by rpython_wrapper'
     #
     arglist = ', '.join(srcargs)
     templateargs.update(name=f.func_name,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to