1 Apr 2007 07:48
Re: Towards pypy-jvm
Niko Matsakis <niko <at> alum.mit.edu>
2007-04-01 05:48:39 GMT
2007-04-01 05:48:39 GMT
> The last time I checked what java's Hasttable offers and I saw you > can't pass to it custom hashing and equality functions, but maybe > there is a simple way to do it that I don't know. No, there isn't, but it shouldn't be too hard to cook up some kind of Hashtable substitute that uses small wrapper classes to handle that. I think that's what you did for C#, right? Niko _______________________________________________ pypy-dev <at> codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev
Most of r_dict tests are in test_objectmodel, though you may want to
have also a look at rpython/test/test_rconstantdict.
About the distinction between r_dict and "custom dict": do you find any
place where they are used interchangeably?
I would say that r_dict referes so the rpython-level type
(objectmodel.r_dict), while "custom dict" should refer to the low level
type used by the rtyper (ootype.CustomDict). Also, probably CustomDict
would be a better name than RDict for your java class, I guess.
> guess I'll look at weakrefs next, though no promises as to when that
> will be. :)
Adding weakrefs to gencli was very simple: I just needed to map
lltypesystem.llmemory.WeakGcAddress to 'System.WeakReference', add the
straightforward support for constants to cli/constant.py and add the
also straightforward 'cast_ptr_to_weakadr' and 'cast_weakadr_to_ptr'
operations in opcodes.py.
I don't know for jvm, but I guess it would not be much more complicate.
ciao Anto
_______________________________________________
pypy-dev <at> codespeak.net
RSS Feed