How to add a native method in Unsafe class
Submitted by surfeit on Fri, 02/23/2007 - 11:29.
I know this is not recommended. But if I just want to do, How to? What step needed?
- Login to post comments
ask to Peter/(j)peda
few days ago, he added the System.nanoTime() function, which use native code.
Fabien
my blog (in english and french)
some remaining questions
After code review, I think I've got the main points, but has remaining some questions:
1. Is it enough to add a native method in Unsafe class and a corresponding entry in unsafe.asm? Should I modify other files?
2. GLABEL Q43org5jnode2vm6Unsafe23isKdbEnabled2e2829Z
what's the meaning of this statement? why use Q43org5xxx-like thing?
got it
After talk with peter, I've got the answers. I'd like to answer this questions as a note for future search:
2. GLABEL Q43org5jnode2vm6Unsafe23isKdbEnabled2e2829Z
what's the meaning of this statement? why use Q43org5xxx-like thing?
this is a mangled name.(The rule of mangling may be not important, mangling seem try to avoid "."in the asm' label)
See method VmMethod#getMangledName, VmSystemObject#mangle for mangling detail.
1. Is it enough to add a native method in Unsafe class and a corresponding entry in unsafe.asm? Should I modify other files?
yes, enough.
how to cotact with Peter
email address? It is hard to find the right person in IRC:)
thanks
I will check latest svn to see