class / function call behaviour (Jython vs. CPython)

Hello,

lately I have been trying to fix a problem of the different
behaviour of CPython and Jython.
At the moment Jython represents several calls to classes
as function calls.

I had to introduce some ugly changes to PyFrame.java,
PySystemState.java, Py.java and imp.java,
having to hook in between the call of the import statement and properly
setting f_locals and f_globals.
This worked so far to pass several unit tests for Zope, but is not the
right solution.

There is real need to fix this issue and I am looking for help
to get some hints on where to look at the Jython code (asm branch).
(TreeBuilder, CodeVisitor, ScopesCompiler, other compiler parts?
CodeReader?)

Here is some output of CPython 2.5 and Jython svn asm branch r4826:

gebe <at> venus:~/work/crash$ python test.py 
class
********************
f_locals:  {'__module__': '__main__', 'classLevelFrameInfo': ('class',
<module '__main__' from 'test.py'>, {...}, {'kind': 'class',
'f_globals': {...}, 'frameInfo': <function frameInfo at 0xb7d2ad84>,
'__builtins__': <module '__builtin__' (built-in)>, 'ClassType': <type
'classobj'>, '__file__': 'test.py', 'module': <module '__main__' from
'test.py'>, 'f_locals': {...}, 'sys': <module 'sys' (built-in)>,
(Continue reading)


Gmane