--- old/src/hotspot/share/classfile/classListParser.cpp 2018-03-13 18:04:30.664797756 +0100 +++ new/src/hotspot/share/classfile/classListParser.cpp 2018-03-13 18:04:30.324800298 +0100 @@ -34,6 +34,7 @@ #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "runtime/fieldType.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "utilities/defaultStream.hpp" #include "utilities/hashtable.inline.hpp" --- old/src/hotspot/share/classfile/classLoaderData.cpp 2018-03-13 18:04:31.776789444 +0100 +++ new/src/hotspot/share/classfile/classLoaderData.cpp 2018-03-13 18:04:31.408792195 +0100 @@ -68,6 +68,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutex.hpp" --- old/src/hotspot/share/classfile/stringTable.cpp 2018-03-13 18:04:32.896781071 +0100 +++ new/src/hotspot/share/classfile/stringTable.cpp 2018-03-13 18:04:32.528783822 +0100 @@ -39,6 +39,7 @@ #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" #include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" #include "services/diagnosticCommand.hpp" #include "utilities/hashtable.inline.hpp" --- old/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-03-13 18:04:34.008772758 +0100 +++ new/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-03-13 18:04:33.648775449 +0100 @@ -49,6 +49,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" #include "runtime/mutexLocker.hpp" --- old/src/hotspot/share/classfile/verificationType.cpp 2018-03-13 18:04:35.296763130 +0100 +++ new/src/hotspot/share/classfile/verificationType.cpp 2018-03-13 18:04:34.948765731 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -27,6 +27,7 @@ #include "classfile/systemDictionaryShared.hpp" #include "classfile/verificationType.hpp" #include "classfile/verifier.hpp" +#include "runtime/handles.inline.hpp" VerificationType VerificationType::from_tag(u1 tag) { switch (tag) { --- old/src/hotspot/share/code/icBuffer.cpp 2018-03-13 18:04:36.500754129 +0100 +++ new/src/hotspot/share/code/icBuffer.cpp 2018-03-13 18:04:36.140756820 +0100 @@ -35,6 +35,7 @@ #include "memory/universe.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/stubRoutines.hpp" --- old/src/hotspot/share/code/location.cpp 2018-03-13 18:04:37.716745038 +0100 +++ new/src/hotspot/share/code/location.cpp 2018-03-13 18:04:37.368747640 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, 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 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "code/debugInfo.hpp" #include "code/location.hpp" +#include "runtime/handles.inline.hpp" void Location::print_on(outputStream* st) const { if(type() == invalid) { --- old/src/hotspot/share/compiler/oopMap.cpp 2018-03-13 18:04:38.952735798 +0100 +++ new/src/hotspot/share/compiler/oopMap.cpp 2018-03-13 18:04:38.660737980 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, 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 @@ -33,6 +33,7 @@ #include "memory/iterator.hpp" #include "memory/resourceArea.hpp" #include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/signature.hpp" #include "utilities/align.hpp" #ifdef COMPILER1 --- old/src/hotspot/share/memory/oopFactory.cpp 2018-03-13 18:04:40.072727424 +0100 +++ new/src/hotspot/share/memory/oopFactory.cpp 2018-03-13 18:04:39.744729876 +0100 @@ -36,6 +36,7 @@ #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" +#include "runtime/handles.inline.hpp" typeArrayOop oopFactory::new_charArray(const char* utf8_str, TRAPS) { --- old/src/hotspot/share/oops/arrayKlass.cpp 2018-03-13 18:04:41.084719858 +0100 +++ new/src/hotspot/share/oops/arrayKlass.cpp 2018-03-13 18:04:40.720722580 +0100 @@ -37,6 +37,7 @@ #include "oops/instanceKlass.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" int ArrayKlass::static_size(int header_size) { // size of an array klass object --- old/src/hotspot/share/oops/instanceKlass.cpp 2018-03-13 18:04:42.000713010 +0100 +++ new/src/hotspot/share/oops/instanceKlass.cpp 2018-03-13 18:04:41.668715493 +0100 @@ -1014,6 +1014,10 @@ return i; } +instanceHandle InstanceKlass::allocate_instance_handle(TRAPS) { + return instanceHandle(THREAD, allocate_instance(THREAD)); +} + void InstanceKlass::check_valid_for_instantiation(bool throwError, TRAPS) { if (is_interface() || is_abstract()) { ResourceMark rm(THREAD); --- old/src/hotspot/share/oops/instanceKlass.hpp 2018-03-13 18:04:43.020705385 +0100 +++ new/src/hotspot/share/oops/instanceKlass.hpp 2018-03-13 18:04:42.688707867 +0100 @@ -911,7 +911,7 @@ instanceOop allocate_instance(TRAPS); // additional member function to return a handle - instanceHandle allocate_instance_handle(TRAPS) { return instanceHandle(THREAD, allocate_instance(THREAD)); } + instanceHandle allocate_instance_handle(TRAPS); objArrayOop allocate_objArray(int n, int length, TRAPS); // Helper function --- old/src/hotspot/share/oops/klass.cpp 2018-03-13 18:04:43.968698297 +0100 +++ new/src/hotspot/share/oops/klass.cpp 2018-03-13 18:04:43.640700750 +0100 @@ -39,6 +39,7 @@ #include "oops/klass.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "trace/traceMacros.hpp" #include "utilities/macros.hpp" --- old/src/hotspot/share/runtime/handles.hpp 2018-03-13 18:04:44.960690881 +0100 +++ new/src/hotspot/share/runtime/handles.hpp 2018-03-13 18:04:44.632693333 +0100 @@ -72,7 +72,7 @@ public: // Constructors Handle() { _handle = NULL; } - Handle(Thread* thread, oop obj); + inline Handle(Thread* thread, oop obj); // General access oop operator () () const { return obj(); } @@ -108,9 +108,7 @@ public: \ /* Constructors */ \ type##Handle () : Handle() {} \ - type##Handle (Thread* thread, type##Oop obj) : Handle(thread, (oop)obj) { \ - assert(is_null() || ((oop)obj)->is_a(), "illegal type"); \ - } \ + inline type##Handle (Thread* thread, type##Oop obj); \ \ /* Operators for ease of use */ \ type##Oop operator () () const { return obj(); } \ --- old/src/hotspot/share/runtime/handles.inline.hpp 2018-03-13 18:04:46.252681221 +0100 +++ new/src/hotspot/share/runtime/handles.inline.hpp 2018-03-13 18:04:45.908683793 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, 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 @@ -40,6 +40,17 @@ } } +// Inline constructors for Specific Handles for different oop types +#define DEF_HANDLE_CONSTR(type, is_a) \ +inline type##Handle::type##Handle (Thread* thread, type##Oop obj) : Handle(thread, (oop)obj) { \ + assert(is_null() || ((oop)obj)->is_a(), "illegal type"); \ +} + +DEF_HANDLE_CONSTR(instance , is_instance_noinline ) +DEF_HANDLE_CONSTR(array , is_array_noinline ) +DEF_HANDLE_CONSTR(objArray , is_objArray_noinline ) +DEF_HANDLE_CONSTR(typeArray, is_typeArray_noinline) + // Constructor for metadata handles #define DEF_METADATA_HANDLE_FN(name, type) \ inline name##Handle::name##Handle(type* obj) : _value(obj), _thread(NULL) { \ --- old/src/hotspot/share/runtime/jniHandles.cpp 2018-03-13 18:04:47.436672370 +0100 +++ new/src/hotspot/share/runtime/jniHandles.cpp 2018-03-13 18:04:47.100674881 +0100 @@ -27,6 +27,7 @@ #include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/share/services/diagnosticFramework.cpp 2018-03-13 18:04:48.528664205 +0100 +++ new/src/hotspot/share/services/diagnosticFramework.cpp 2018-03-13 18:04:48.164666926 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, 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 @@ -27,6 +27,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/mutexLocker.hpp" #include "services/diagnosticArgument.hpp" --- old/src/hotspot/share/services/memoryService.cpp 2018-03-13 18:04:49.772654903 +0100 +++ new/src/hotspot/share/services/memoryService.cpp 2018-03-13 18:04:49.420657535 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -31,6 +31,7 @@ #include "memory/memRegion.hpp" #include "oops/oop.inline.hpp" #include "runtime/globals.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "services/classLoadingService.hpp" #include "services/lowMemoryDetector.hpp"