Request for review 8003635: NPG: AsynchGetCallTrace broken by Method* virtual call
David Holmes
david.holmes at oracle.com
Tue Nov 27 19:06:29 PST 2012
On 28/11/2012 12:34 PM, Daniel D. Daugherty wrote:
> src/share/vm/oops/method.cpp
> line 1820: if (this == NULL) {
> If "this" is NULL, then how did this non-static is_valid_method()
> function get called? Or is my brain confusing Java "this" versus
> C++ "this"?
ooh ooh! I know this one :)
I've had the same reaction a few times myself. So in C++ a non-virtual
method invocation:
o->is_valid_method()
is actually a call:
is_valid_method(o);
Hence you can execute the method and examine o (the this pointer) to see
if it is NULL, inside the method. We actually have an is_null() method
that does that instead of doing the check at the call site.
David
-----
> lines 1825-1828: vtable pointer matching? The skeptic in me wonders
> how portable such a construct is across various C++ compilers.
>
> line 1952: guarantee(md == NULL ||
> line 1953: md->is_metadata(), "should be in permspace");
> Not part of your change, but this mention of "permspace"
> caught my eye. I'm not caught on all the post-PGR terms,
> but is this the right word to use? The guarantee() on line
> 1950 says "should be metadata"...
>
> src/cpu/sparc/vm/frame_sparc.cpp
> line 651: if (!m->is_valid_method()) return false;
> In the post-PGR world, if this call to
> frame::is_interpreted_frame_valid() returns true, then the
> check on line 220 in forte.cpp is not necessary.
>
> src/cpu/x86/vm/frame_x86.cpp
> line 537: if (!m->is_valid_method()) return false;
> In the post-PGR world, if this call to
> frame::is_interpreted_frame_valid() returns true, then the
> check on line 220 in forte.cpp is not necessary.
>
> src/share/vm/prims/forte.cpp
> line 220: if (!method->is_valid_method()) return false;
> Methods can no longer move in the post-PGR world, right?
> If that's the case, then this check isn't needed since
> the frame was validated on line 199. However, the extra
> paranoia doesn't hurt.
More information about the hotspot-dev
mailing list