[pypy-issue] Issue #1817: RPython should support multiple frame vref types? (pypy/pypy)

Edd Barrett issues-reply at bitbucket.org
Mon Jul 14 11:14:42 CEST 2014


New issue 1817: RPython should support multiple frame vref types?
https://bitbucket.org/pypy/pypy/issue/1817/rpython-should-support-multiple-frame-vref

Edd Barrett:

Hi,

In the pypy bridge, I've had ti disable vrefs in at least one of the two interpreters to avoid the following error:

```
[translation:ERROR] UnionError:
[translation:ERROR]
[translation:ERROR] RPython cannot unify instances with no common base class
[translation:ERROR]
[translation:ERROR] Offending annotations:
[translation:ERROR]   SomeInstance(can_be_None=False, classdef=pypy.objspace.std
.frame.StdObjSpaceFrame)
[translation:ERROR]   SomeInstance(can_be_None=False, classdef=hippy.frame.Frame
)
[translation:ERROR]
[translation:ERROR]
[translation:ERROR] Occurred processing the following simple_call:
[translation:ERROR]       (KeyError getting at the binding!)
[translation:ERROR]     v1101 = simple_call((function virtual_ref), frame_0)
[translation:ERROR]
[translation:ERROR] In <FunctionGraph of (hippy.interpreter:899)Interpreter.ente
r at 0x69844758>:
[translation:ERROR] Happened at file hippy/interpreter.py line 901
[translation:ERROR]
[translation:ERROR]             frame.f_backref = self.topframeref
[translation:ERROR] ==>         self.topframeref = jit.virtual_ref(frame)
[translation:ERROR]             #self.topframeref = jit.non_virtual_ref(frame)
[translation:ERROR]             if self.debugger is not None:
[translation:ERROR]
[translation:ERROR] Known variable annotations:
[translation:ERROR]  frame_0 = SomeInstance(can_be_None=False, classdef=hippy.fr
ame.Frame)
[translation:ERROR]
[translation:ERROR] Processing block:
[translation:ERROR]  block at 3 is a <class 'rpython.flowspace.flowcontext.SpamBloc
k'>
[translation:ERROR]  in (hippy.interpreter:899)Interpreter.enter
[translation:ERROR]  containing the following operations:
[translation:ERROR]        v1102 = getattr(self_139, ('topframeref'))
[translation:ERROR]        v1103 = setattr(frame_0, ('f_backref'), v1102)
[translation:ERROR]        v1101 = simple_call((function virtual_ref), frame_0)
[translation:ERROR]        v1104 = setattr(self_139, ('topframeref'), v1101)
[translation:ERROR]        v1105 = getattr(self_139, ('debugger'))
[translation:ERROR]        v1106 = is_(v1105, (None))
[translation:ERROR]        v1107 = bool(v1106)
[translation:ERROR]  --end--
```

So basically, a hippy frame and a pypy frame cannot be unioned. There are two possible fixes:

 * Provide some base abstract frame type and force VM implementers to use it.
 * Allow RPython to support multiple frame types for vrefs.

I don't feel qualified to comment further. What do the pypy devs think?




More information about the pypy-issue mailing list