harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weldon Washburn" <weldon...@gmail.com>
Subject Re: [DRLVM] adding write barriers to Jitrino.JET
Date Fri, 02 Jun 2006 13:00:59 GMT
On 6/2/06, Ivan Volosyuk <ivan.volosyuk@gmail.com> wrote:
> I didn't look at the MMTk source, but IMHO the special translation of
> bytecodes is not nessasary in first stage. If the functionality
> implemented as methods which are handled specially in jikes, in
> interpreter they can be implemented as native methods. Anyway, I do
> not insist on the use of interpreter, just wanted to clarify this
> case.

Good observation.  It might be possible to do the following.  Write a
special version of the java files sitting in vmmagic that call new,
matching native methods that do the pointer manipulation.  No GC can
be allowed in these native methods.  Why?  Because these routines do
stuff like convert an int containing a raw pointer to an
ObjectReference containing a valid ref ptr.  It should be fairly
simple to hold off GC during execution of these natives.

AFIK, all the vmmagic classes implement the Uninterruptible interface.
 The interpreter would be modified to poll for GC between intrepreting
each bytecode.  If the current method implements the Uninterruptible
interface, polling for GC would be skipped.  Admittedly the above
would run slow.  Maybe too slow for even development purposes since
every pointer manipulation becomes a native method call.  Its tough to
call this one.

>
> As for the patch, you will at least find the places in VM code where
> missing write barriers should be added.
>
> Regards,
> --
> Ivan
>
> 2006/6/2, Weldon Washburn <weldonwjw@gmail.com>:
>
> > > 4. The http://issues.apache.org/jira/browse/HARMONY-504 patch has the
> > > corresponding VM and support for WB. In this patch, the interpreter also
> > > supports write barriers. So in theory, one should be able to bring up MMTk
> > > in interpreter mode even before modifying .Jet?
> >
> > After a closer look, I can give a definite "maybe" on this one.  In
> > practice it might end up being just as much or more work as bringing
> > up Jitrino.JET because a bunch of MMTK pointer manipulating classes
> > must somehow be translated via javac into bytecode patterns that
> > trigger the interpreter to bend the type safety rules and do stuff
> > like move an int into a ref ptr field.  Other approaches would be to
> > modify javac to generate unsafe code (yuk!)   We could also use  some
> > sort of automated bytecode editor to hack the bytecode stream -- maybe
> > use sed/awk/ruby/perl/forth.   The classes in question are located in
> > org.vmmagic.unboxed (I think).  Note that once you bring up the
> > interpreter, you still have to bring up the compilers.  While still to
> > early to call, using an interpreter approach is not promising.
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Weldon Washburn
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message