[pypy-svn] r73976 - pypy/branch/blackhole-improvement/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Thu Apr 22 15:57:09 CEST 2010


Author: arigo
Date: Thu Apr 22 15:57:07 2010
New Revision: 73976

Modified:
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py
Log:
Start to write one of the residual_call instructions.
Very incomplete.


Modified: pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py	Thu Apr 22 15:57:07 2010
@@ -91,10 +91,23 @@
                     next_argcode = next_argcode + 1
                     value = ord(code[position]) | (ord(code[position+1])<<8)
                     position += 2
+                elif argtype == 'I' or argtype == 'R' or argtype == 'F':
+                    assert argcodes[next_argcode] == argtype
+                    next_argcode = next_argcode + 1
+                    length = ord(code[position])
+                    position += 1
+                    value = []
+                    for i in range(length):
+                        index = ord(code[position+i])
+                        if   argtype == 'I': reg = self.registers_i[index]
+                        elif argtype == 'R': reg = self.registers_r[index]
+                        elif argtype == 'F': reg = self.registers_f[index]
+                        value.append(reg)
+                    position += length
                 elif argtype == 'pc':
                     value = position
                 else:
-                    raise AssertionError("bad argtype")
+                    raise AssertionError("bad argtype: %r" % (argtype,))
                 args += (value,)
             result = boundmethod(*args)
             if resulttype == 'i':
@@ -131,6 +144,7 @@
             pass
 
     # XXX must be specialized
+    # XXX the real performance impact of the following loop is unclear
     def copy_constants(self, registers, constants):
         """Copy jitcode.constants[0] to registers[255],
                 jitcode.constants[1] to registers[254],
@@ -184,3 +198,8 @@
     @arguments("L", returns="L")
     def opimpl_goto(self, target):
         return target
+
+    @arguments("i", "I", "R", returns="i")
+    def opimpl_residual_call_ir_i(self, function, args_i, args_r):
+        # XXX!
+        return function(*args_i)



More information about the Pypy-commit mailing list