Using InterpreterOopMap
Peter Helfer
peter.helfer.java at gmail.com
Tue Dec 4 07:04:41 PST 2007
2007/12/4, steve goldman <Steve.Goldman at sun.com>:
>
> Peter Helfer wrote:
> > Ok, right now I'm seeing some progress in my project, so I want to be
> able
> > to go through the Oops in a interpreter frame, using InterpreterOopMap
> and
> > my own closure (which essentially should duplicate the existing object
> and
> > replace the original at that position)
> >
> > I copied the code over from frame.cpp / oops_interpreted_do , and here
> is my
> > question:
> >
> > Which oops does the iterate_oop touch ?
> > I assume at least the expression stack, locals, but what about the other
>
> expression stack and locals.
ok, thought so, its just not easy to see through the whol
generateOopMap-thing...
> fields in the interpreter frame, like methodOop, methodData, cpCacheOop ?
>
> All of the oops in an interpreter frame that are known up front like
> methodOop, etc. are handled by the code like:
>
> f->do_oop((oop*)interpreter_frame_method_addr());
>
> the oopmap is only used to find oops that are dependent on the
> particular bci.
>
>
> > What would happen if nullified these fields before, does the iterator go
> > through anyway, or does it do a null check, i.e. can I assume that all
> > OopClosure.do_oop(oop* p) calls are given a valid oop p, pointing to a
> valid
> > oop ?
>
> NULLs are valid oops. p is a pointer to an oop, not an oop, so it should
> never be NULL though what it points to could well be NULL.
Ok, so this error shows that I am doing something nasty somewhere... and the
klass field of the oop is not anymore valid...
BTW, is there a method which verifies the oop in C as it is done in
verifyOop(Register) ?
#13 0x0644d708 in JVM_handle_linux_signal () at
/home/peterh/workspace/openjdk/hotspot/src/os_cpu/linux_i486/vm/os_linux_i486.cpp:461
#14 0x06447c8d in signalHandler (sig=11, info=0xad7259dc, uc=0xad725a5c) at
/home/peterh/workspace/openjdk/hotspot/src/os/linux/vm/os_linux.cpp:3002
#15 <signal handler called>
#16 0x0611c292 in Klass::oop_is_instance () at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/oops/klass.hpp:599
#17 0x0611c2ff in oopDesc::is_instance () at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/oops/oop.inline.hpp:58
#18 0x064bbf60 in SpeculationReplaceClosure::do_oop () at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/runtime/speculation.cpp:562
#19 0x064c0f4a in MyInterpreterFrameClosure::offset_do () at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/runtime/thread.hpp:1420
#20 0x0643ef77 in InterpreterOopMap::iterate_oop (this=0xad725e70,
oop_closure=0xad725e94)
at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/interpreter/oopMapCache.cpp:222
#21 0x064bc807 in Speculation::interpFrameAdaptSP (thread=0x8103c00,
rsp=0xad725f70, rbp=0xad725f9c, pc=0xb5b757ff "\213eøÇEø")
at
/home/peterh/workspace/openjdk/hotspot/src/share/vm/runtime/speculation.cpp:806
caused by this code:
void SpeculationReplaceClosure::do_oop(oop* p){
#define PRINT_PROP(name) tty->print_cr("is_" #name ":\t%s",(*p)->is_
## name() ? "true" : "false")
assert(!SafepointSynchronize::is_at_safepoint(), "invariant") ;
if(p != NULL && (*p) != NULL){
tty->print("SpecReplaceClosure: ref %08X:\n", p);
if((*p)->is_instance() ||
(*p)->is_instanceRef() ||
(*p)->is_array() ||
(*p)->is_objArray()){
PRINT_PROP(instance);
PRINT_PROP(instanceRef);
PRINT_PROP(array);
PRINT_PROP(objArray);
}
else {
PRINT_PROP(klass);
PRINT_PROP(thread);
PRINT_PROP(method);
PRINT_PROP(constMethod);
PRINT_PROP(methodData);
PRINT_PROP(constantPool);
PRINT_PROP(typeArray);
PRINT_PROP(symbol);
PRINT_PROP(javaArray);
PRINT_PROP(compiledICHolder);
}
} else {
tty->print("SpecReplaceClosure: INVALID OOP AT %08X POINTING
TO %08X :\n", p, *p);
}
#undef PRINT_PROP
}
Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20071204/39f4466c/attachment.html
More information about the hotspot-runtime-dev
mailing list