--- old/src/share/vm/gc/g1/g1MarkSweep.cpp 2017-04-24 15:48:54.364844603 +0200 +++ new/src/share/vm/gc/g1/g1MarkSweep.cpp 2017-04-24 15:48:54.220838942 +0200 @@ -217,7 +217,7 @@ // We must adjust the pointers on the single H object. oop obj = oop(r->bottom()); // point all the oops to the new location - obj->oop_iterate(&MarkSweep::adjust_pointer_closure); + MarkSweep::adjust_pointers(obj); } } else if (!r->is_pinned()) { // This really ought to be "as_CompactibleSpace"... --- old/src/share/vm/gc/parallel/psMarkSweepDecorator.cpp 2017-04-24 15:48:54.972868503 +0200 +++ new/src/share/vm/gc/parallel/psMarkSweepDecorator.cpp 2017-04-24 15:48:54.832863000 +0200 @@ -284,7 +284,7 @@ while (q < end) { // point all the oops to the new location - size_t size = oop(q)->oop_iterate_size(&MarkSweep::adjust_pointer_closure); + size_t size = MarkSweep::adjust_pointers(oop(q)); q += size; } @@ -304,7 +304,7 @@ if (oop(q)->is_gc_marked()) { // q is alive // point all the oops to the new location - size_t size = oop(q)->oop_iterate_size(&MarkSweep::adjust_pointer_closure); + size_t size = MarkSweep::adjust_pointers(oop(q)); debug_only(prev_q = q); q += size; } else { --- old/src/share/vm/gc/serial/markSweep.cpp 2017-04-24 15:48:55.588892718 +0200 +++ new/src/share/vm/gc/serial/markSweep.cpp 2017-04-24 15:48:55.448887214 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/gc/serial/markSweep.hpp 2017-04-24 15:48:56.252918819 +0200 +++ new/src/share/vm/gc/serial/markSweep.hpp 2017-04-24 15:48:56.080912058 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,6 +144,8 @@ static void adjust_marks(); // Adjust the pointers in the preserved marks table static void restore_marks(); // Restore the marks that we saved in preserve_mark + static int adjust_pointers(oop obj); + static void follow_stack(); // Empty marking stack. static void follow_klass(Klass* klass); --- old/src/share/vm/gc/serial/markSweep.inline.hpp 2017-04-24 15:48:56.924945236 +0200 +++ new/src/share/vm/gc/serial/markSweep.inline.hpp 2017-04-24 15:48:56.780939575 +0200 @@ -41,6 +41,10 @@ #endif } +inline int MarkSweep::adjust_pointers(oop obj) { + return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure); +} + template inline void MarkSweep::adjust_pointer(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { --- old/src/share/vm/gc/shared/space.inline.hpp 2017-04-24 15:48:57.608972123 +0200 +++ new/src/share/vm/gc/shared/space.inline.hpp 2017-04-24 15:48:57.464966463 +0200 @@ -232,7 +232,7 @@ if (cur_obj < first_dead || oop(cur_obj)->is_gc_marked()) { // cur_obj is alive // point all the oops to the new location - size_t size = oop(cur_obj)->oop_iterate_size(&MarkSweep::adjust_pointer_closure); + size_t size = MarkSweep::adjust_pointers(oop(cur_obj)); size = space->adjust_obj_size(size); debug_only(prev_obj = cur_obj); cur_obj += size; --- old/src/share/vm/gc/shared/specialized_oop_closures.hpp 2017-04-24 15:48:58.224996338 +0200 +++ new/src/share/vm/gc/shared/specialized_oop_closures.hpp 2017-04-24 15:48:58.068990206 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,7 @@ #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f) \ f(MarkAndPushClosure,_nv) \ - f(AdjustPointerClosure, _nv) + f(AdjustPointerClosure,_nv) #if INCLUDE_ALL_GCS #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \ --- old/src/share/vm/memory/iterator.hpp 2017-04-24 15:48:58.865021497 +0200 +++ new/src/share/vm/memory/iterator.hpp 2017-04-24 15:48:58.717015679 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ // the below enum describes the different alternatives. enum ReferenceIterationMode { DO_DISCOVERY, // Tries to discover references - DO_FIELDS // No discovery, just apply closure to all fields + DO_FIELDS // Apply closure to all fields }; // The current default iteration mode is to do discovery. --- old/src/share/vm/oops/instanceClassLoaderKlass.hpp 2017-04-24 15:48:59.461044925 +0200 +++ new/src/share/vm/oops/instanceClassLoaderKlass.hpp 2017-04-24 15:48:59.325039579 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/oops/instanceRefKlass.hpp 2017-04-24 15:49:00.009066467 +0200 +++ new/src/share/vm/oops/instanceRefKlass.hpp 2017-04-24 15:48:59.885061592 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,8 +50,6 @@ class InstanceRefKlass: public InstanceKlass { friend class InstanceKlass; - template - friend class InstanceRefKlassSpecialized; private: InstanceRefKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_reference) {} @@ -120,19 +118,17 @@ template static bool try_discover(oop obj, ReferenceType type, OopClosureType* closure); - // Default way of handling instance ref klasses, does reference - // processing if a ReferenceProcessor has been supplied. + // Do discovery while handling instance ref klasses, does reference + // processing only if a ReferenceProcessor has been supplied. template static void oop_oop_iterate_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains); - // Just handle the fields, don't care about reference processing. + // Handle the fields, don't care about reference processing. template static void oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains); -#ifdef ASSERT template - static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr); -#endif + static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr) NOT_DEBUG_RETURN; public: --- old/src/share/vm/oops/instanceRefKlass.inline.hpp 2017-04-24 15:49:00.589089267 +0200 +++ new/src/share/vm/oops/instanceRefKlass.inline.hpp 2017-04-24 15:49:00.445083606 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ template void InstanceRefKlass::oop_oop_iterate_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) { - log_develop_trace(gc, ref)("Process reference default " PTR_FORMAT, p2i(obj)); + log_develop_trace(gc, ref)("Process reference with discovery " PTR_FORMAT, p2i(obj)); // Special case for some closures. if (closure->apply_to_weak_ref_discovered_field()) { @@ -108,11 +108,11 @@ do_referent(obj, closure, contains); do_discovered(obj, closure, contains); do_next(obj, closure, contains); - debug_only(trace_reference_gc("InstanceRefKlass::oop_oop_iterate_fields()", - obj, - (T*)java_lang_ref_Reference::referent_addr(obj), - (T*)java_lang_ref_Reference::next_addr(obj), - (T*)java_lang_ref_Reference::discovered_addr(obj));) + trace_reference_gc("InstanceRefKlass::oop_oop_iterate_fields()", + obj, + (T*)java_lang_ref_Reference::referent_addr(obj), + (T*)java_lang_ref_Reference::next_addr(obj), + (T*)java_lang_ref_Reference::discovered_addr(obj)); } template --- old/src/share/vm/oops/klass.hpp 2017-04-24 15:49:01.157111595 +0200 +++ new/src/share/vm/oops/klass.hpp 2017-04-24 15:49:01.009105777 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/oops/oop.hpp 2017-04-24 15:49:01.789136438 +0200 +++ new/src/share/vm/oops/oop.hpp 2017-04-24 15:49:01.637130463 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/oops/oop.inline.hpp 2017-04-24 15:49:02.397160339 +0200 +++ new/src/share/vm/oops/oop.inline.hpp 2017-04-24 15:49:02.249154521 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it --- old/src/share/vm/oops/typeArrayKlass.hpp 2017-04-24 15:49:03.053186126 +0200 +++ new/src/share/vm/oops/typeArrayKlass.hpp 2017-04-24 15:49:02.909180465 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it