Code generation

Peter Helfer peter.helfer.java at gmail.com
Wed Nov 7 15:03:43 PST 2007


Hi all!

After solving the thread-thing finally, i'm off to testing of my
generated code.. after I figured out that I need to commit a
CodeBuffer into a CodeBlob, I thought a RuntimeStub would match my
needs; however to generate the RuntimeStub, I need to know the
frame_complete as well as the frame size, and the OopMapSet for this
'static constructor':

static RuntimeStub* new_runtime_stub(
    const char* stub_name,
    CodeBuffer* cb,
    int         frame_complete,
    int         frame_size,
    OopMapSet*  oop_maps,
    bool        caller_must_gc_arguments
  );

- when using it with a CodeBuffer generated before; and return
stub->entry_point(), is that thing completely working, i.e. I dont
have to care about, where it is allocated (does this go into a
CodeCache ?), and about any relocations ? I just had some assertion
problems with the relocs -- is there anything special to look for when
generating code ?

- the frame_complete is the offset of the code to the point, where
this frame is at its maximum size, without arguments for the next
invocation ?

- the OopMapSet (my usual friend) - I am still missing that kind of
good explanation for the OopMaps, and how to use them properly...
especially that part here:

OopMap* map =  new OopMap(framesize, 0);
oop_maps->add_gc_map(__ pc() - start, map);
// this means that 0 oops have to be handled specially in this part, right ?

Now lets assume I really wanted to put some Oops in my frame, I would
want to use
map->set_oop( VMReg local); - this VMReg can be used to depict either
a real register or a location on stack, right ?

enum {
   my_second_oop
   my_first_oop
   rbp
   return_pc
   framesize
}

could be a fictious frame layout; now how do I tell OopMap to include
my_first_oop and my_second_oop ?


thanks, Peter



More information about the hotspot-runtime-dev mailing list