You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Gregory Shimansky <gs...@gmail.com> on 2007/02/11 15:28:12 UTC

[drlvm][concurrent] HARMONY-2086 and how to implement private native AtomicLong.VMSupportsCS8 method

Hello

Today I tried to look into HARMONY-2086 patch. It adds implementation of 
private native method j.u.concurrent.atomic.AtomicLong.VMSupportsCS8 to 
DRLVM. But such patch IMHO doesn't fit into concept of kernel classes.

If a native method implementation is located in VM code, then Java class 
should be made kernel class, otherwise native code should go to classlib. The 
problem is that AFAIU we don't control the Java code of j.u.c because it is 
taken from an external repository, so we cannot create a kernel class which 
j.u.c.a.AtomicLong could use instead of a private native method.

Another way to fix this problem would be to add a native method implementation 
in classlib which would use VMI interface to query VM whether or not it 
supports CS8. But this requires extending VMI for this type of request and I 
am not sure if we can add native methods for j.u.c package in classlib.

Finally we could make a exception for this particular method and implement it 
in VM like the patch in HARMONY-2086 does.

What do you think about the choices?

-- 
Gregory