--- old/src/share/vm/runtime/frame.cpp 2015-09-14 23:13:37.000000000 -0700 +++ new/src/share/vm/runtime/frame.cpp 2015-09-14 23:13:37.000000000 -0700 @@ -1111,104 +1111,6 @@ } } -# ifdef ENABLE_ZAP_DEAD_LOCALS - -void frame::CheckValueClosure::do_oop(oop* p) { - if (CheckOopishValues && Universe::heap()->is_in_reserved(*p)) { - warning("value @ " INTPTR_FORMAT " looks oopish (" INTPTR_FORMAT ") (thread = " INTPTR_FORMAT ")", p, (address)*p, Thread::current()); - } -} -frame::CheckValueClosure frame::_check_value; - - -void frame::CheckOopClosure::do_oop(oop* p) { - if (*p != NULL && !(*p)->is_oop()) { - warning("value @ " INTPTR_FORMAT " should be an oop (" INTPTR_FORMAT ") (thread = " INTPTR_FORMAT ")", p, (address)*p, Thread::current()); - } -} -frame::CheckOopClosure frame::_check_oop; - -void frame::check_derived_oop(oop* base, oop* derived) { - _check_oop.do_oop(base); -} - - -void frame::ZapDeadClosure::do_oop(oop* p) { - if (TraceZapDeadLocals) tty->print_cr("zapping @ " INTPTR_FORMAT " containing " INTPTR_FORMAT, p, (address)*p); - *p = cast_to_oop(0xbabebabe); -} -frame::ZapDeadClosure frame::_zap_dead; - -void frame::zap_dead_locals(JavaThread* thread, const RegisterMap* map) { - assert(thread == Thread::current(), "need to synchronize to do this to another thread"); - // Tracing - part 1 - if (TraceZapDeadLocals) { - ResourceMark rm(thread); - tty->print_cr("--------------------------------------------------------------------------------"); - tty->print("Zapping dead locals in "); - print_on(tty); - tty->cr(); - } - // Zapping - if (is_entry_frame ()) zap_dead_entry_locals (thread, map); - else if (is_interpreted_frame()) zap_dead_interpreted_locals(thread, map); - else if (is_compiled_frame()) zap_dead_compiled_locals (thread, map); - - else - // could be is_runtime_frame - // so remove error: ShouldNotReachHere(); - ; - // Tracing - part 2 - if (TraceZapDeadLocals) { - tty->cr(); - } -} - - -void frame::zap_dead_interpreted_locals(JavaThread *thread, const RegisterMap* map) { - // get current interpreter 'pc' - assert(is_interpreted_frame(), "Not an interpreted frame"); - Method* m = interpreter_frame_method(); - int bci = interpreter_frame_bci(); - - int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals(); - - // process dynamic part - InterpreterFrameClosure value_blk(this, max_locals, m->max_stack(), - &_check_value); - InterpreterFrameClosure oop_blk(this, max_locals, m->max_stack(), - &_check_oop ); - InterpreterFrameClosure dead_blk(this, max_locals, m->max_stack(), - &_zap_dead ); - - // get frame map - InterpreterOopMap mask; - m->mask_for(bci, &mask); - mask.iterate_all( &oop_blk, &value_blk, &dead_blk); -} - - -void frame::zap_dead_compiled_locals(JavaThread* thread, const RegisterMap* reg_map) { - - ResourceMark rm(thread); - assert(_cb != NULL, "sanity check"); - if (_cb->oop_maps() != NULL) { - OopMapSet::all_do(this, reg_map, &_check_oop, check_derived_oop, &_check_value); - } -} - - -void frame::zap_dead_entry_locals(JavaThread*, const RegisterMap*) { - if (TraceZapDeadLocals) warning("frame::zap_dead_entry_locals unimplemented"); -} - - -void frame::zap_dead_deoptimized_locals(JavaThread*, const RegisterMap*) { - if (TraceZapDeadLocals) warning("frame::zap_dead_deoptimized_locals unimplemented"); -} - -# endif // ENABLE_ZAP_DEAD_LOCALS - void frame::verify(const RegisterMap* map) { // for now make sure receiver type is correct if (is_interpreted_frame()) {