src/share/vm/runtime/frame.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/frame.cpp	Thu Nov 22 14:37:34 2012
--- new/src/share/vm/runtime/frame.cpp	Thu Nov 22 14:37:34 2012

*** 877,887 **** --- 877,888 ---- int size = asc.size(); return (oop *)interpreter_frame_tos_at(size); } ! void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) { ! void frame::oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f, + const RegisterMap* map, bool query_oop_map_cache) { assert(is_interpreted_frame(), "Not an interpreted frame"); assert(map != NULL, "map must be set"); Thread *thread = Thread::current(); methodHandle m (thread, interpreter_frame_method()); jint bci = interpreter_frame_bci();
*** 904,913 **** --- 905,924 ---- #endif current->oops_do(f); } // process fixed part + if (cld_f != NULL) { + // The method pointer in the frame might be the only path to the method's + // klass, and the klass needs to be kept alive while executing. The GCs + // don't trace through method pointers, so typically in similar situations + // the mirror or the class loader of the klass are installed as a GC root. + // To minimze the overhead of doing that here, we ask the GC to pass down a + // closure that knows have to keep klasses alive given a ClassLoaderData. + cld_f->do_cld(m->method_holder()->class_loader_data()); + } + #if !defined(PPC) || defined(ZERO) if (m->is_native()) { #ifdef CC_INTERP interpreterState istate = get_interpreterState(); f->do_oop((oop*)&istate->_oop_temp);
*** 1106,1125 **** --- 1117,1136 ---- // Traverse the Handle Block saved in the entry frame entry_frame_call_wrapper()->oops_do(f); } ! void frame::oops_do_internal(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) { #ifndef PRODUCT // simulate GC crash here to dump java thread in error report if (CrashGCForDumpingJavaThread) { char *t = NULL; *t = 'c'; } #endif if (is_interpreted_frame()) { ! oops_interpreted_do(f, cld_f, map, use_interpreter_oop_map_cache); } else if (is_entry_frame()) { oops_entry_do(f, map); } else if (CodeCache::contains(pc())) { oops_code_blob_do(f, cf, map); #ifdef SHARK
*** 1276,1286 **** --- 1287,1297 ---- oop* p = (oop*) interpreter_frame_local_at(0); // make sure we have the right receiver type } } COMPILER2_PRESENT(assert(DerivedPointerTable::is_empty(), "must be empty before verify");) ! oops_do_internal(&VerifyOopClosure::verify_oop, NULL, (RegisterMap*)map, false); ! oops_do_internal(&VerifyOopClosure::verify_oop, NULL, NULL, (RegisterMap*)map, false); } #ifdef ASSERT bool frame::verify_return_pc(address x) {

src/share/vm/runtime/frame.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File