8040085: dtrace/jsdt tests crash on solaris. found an unadvertised bad scavengable oop in the code cache

Mon, 28 Apr 2014 12:39:12 +0200

author
anoll
date
Mon, 28 Apr 2014 12:39:12 +0200
changeset 6658
e0a77b91da68
parent 6657
3636afd5ec1a
child 6659
34862ced4a87

8040085: dtrace/jsdt tests crash on solaris. found an unadvertised bad scavengable oop in the code cache
Summary: Add CodeCache::add_scavenge_root_nmethod(this) to the dtrace-constructor of nmethod
Reviewed-by: roland, iveresov

src/share/vm/code/nmethod.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/sharedRuntime.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/code/nmethod.cpp	Fri May 02 16:44:54 2014 -0700
     1.2 +++ b/src/share/vm/code/nmethod.cpp	Mon Apr 28 12:39:12 2014 +0200
     1.3 @@ -771,7 +771,11 @@
     1.4      _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
     1.5  
     1.6      code_buffer->copy_values_to(this);
     1.7 -    debug_only(verify_scavenge_root_oops());
     1.8 +    if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
     1.9 +      CodeCache::add_scavenge_root_nmethod(this);
    1.10 +      Universe::heap()->register_nmethod(this);
    1.11 +    }
    1.12 +    DEBUG_ONLY(verify_scavenge_root_oops();)
    1.13      CodeCache::commit(this);
    1.14    }
    1.15  
     2.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Fri May 02 16:44:54 2014 -0700
     2.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Mon Apr 28 12:39:12 2014 +0200
     2.3 @@ -2690,19 +2690,20 @@
     2.4  JRT_END
     2.5  
     2.6  #ifdef HAVE_DTRACE_H
     2.7 -// Create a dtrace nmethod for this method.  The wrapper converts the
     2.8 -// java compiled calling convention to the native convention, makes a dummy call
     2.9 -// (actually nops for the size of the call instruction, which become a trap if
    2.10 -// probe is enabled). The returns to the caller. Since this all looks like a
    2.11 -// leaf no thread transition is needed.
    2.12 -
    2.13 +/**
    2.14 + * Create a dtrace nmethod for this method.  The wrapper converts the
    2.15 + * Java-compiled calling convention to the native convention, makes a dummy call
    2.16 + * (actually nops for the size of the call instruction, which become a trap if
    2.17 + * probe is enabled), and finally returns to the caller. Since this all looks like a
    2.18 + * leaf, no thread transition is needed.
    2.19 + */
    2.20  nmethod *AdapterHandlerLibrary::create_dtrace_nmethod(methodHandle method) {
    2.21    ResourceMark rm;
    2.22    nmethod* nm = NULL;
    2.23  
    2.24    if (PrintCompilation) {
    2.25      ttyLocker ttyl;
    2.26 -    tty->print("---   n%s  ");
    2.27 +    tty->print("---   n  ");
    2.28      method->print_short_name(tty);
    2.29      if (method->is_static()) {
    2.30        tty->print(" (static)");

mercurial