Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r60378:6cda1d4693bf
Date: 2013-01-23 17:15 +0200
http://bitbucket.org/pypy/pypy/changeset/6cda1d4693bf/

Log:    some more work on test_random

diff --git a/rpython/jit/backend/test/test_random.py 
b/rpython/jit/backend/test/test_random.py
--- a/rpython/jit/backend/test/test_random.py
+++ b/rpython/jit/backend/test/test_random.py
@@ -109,10 +109,10 @@
             descrstr = ''
         else:
             try:
-                descrstr = getattr(op.getdescr(), '_random_info')
+                descrstr = ', ' + getattr(op.getdescr(), '_random_info')
             except AttributeError:
                 if op.opnum == rop.LABEL:
-                    descrstr = 'TargetToken()'
+                    descrstr = ', TargetToken()'
                 else:
                     descrstr = ', descr=' + 
self.descr_counters.get(op.getdescr(), '...')
         print >>s, '        ResOperation(rop.%s, [%s], %s%s),' % (
@@ -176,12 +176,15 @@
         for op in self.loop.operations:
             descr = op.getdescr()
             if hasattr(descr, '_random_info'):
-                num = len(TYPE_NAMES)
-                tp_name = 'S' + str(num)
-                descr._random_info = descr._random_info.replace('...', tp_name)
+                if descr._random_type in TYPE_NAMES:
+                    tp_name = TYPE_NAMES[descr._random_type]
+                else:
+                    num = len(TYPE_NAMES)
+                    tp_name = 'S' + str(num)
+                    descr._random_info = descr._random_info.replace('...', 
tp_name)
+                    TYPE_NAMES[descr._random_type] = tp_name
                 print >>s, "    %s = %s" % (tp_name,
                                             type_descr(descr._random_type, 
num))
-                TYPE_NAMES[descr._random_type] = tp_name
         #
         def writevar(v, nameprefix, init=''):
             if nameprefix == 'const_ptr':
@@ -198,6 +201,7 @@
                                                       lgt)
                 else:
                     init = 'lltype.malloc(%s)' % TYPE_NAMES[TYPE.TO]
+                init = 'lltype.cast_opaque_ptr(llmemory.GCREF, %s)' % init
             names[v] = '%s%d' % (nameprefix, len(names))
             print >>s, '    %s = %s(%s)' % (names[v], v.__class__.__name__,
                                             init)
diff --git a/rpython/jit/backend/x86/test/test_regalloc2.py 
b/rpython/jit/backend/x86/test/test_regalloc2.py
--- a/rpython/jit/backend/x86/test/test_regalloc2.py
+++ b/rpython/jit/backend/x86/test/test_regalloc2.py
@@ -1,14 +1,15 @@
 from rpython.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\
      BasicFailDescr, JitCellToken, BasicFinalDescr, TargetToken, ConstPtr,\
-     BoxPtr
+     BoxPtr, BoxFloat
 from rpython.jit.metainterp.resoperation import rop
 from rpython.jit.backend.detect_cpu import getcpuclass
 from rpython.jit.backend.x86.arch import WORD
 from rpython.jit.tool.oparser import parse
-from rpython.rtyper.lltypesystem import lltype, rffi, rclass, llmemory
+from rpython.rtyper.lltypesystem import lltype, rffi, rclass, llmemory, rstr
 from rpython.rtyper.llinterp import LLException
 from rpython.rtyper.annlowlevel import llhelper
 from rpython.jit.codewriter.effectinfo import EffectInfo
+from rpython.jit.codewriter import longlong
 
 CPU = getcpuclass()
 
@@ -299,7 +300,7 @@
     assert cpu.get_int_value(deadframe, 20) == -49
 
 def getllhelper(cpu, f, ARGS, RES):
-    FPTR = lltype.Ptr(lltype.FuncType([lltype.Signed], lltype.Void))
+    FPTR = lltype.Ptr(lltype.FuncType(ARGS, RES))
     fptr = llhelper(FPTR, f)
     calldescr = cpu.calldescrof(FPTR.TO, FPTR.TO.ARGS, FPTR.TO.RESULT,
                                 EffectInfo.MOST_GENERAL)
@@ -314,3 +315,5 @@
     xptr = lltype.cast_opaque_ptr(llmemory.GCREF, lltype.malloc(X))
     return xptr, xtp
 
+def test_bug2():
+    pass
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to