Interpreter calling a C method
Peter Helfer
peter.helfer.java at gmail.com
Tue Oct 9 08:15:25 PDT 2007
Hi all
I would like to call a C function in the interpreter when I invoke a new
method; I assume I have to change the TemplateTable::invokeZZZ, by inserting
some assembly instructions. I figured out the calls are finally done by
InterpreterMacroAssembler::jump_from_interpreted(Register method, Register
temp).
I thought I could use call_VM_leaf(CAST_FROM_FN_PTR(address,
SharedRuntime::do_funnymethod), 0) - but I get the error message
'InterpreterMacroAssembler::call_VM_leaf_base: last_sp != NULL'.
Now the questions..
a) how can I call a C method from the runtime-generated assembly without
destroying the current frame ?
b) how do I figure out which regs are used for what ? Do I have to go with
that OopMap and let it iterate over the frames ?
c) is there a definite 'calling convention guide' for Java ? I have found
some information dispersed in serveral places (ok, they are at least all in
the same folder) about the frame layout = stack layout, about some regs and
their usage
Thanks, Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20071009/85e6abee/attachment.html
More information about the hotspot-runtime-dev
mailing list