[pypy-svn] r52686 - in pypy/branch/jit-hotpath/pypy/jit/rainbow: . test
antocuni at codespeak.net
antocuni at codespeak.net
Tue Mar 18 16:01:30 CET 2008
Author: antocuni
Date: Tue Mar 18 16:01:28 2008
New Revision: 52686
Modified:
pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py
pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
Log:
start porting tests to ootype.
Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py Tue Mar 18 16:01:28 2008
@@ -16,6 +16,7 @@
from pypy.translator.backendopt.removenoops import remove_same_as
from pypy.translator.backendopt.ssa import SSA_to_SSI
from pypy.translator.unsimplify import varoftype
+from pypy.translator.simplify import get_funcobj, get_functype
from cStringIO import StringIO
def residual_exception_nontranslated(jitstate, e, rtyper):
@@ -39,19 +40,19 @@
def __init__(self, RGenOp, exceptiondesc, FUNCTYPE, colororder=None):
self.exceptiondesc = exceptiondesc
- self.sigtoken = RGenOp.sigToken(FUNCTYPE.TO)
- self.result_kind = RGenOp.kindToken(FUNCTYPE.TO.RESULT)
+ self.sigtoken = RGenOp.sigToken(get_functype(FUNCTYPE))
+ self.result_kind = RGenOp.kindToken(get_functype(FUNCTYPE).RESULT)
self.colororder = colororder
# xxx what if the result is virtualizable?
- self.redboxbuilder = rvalue.ll_redboxbuilder(FUNCTYPE.TO.RESULT)
- whatever_return_value = FUNCTYPE.TO.RESULT._defl()
- numargs = len(FUNCTYPE.TO.ARGS)
+ self.redboxbuilder = rvalue.ll_redboxbuilder(get_functype(FUNCTYPE).RESULT)
+ whatever_return_value = get_functype(FUNCTYPE).RESULT._defl()
+ numargs = len(get_functype(FUNCTYPE).ARGS)
voidargcount = 0
- for ARG in FUNCTYPE.TO.ARGS:
+ for ARG in get_functype(FUNCTYPE).ARGS:
if ARG == lltype.Void:
voidargcount += 1
- argiter = unrolling_iterable(FUNCTYPE.TO.ARGS)
- RETURN = FUNCTYPE.TO.RESULT
+ argiter = unrolling_iterable(get_functype(FUNCTYPE).ARGS)
+ RETURN = get_functype(FUNCTYPE).RESULT
if RETURN is lltype.Void:
self.gv_whatever_return_value = None
else:
@@ -1025,7 +1026,7 @@
def handle_oopspec_call(self, op, withexc):
from pypy.jit.timeshifter.oop import Index
- fnobj = op.args[0].value._obj
+ fnobj = get_funcobj(op.args[0].value)
oopspecdescindex = self.oopspecdesc_position(fnobj, withexc)
oopspecdesc = self.oopspecdescs[oopspecdescindex]
opargs = op.args[1:]
@@ -1152,7 +1153,8 @@
def handle_vable_call(self, op, withexc):
assert op.opname == 'direct_call'
- oopspec = op.args[0].value._obj._callable.oopspec
+ fnobj = get_funcobj(op.args[0].value)
+ oopspec = fnobj._callable.oopspec
name, _ = oopspec.split('(')
kind, name = name.split('_', 1)
@@ -1398,7 +1400,7 @@
def graphs_from(self, spaceop):
if spaceop.opname == 'direct_call':
c_func = spaceop.args[0]
- fnobj = c_func.value._obj
+ fnobj = get_funcobj(c_func.value)
graphs = [fnobj.graph]
args_v = spaceop.args[1:]
elif spaceop.opname == 'indirect_call':
@@ -1446,7 +1448,7 @@
def guess_call_kind(self, spaceop):
if spaceop.opname == 'direct_call':
c_func = spaceop.args[0]
- fnobj = c_func.value._obj
+ fnobj = get_funcobj(c_func.value)
if hasattr(fnobj, 'jitcallkind'):
return fnobj.jitcallkind, None
if (hasattr(fnobj._callable, 'oopspec') and
Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py Tue Mar 18 16:01:28 2008
@@ -1908,3 +1908,55 @@
class TestLLType(SimpleTests):
type_system = "lltype"
+
+class TestOOType(SimpleTests):
+ type_system = "ootype"
+
+ def _skip(self):
+ py.test.skip('in progress')
+
+ test_green_call = _skip
+ test_green_call_void_return = _skip
+ test_degenerated_before_return = _skip
+ test_degenerated_before_return_2 = _skip
+ test_degenerated_at_return = _skip
+ test_degenerated_via_substructure = _skip
+ test_degenerate_with_voids = _skip
+ test_plus_minus = _skip
+ test_red_virtual_container = _skip
+ test_red_array = _skip
+ test_red_struct_array = _skip
+ test_red_varsized_struct = _skip
+ test_array_of_voids = _skip
+ test_red_propagate = _skip
+ test_red_subcontainer = _skip
+ test_red_subcontainer_cast = _skip
+ test_merge_structures = _skip
+ test_deepfrozen_interior = _skip
+ test_compile_time_const_tuple = _skip
+ test_residual_red_call = _skip
+ test_residual_red_call_with_exc = _skip
+ test_simple_meth = _skip
+ test_simple_red_meth = _skip
+ test_simple_red_meth_vars_around = _skip
+ test_simple_indirect_call = _skip
+ test_normalize_indirect_call = _skip
+ test_normalize_indirect_call_more = _skip
+ test_green_char_at_merge = _skip
+ test_self_referential_structures = _skip
+ test_known_nonzero = _skip
+ test_debug_assert_ptr_nonzero = _skip
+ test_indirect_red_call = _skip
+ test_indirect_red_call_with_exc = _skip
+ test_indirect_gray_call = _skip
+ test_indirect_residual_red_call = _skip
+ test_constant_indirect_red_call = _skip
+ test_constant_indirect_red_call_no_result = _skip
+ test_indirect_sometimes_residual_pure_red_call = _skip
+ test_indirect_sometimes_residual_pure_but_fixed_red_call = _skip
+ test_manual_marking_of_pure_functions = _skip
+ test_red_int_add_ovf = _skip
+ test_nonzeroness_assert_while_compiling = _skip
+ test_segfault_while_compiling = _skip
+ test_substitute_graph_void = _skip
+ test_void_args = _skip
More information about the pypy-svn
mailing list