[pypy-svn] r58676 - in pypy/branch/oo-jit/pypy/jit/codegen/cli: . test
antocuni at codespeak.net
antocuni at codespeak.net
Mon Oct 6 18:01:13 CEST 2008
Author: antocuni
Date: Mon Oct 6 18:01:07 2008
New Revision: 58676
Modified:
pypy/branch/oo-jit/pypy/jit/codegen/cli/args_manager.py
pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_gencli_interpreter.py
Log:
implement replay; test_known_nonzero mostly pass, but with some args it loops
because of some problem probably related to promotion
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/args_manager.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/args_manager.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/args_manager.py Mon Oct 6 18:01:07 2008
@@ -46,6 +46,9 @@
return self.clitype
def register_types(self, types):
+ if not self.is_open():
+ return # XXX
+
assert self.is_open()
newcounter = {}
for clitype in types:
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py Mon Oct 6 18:01:07 2008
@@ -6,11 +6,13 @@
from pypy.jit.codegen.model import AbstractRGenOp, GenBuilder, GenLabel
from pypy.jit.codegen.model import GenVarOrConst, GenVar, GenConst
from pypy.jit.codegen.model import CodeGenSwitch
+from pypy.jit.codegen.model import ReplayBuilder, dummy_var
from pypy.jit.codegen.cli import operation as ops
from pypy.jit.codegen.cli.methodfactory import get_method_wrapper
from pypy.jit.codegen.cli.args_manager import ArgsManager
from pypy.translator.cli.dotnet import CLR, typeof, new_array, init_array
from pypy.translator.cli.dotnet import box, unbox, clidowncast, classof
+from pypy.translator.cli.dotnet import class2type, type2class
from pypy.translator.cli import dotnet
System = CLR.System
DelegateHolder = CLR.pypy.runtime.DelegateHolder
@@ -114,19 +116,15 @@
def getCliType(self):
return class2type(self.ooclass)
-def class2type(cls):
- 'Cast a PBC of type ootype.Class into a System.Type instance'
- if cls is cVoid:
- return None
- else:
- return clidowncast(box(cls), System.Type)
-
class __extend__(GenVarOrConst):
__metaclass__ = extendabletype
def getCliType(self):
raise NotImplementedError
-
+
+ def getkind(self):
+ return type2class(self.getCliType())
+
def load(self, builder):
raise NotImplementedError
@@ -426,8 +424,7 @@
return builder, graph.gv_entrypoint, graph.inputargs_gv[:]
def replay(self, label):
- print 'Replay!'
- raise NotImplementedError
+ return ReplayBuilder(self), [dummy_var] * len(label.inputargs_gv)
class GraphInfo:
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_gencli_interpreter.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_gencli_interpreter.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_gencli_interpreter.py Mon Oct 6 18:01:07 2008
@@ -89,7 +89,7 @@
check_count_depth = False # see test_self_referential_structures
def test_known_nonzero(self):
- py.test.skip("replay: NotImplementedError")
+ py.test.skip("something wrong with promotion")
def test_debug_assert_ptr_nonzero(self):
py.test.skip("replay: NotImplementedError")
More information about the Pypy-commit
mailing list