8219229: Make ConstantPool::tag_at and release_tag_at_put inlineable
authorredestad
Wed, 20 Feb 2019 09:53:28 +0100
changeset 53838 c8c9bd65c198
parent 53837 b3f6ffbedd68
child 53839 31dde2f0ddf1
8219229: Make ConstantPool::tag_at and release_tag_at_put inlineable Reviewed-by: dholmes, coleenp
src/hotspot/share/ci/ciReplay.cpp
src/hotspot/share/classfile/stackMapTable.cpp
src/hotspot/share/interpreter/linkResolver.cpp
src/hotspot/share/interpreter/rewriter.cpp
src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
src/hotspot/share/oops/array.hpp
src/hotspot/share/oops/array.inline.hpp
src/hotspot/share/oops/constantPool.cpp
src/hotspot/share/oops/constantPool.hpp
src/hotspot/share/oops/generateOopMap.cpp
src/hotspot/share/oops/instanceKlass.cpp
src/hotspot/share/oops/method.cpp
src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp
src/hotspot/share/prims/jvm.cpp
src/hotspot/share/prims/jvmtiRedefineClasses.cpp
src/hotspot/share/runtime/deoptimization.cpp
src/hotspot/share/runtime/fieldDescriptor.cpp
--- a/src/hotspot/share/ci/ciReplay.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/ci/ciReplay.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -33,6 +33,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/method.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
--- a/src/hotspot/share/classfile/stackMapTable.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/classfile/stackMapTable.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -26,6 +26,7 @@
 #include "classfile/stackMapTable.hpp"
 #include "classfile/verifier.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldType.hpp"
 #include "runtime/handles.inline.hpp"
--- a/src/hotspot/share/interpreter/linkResolver.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/interpreter/linkResolver.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -39,6 +39,7 @@
 #include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/method.hpp"
--- a/src/hotspot/share/interpreter/rewriter.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/interpreter/rewriter.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -28,6 +28,7 @@
 #include "interpreter/rewriter.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/generateOopMap.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -43,6 +43,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/array.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/method.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
--- a/src/hotspot/share/oops/array.hpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/array.hpp	Wed Feb 20 09:53:28 2019 +0100
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "memory/metaspace.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/align.hpp"
 
 // Array for metadata allocation
@@ -121,8 +122,8 @@
   T*   adr_at(const int i)             { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return &_data[i]; }
   int  find(const T& x)                { return index_of(x); }
 
-  T at_acquire(const int which);
-  void release_at_put(int which, T contents);
+  T at_acquire(const int i)            { return OrderAccess::load_acquire(adr_at(i)); }
+  void release_at_put(int i, T x)      { OrderAccess::release_store(adr_at(i), x); }
 
   static int size(int length) {
     size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
--- a/src/hotspot/share/oops/array.inline.hpp	Tue Feb 19 09:02:28 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_OOPS_ARRAY_INLINE_HPP
-#define SHARE_OOPS_ARRAY_INLINE_HPP
-
-#include "oops/array.hpp"
-#include "runtime/orderAccess.hpp"
-
-template <typename T>
-inline T Array<T>::at_acquire(const int which) { return OrderAccess::load_acquire(adr_at(which)); }
-
-template <typename T>
-inline void Array<T>::release_at_put(int which, T contents) { OrderAccess::release_store(adr_at(which), contents); }
-
-#endif // SHARE_OOPS_ARRAY_INLINE_HPP
--- a/src/hotspot/share/oops/constantPool.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/constantPool.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -39,7 +39,7 @@
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/array.inline.hpp"
+#include "oops/array.hpp"
 #include "oops/constantPool.inline.hpp"
 #include "oops/cpCache.inline.hpp"
 #include "oops/instanceKlass.hpp"
@@ -56,10 +56,6 @@
 #include "runtime/vframe.inline.hpp"
 #include "utilities/copy.hpp"
 
-constantTag ConstantPool::tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
-
-void ConstantPool::release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
-
 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
   Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
   int size = ConstantPool::size(length);
--- a/src/hotspot/share/oops/constantPool.hpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/constantPool.hpp	Wed Feb 20 09:53:28 2019 +0100
@@ -131,7 +131,7 @@
 
   void set_tags(Array<u1>* tags)               { _tags = tags; }
   void tag_at_put(int which, jbyte t)          { tags()->at_put(which, t); }
-  void release_tag_at_put(int which, jbyte t);
+  void release_tag_at_put(int which, jbyte t)  { tags()->release_at_put(which, t); }
 
   u1* tag_addr_at(int which) const             { return tags()->adr_at(which); }
 
@@ -379,7 +379,7 @@
 
   // Tag query
 
-  constantTag tag_at(int which) const;
+  constantTag tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
 
   // Fetching constants
 
--- a/src/hotspot/share/oops/generateOopMap.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/generateOopMap.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -27,6 +27,7 @@
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/generateOopMap.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
--- a/src/hotspot/share/oops/instanceKlass.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -53,6 +53,7 @@
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/fieldStreams.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceKlass.inline.hpp"
 #include "oops/instanceMirrorKlass.hpp"
--- a/src/hotspot/share/oops/method.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/method.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -42,6 +42,7 @@
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/constMethod.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/method.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayOop.inline.hpp"
--- a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/reflectionAccessorImplKlassHelper.hpp"
 #include "utilities/constantTag.hpp"
 #include "utilities/debug.hpp"
--- a/src/hotspot/share/prims/jvm.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/prims/jvm.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -45,6 +45,7 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
 #include "oops/access.inline.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/method.hpp"
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -39,6 +39,7 @@
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/klassVtable.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/runtime/deoptimization.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -36,6 +36,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/method.hpp"
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
--- a/src/hotspot/share/runtime/fieldDescriptor.cpp	Tue Feb 19 09:02:28 2019 +0100
+++ b/src/hotspot/share/runtime/fieldDescriptor.cpp	Wed Feb 20 09:53:28 2019 +0100
@@ -28,6 +28,7 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
 #include "oops/annotations.hpp"
+#include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/fieldStreams.hpp"