Source

pypy / pypy / translator / jvm / metavm.py

Author Commit Message Labels Comments Date
Michał Bendowski
Add a missing cast from Unsigned to UnsignedLongLong in the JVM backend.
Branches
jvm-improvements
Antonio Cuni
teach the jvm backend how to cast between signed and unsigned
Antonio Cuni
do nothing if we are trying to cast something into the very same type
Antonio Cuni
implement cast_uint_to_longlong for the jvm
Antonio Cuni
add support for SHORT type, and for force_cast
Amaury Forgeot d'Arc
Fix --backend=jvm translation I'm not sure about the SignedLongLong->UnsignedLongLong cast, though.
nikomatsakis
(niko, arigo and antocuni looking) merge fixed-list-ootype-2 branch to trunk, introducing a different ootype type for lists that are not resized after they are created.
nikomatsakis
rework the way that comparisons work in the JVM backend: we now detect when the branch depends on a boolean variable defined by the last instruction, and try to inline the comparison. Since the jvm doesn't have opcodes to load the result of a comparison onto the stack, this means that instead of generating code for "if (x<y) f1 else f2" like if (x < y) b = 1; else b = 0; if (b) goto l1; else goto l2; we generate if (x < y) goto l1; else goto l2; which is much shorter and easier to read.
nikomatsakis
fix two bugs in JVM backend: * llshl takes a long, not an int, for # of bits to shift * rejigger exc. handling so we translate from CLI exceptions in the catch block rather than at the site they are thrown. This allows us to handle StackOverflow and (in theory) OutOfMemory exceptions.
Armin Rigo
Kill HalfConcreteWrapper. Yay! It was still (ab)used by the ootypesystem implementation of r_dict. I think I fixed the cli and jvm backends too.
nikomatsakis
Refactor so that we can support multiple interpreters simultaneously. Instead of storing the interlink interface in a static field of PyPy.java, we now create a new instance of PyPy.java which has a custom interlink, and then dispatch to that as needed. This means that different PyPy interpters can each have their own PyPy instance customized to their specific interlink class.
nikomatsakis
implement new-style weakrefs in the jvm
Armin Rigo
(cfbolz, arigo) merge the cleanup-weakref branch. Weakrefs are now malloced objects on their own, and the ll code manipulates (regular) pointers to such objects.
Antonio Cuni
if we are calling a builtin method, we can't drop Void values
Antonio Cuni
take care of void arguments
Antonio Cuni
implement cast_primitive for jvm
nikomatsakis
implement weak refs for genjvm; refactor test_objectmodel from cli into oosupport
nikomatsakis
Implement custom dicts (rdicts) in the JVM backend. All tests in objectmodel now pass. The technique is to find all functions which could be used as hashCode() or equals() functions, and to make any static functions that are defined implement either pypy.Equals or pypy.HashCode, then allowing them to be passed to pypy.CustomDict.
nikomatsakis
Add the code needed for java code to throw exceptions. We generate an instance of the Interlink interface which has the various methods required, and assign it to a static variable in the PyPy class. This has the downside of only allowing one concurrent PyPy interpreter: we could use thread-local data instead (or pass the object as a parameter, but that would be more of a pain).
nikomatsakis
(antocuni,niko) fix a variety of errors in test_list
nikomatsakis
(antocuni, niko) progress towards test_pbc working: implemented lists, toString(), generic support, and some other stuff
nikomatsakis
(niko, antocuni) fix all of test_class.py for the jvm backend