[pypy-svn] r65043 - in pypy/branch/pyjitpl5/pypy/jit/backend/cli: . test
antocuni at codespeak.net
antocuni at codespeak.net
Mon May 4 23:45:55 CEST 2009
Author: antocuni
Date: Mon May 4 23:45:55 2009
New Revision: 65043
Modified:
pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py
pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py
pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_basic.py
Log:
bah, start implementing emit_op_new_with_vtable, but need to stop again because it can't work without translation
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py Mon May 4 23:45:55 2009
@@ -5,7 +5,8 @@
from pypy.translator.cli.dotnet import CLR
from pypy.translator.cli import opcodes
from pypy.jit.metainterp import history
-from pypy.jit.metainterp.history import AbstractValue, Const, ConstInt
+from pypy.jit.metainterp.history import (AbstractValue, Const, ConstInt,
+ ConstObj)
from pypy.jit.metainterp.resoperation import rop, opname
from pypy.jit.backend.cli.methodfactory import get_method_wrapper
@@ -310,6 +311,11 @@
target.inputargs[i].store(self)
self.il.Emit(OpCodes.Br, self.il_loop_start)
+ def emit_op_new_with_vtable(self, op):
+ assert isinstance(op.args[0], ConstObj)
+ cls = ootype.cast_from_object(ootype.Class, op.args[0].getobj())
+ raise NotImplementedError # XXX finish me
+
def emit_op_call(self, op):
raise NotImplementedError
@@ -337,7 +343,6 @@
emit_op_arraylen_gc = not_implemented
emit_op_unicodesetitem = not_implemented
emit_op_getfield_raw_pure = not_implemented
- emit_op_new_with_vtable = not_implemented
emit_op_getfield_gc_pure = not_implemented
emit_op_getarrayitem_gc = not_implemented
emit_op_getfield_gc = not_implemented
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py Mon May 4 23:45:55 2009
@@ -5,7 +5,7 @@
from pypy.jit.metainterp.resoperation import rop, opname
from pypy.jit.backend import model
from pypy.jit.backend.minimal.runner import cached_method
-from pypy.jit.backend.llgraph.runner import TypeDescr
+from pypy.jit.backend.llgraph.runner import TypeDescr, FieldDescr
from pypy.jit.backend.cli.method import Method
from pypy.translator.cli import dotnet
from pypy.translator.cli.dotnet import CLR
@@ -39,6 +39,10 @@
def typedescrof(self, TYPE):
return TypeDescr(TYPE)
+ @cached_method('_fieldcache')
+ def fielddescrof(self, T, fieldname):
+ return FieldDescr(T, fieldname)
+
# ----------------------
def compile_operations(self, loop):
@@ -64,6 +68,19 @@
# ----------------------
+ def do_new_with_vtable(self, args, typedescr):
+ assert isinstance(typedescr, TypeDescr)
+ assert len(args) == 1 # but we don't need it, so ignore
+ return typedescr.create()
+
+ def do_getfield_gc(self, args, fielddescr):
+ assert isinstance(fielddescr, FieldDescr)
+ return fielddescr.getfield(args[0])
+
+ def do_setfield_gc(self, args, fielddescr):
+ assert isinstance(fielddescr, FieldDescr)
+ return fielddescr.setfield(args[0], args[1])
+
def do_call(self, args, calldescr):
assert isinstance(calldescr, StaticMethDescr)
funcbox, args = args[0], args[1:]
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_basic.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_basic.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_basic.py Mon May 4 23:45:55 2009
@@ -16,11 +16,11 @@
py.test.skip("in-progress")
test_string = skip
+ test_chr2str = skip
+ test_unicode = skip
+ test_residual_call = skip
+ test_constant_across_mp = skip
- test_chr2str = _skip
- test_unicode = _skip
- test_residual_call = _skip
- test_constant_across_mp = _skip
test_stopatxpolicy = _skip
test_we_are_jitted = _skip
test_format = _skip
More information about the Pypy-commit
mailing list