Hello, and other things
Jason Fordham
Jason.Fordham at Sun.COM
Fri Feb 29 16:53:02 PST 2008
Hi all,
I was drawn into this list by the news today that Jonathan Schwartz was
interested in making the JVM into Just Another VM. Coincidentally (and
this is the spur to my enthusiasm), I started thinking about targeting
GCC for the JVM last week.
It quickly became clear that the JVM instruction set is designed to make
the C programming model difficult: the separation of bytecodes, stacks,
frames, and object space, and the generally unconvertible addressType
quickly led me to a model where the JVM stacks are ignored except for
primitive operations, while memory - for data, bss and heap - is modeled
in a large array. In order to model C's function calls by pointer, I
figured a handle pair, class and method, hashing the strings, with a
linking stage after compilation to perform fixup - much as I imagine
slide 17 in the LangNet presentation implies.
The key obstacles I see are that the instruction set makes implementing
a C-like stack expensive: there are no neat push and pop operations for
this memory model, it feels like microcoding. Though I understand the
motivation, which is to protect the bytecodes from malicious or lazy use
of buffer overflows, and other mechanisms for executing data.
I like the method handle mechanism, for a variety of reasons, and I
would like to see some easing up on where the a stack is located so that
operations which index into the stack are more flexible, and fast. Is
this possible?
Jason
More information about the mlvm-dev
mailing list