mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8219229: Make ConstantPool::tag_at and release_tag_at_put inlineable
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
d9463e629e
commit
dbdfbb518f
17 changed files with 19 additions and 46 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/method.inline.hpp"
|
#include "oops/method.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/fieldDescriptor.inline.hpp"
|
#include "runtime/fieldDescriptor.inline.hpp"
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "classfile/stackMapTable.hpp"
|
#include "classfile/stackMapTable.hpp"
|
||||||
#include "classfile/verifier.hpp"
|
#include "classfile/verifier.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/fieldType.hpp"
|
#include "runtime/fieldType.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "logging/logStream.hpp"
|
#include "logging/logStream.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/cpCache.inline.hpp"
|
#include "oops/cpCache.inline.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
#include "oops/method.hpp"
|
#include "oops/method.hpp"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "interpreter/rewriter.hpp"
|
#include "interpreter/rewriter.hpp"
|
||||||
#include "memory/metadataFactory.hpp"
|
#include "memory/metadataFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/generateOopMap.hpp"
|
#include "oops/generateOopMap.hpp"
|
||||||
#include "prims/methodHandles.hpp"
|
#include "prims/methodHandles.hpp"
|
||||||
#include "runtime/fieldDescriptor.inline.hpp"
|
#include "runtime/fieldDescriptor.inline.hpp"
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/array.hpp"
|
#include "oops/array.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
#include "oops/method.hpp"
|
#include "oops/method.hpp"
|
||||||
#include "prims/jvmtiRedefineClasses.hpp"
|
#include "prims/jvmtiRedefineClasses.hpp"
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
#include "memory/metaspace.hpp"
|
#include "memory/metaspace.hpp"
|
||||||
|
#include "runtime/orderAccess.hpp"
|
||||||
#include "utilities/align.hpp"
|
#include "utilities/align.hpp"
|
||||||
|
|
||||||
// Array for metadata allocation
|
// Array for metadata allocation
|
||||||
|
@ -121,8 +122,8 @@ protected:
|
||||||
T* adr_at(const int i) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return &_data[i]; }
|
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); }
|
int find(const T& x) { return index_of(x); }
|
||||||
|
|
||||||
T at_acquire(const int which);
|
T at_acquire(const int i) { return OrderAccess::load_acquire(adr_at(i)); }
|
||||||
void release_at_put(int which, T contents);
|
void release_at_put(int i, T x) { OrderAccess::release_store(adr_at(i), x); }
|
||||||
|
|
||||||
static int size(int length) {
|
static int size(int length) {
|
||||||
size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
|
size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
|
||||||
|
|
|
@ -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
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "memory/metaspaceShared.hpp"
|
#include "memory/metaspaceShared.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/array.inline.hpp"
|
#include "oops/array.hpp"
|
||||||
#include "oops/constantPool.inline.hpp"
|
#include "oops/constantPool.inline.hpp"
|
||||||
#include "oops/cpCache.inline.hpp"
|
#include "oops/cpCache.inline.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
|
@ -56,10 +56,6 @@
|
||||||
#include "runtime/vframe.inline.hpp"
|
#include "runtime/vframe.inline.hpp"
|
||||||
#include "utilities/copy.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) {
|
ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
|
||||||
Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
|
Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
|
||||||
int size = ConstantPool::size(length);
|
int size = ConstantPool::size(length);
|
||||||
|
|
|
@ -131,7 +131,7 @@ class ConstantPool : public Metadata {
|
||||||
|
|
||||||
void set_tags(Array<u1>* tags) { _tags = tags; }
|
void set_tags(Array<u1>* tags) { _tags = tags; }
|
||||||
void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); }
|
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); }
|
u1* tag_addr_at(int which) const { return tags()->adr_at(which); }
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ class ConstantPool : public Metadata {
|
||||||
|
|
||||||
// Tag query
|
// Tag query
|
||||||
|
|
||||||
constantTag tag_at(int which) const;
|
constantTag tag_at(int which) const { return (constantTag)tags()->at_acquire(which); }
|
||||||
|
|
||||||
// Fetching constants
|
// Fetching constants
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "logging/log.hpp"
|
#include "logging/log.hpp"
|
||||||
#include "logging/logStream.hpp"
|
#include "logging/logStream.hpp"
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/generateOopMap.hpp"
|
#include "oops/generateOopMap.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/symbol.hpp"
|
#include "oops/symbol.hpp"
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/fieldStreams.hpp"
|
#include "oops/fieldStreams.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/instanceClassLoaderKlass.hpp"
|
#include "oops/instanceClassLoaderKlass.hpp"
|
||||||
#include "oops/instanceKlass.inline.hpp"
|
#include "oops/instanceKlass.inline.hpp"
|
||||||
#include "oops/instanceMirrorKlass.hpp"
|
#include "oops/instanceMirrorKlass.hpp"
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "oops/constMethod.hpp"
|
#include "oops/constMethod.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/method.inline.hpp"
|
#include "oops/method.inline.hpp"
|
||||||
#include "oops/methodData.hpp"
|
#include "oops/methodData.hpp"
|
||||||
#include "oops/objArrayOop.inline.hpp"
|
#include "oops/objArrayOop.inline.hpp"
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/reflectionAccessorImplKlassHelper.hpp"
|
#include "oops/reflectionAccessorImplKlassHelper.hpp"
|
||||||
#include "utilities/constantTag.hpp"
|
#include "utilities/constantTag.hpp"
|
||||||
#include "utilities/debug.hpp"
|
#include "utilities/debug.hpp"
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
#include "oops/access.inline.hpp"
|
#include "oops/access.inline.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/fieldStreams.hpp"
|
#include "oops/fieldStreams.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
#include "oops/method.hpp"
|
#include "oops/method.hpp"
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "memory/metaspaceShared.hpp"
|
#include "memory/metaspaceShared.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/fieldStreams.hpp"
|
#include "oops/fieldStreams.hpp"
|
||||||
#include "oops/klassVtable.hpp"
|
#include "oops/klassVtable.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/method.hpp"
|
#include "oops/method.hpp"
|
||||||
#include "oops/objArrayOop.inline.hpp"
|
#include "oops/objArrayOop.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
#include "oops/annotations.hpp"
|
#include "oops/annotations.hpp"
|
||||||
|
#include "oops/constantPool.hpp"
|
||||||
#include "oops/instanceKlass.hpp"
|
#include "oops/instanceKlass.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/fieldStreams.hpp"
|
#include "oops/fieldStreams.hpp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue