Merge
This commit is contained in:
commit
23e18275ac
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -31,6 +31,7 @@ include JavaCompilation.gmk
|
|||||||
include Modules.gmk
|
include Modules.gmk
|
||||||
|
|
||||||
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
|
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
|
||||||
|
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
|
||||||
|
|
||||||
# Hook to include the corresponding custom file, if present.
|
# Hook to include the corresponding custom file, if present.
|
||||||
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
|
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
|
||||||
@ -45,10 +46,10 @@ ALL_MODULES := $(FindAllModules)
|
|||||||
# again to create src.zip.
|
# again to create src.zip.
|
||||||
$(foreach m, $(ALL_MODULES), \
|
$(foreach m, $(ALL_MODULES), \
|
||||||
$(foreach d, $(call FindModuleSrcDirs, $m), \
|
$(foreach d, $(call FindModuleSrcDirs, $m), \
|
||||||
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$d)/$m) \
|
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$(patsubst $(SUPPORT_OUTPUTDIR)/%,%,$d))/$m) \
|
||||||
$(if $(SRC_GENERATED), , \
|
$(if $(SRC_GENERATED), , \
|
||||||
$(eval $$($d_TARGET): $d ; \
|
$(eval $$($d_TARGET): $d ; \
|
||||||
$$(if $(filter $(TOPDIR)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
|
$$(if $(filter $(SRC_ZIP_BASE)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
|
||||||
) \
|
) \
|
||||||
) \
|
) \
|
||||||
$(eval SRC_ZIP_SRCS += $$($d_TARGET)) \
|
$(eval SRC_ZIP_SRCS += $$($d_TARGET)) \
|
||||||
|
@ -306,17 +306,36 @@ endef
|
|||||||
# There are two versions, either creating a relative or an absolute link. Be
|
# There are two versions, either creating a relative or an absolute link. Be
|
||||||
# careful when using this on Windows since the symlink created is only valid in
|
# careful when using this on Windows since the symlink created is only valid in
|
||||||
# the unix emulation environment.
|
# the unix emulation environment.
|
||||||
define link-file-relative
|
# In msys2 we use mklink /J because its ln would perform a deep copy of the target.
|
||||||
|
# This inhibits performance and can lead to issues with long paths. With mklink /J
|
||||||
|
# relative linking does not work, so we handle the link as absolute path.
|
||||||
|
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||||
|
define link-file-relative
|
||||||
|
$(call MakeTargetDir)
|
||||||
|
$(RM) '$(call DecodeSpace, $@)'
|
||||||
|
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define link-file-relative
|
||||||
$(call MakeTargetDir)
|
$(call MakeTargetDir)
|
||||||
$(RM) '$(call DecodeSpace, $@)'
|
$(RM) '$(call DecodeSpace, $@)'
|
||||||
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
|
||||||
endef
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
define link-file-absolute
|
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys2)
|
||||||
|
define link-file-absolute
|
||||||
|
$(call MakeTargetDir)
|
||||||
|
$(RM) '$(call DecodeSpace, $@)'
|
||||||
|
cmd //c "mklink /J $(call FixPath, $(call DecodeSpace, $@)) $(call FixPath, $(call DecodeSpace, $<))"
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define link-file-absolute
|
||||||
$(call MakeTargetDir)
|
$(call MakeTargetDir)
|
||||||
$(RM) '$(call DecodeSpace, $@)'
|
$(RM) '$(call DecodeSpace, $@)'
|
||||||
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
|
||||||
endef
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,6 +30,7 @@
|
|||||||
#include "oops/array.inline.hpp"
|
#include "oops/array.inline.hpp"
|
||||||
#include "utilities/exceptions.hpp"
|
#include "utilities/exceptions.hpp"
|
||||||
#include "utilities/globalDefinitions.hpp"
|
#include "utilities/globalDefinitions.hpp"
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
class MetadataFactory : AllStatic {
|
class MetadataFactory : AllStatic {
|
||||||
public:
|
public:
|
||||||
@ -61,14 +62,21 @@ class MetadataFactory : AllStatic {
|
|||||||
|
|
||||||
// Deallocation method for metadata
|
// Deallocation method for metadata
|
||||||
template <class T>
|
template <class T>
|
||||||
static void free_metadata(ClassLoaderData* loader_data, T md) {
|
static void free_metadata(ClassLoaderData* loader_data, T* md) {
|
||||||
if (md != NULL) {
|
if (md != NULL) {
|
||||||
assert(loader_data != NULL, "shouldn't pass null");
|
assert(loader_data != NULL, "shouldn't pass null");
|
||||||
int size = md->size();
|
int size = md->size();
|
||||||
// Call metadata's deallocate function which will call deallocate fields
|
// Call metadata's deallocate function which will deallocate fields and release_C_heap_structures
|
||||||
assert(!md->on_stack(), "can't deallocate things on stack");
|
assert(!md->on_stack(), "can't deallocate things on stack");
|
||||||
assert(!md->is_shared(), "cannot deallocate if in shared spaces");
|
assert(!md->is_shared(), "cannot deallocate if in shared spaces");
|
||||||
md->deallocate_contents(loader_data);
|
md->deallocate_contents(loader_data);
|
||||||
|
// Call the destructor. This is currently used for MethodData which has a member
|
||||||
|
// that needs to be destructed to release resources. Most Metadata derived classes have noop
|
||||||
|
// destructors and/or cleanup using deallocate_contents.
|
||||||
|
// T is a potentially const or volatile qualified pointer. Remove any const
|
||||||
|
// or volatile so we can call the destructor of the type T points to.
|
||||||
|
using U = std::remove_cv_t<T>;
|
||||||
|
md->~U();
|
||||||
loader_data->metaspace_non_null()->deallocate((MetaWord*)md, size, md->is_klass());
|
loader_data->metaspace_non_null()->deallocate((MetaWord*)md, size, md->is_klass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -595,10 +595,10 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
|||||||
|
|
||||||
// Release C heap allocated data that this points to, which includes
|
// Release C heap allocated data that this points to, which includes
|
||||||
// reference counting symbol names.
|
// reference counting symbol names.
|
||||||
// Can't release the constant pool here because the constant pool can be
|
// Can't release the constant pool or MethodData C heap data here because the constant
|
||||||
// deallocated separately from the InstanceKlass for default methods and
|
// pool can be deallocated separately from the InstanceKlass for default methods and
|
||||||
// redefine classes.
|
// redefine classes. MethodData can also be released separately.
|
||||||
release_C_heap_structures(/* release_constant_pool */ false);
|
release_C_heap_structures(/* release_sub_metadata */ false);
|
||||||
|
|
||||||
deallocate_methods(loader_data, methods());
|
deallocate_methods(loader_data, methods());
|
||||||
set_methods(NULL);
|
set_methods(NULL);
|
||||||
@ -2147,18 +2147,11 @@ jmethodID InstanceKlass::get_jmethod_id(const methodHandle& method_h) {
|
|||||||
if (!idnum_can_increment()) {
|
if (!idnum_can_increment()) {
|
||||||
// the cache can't grow so we can just get the current values
|
// the cache can't grow so we can just get the current values
|
||||||
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
|
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
|
||||||
} else {
|
|
||||||
// cache can grow so we have to be more careful
|
|
||||||
if (Threads::number_of_threads() == 0 ||
|
|
||||||
SafepointSynchronize::is_at_safepoint()) {
|
|
||||||
// we're single threaded or at a safepoint - no locking needed
|
|
||||||
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
|
|
||||||
} else {
|
} else {
|
||||||
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
||||||
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
|
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// implied else:
|
// implied else:
|
||||||
// we need to allocate a cache so default length and id values are good
|
// we need to allocate a cache so default length and id values are good
|
||||||
|
|
||||||
@ -2166,8 +2159,8 @@ jmethodID InstanceKlass::get_jmethod_id(const methodHandle& method_h) {
|
|||||||
length <= idnum || // cache is too short
|
length <= idnum || // cache is too short
|
||||||
id == NULL) { // cache doesn't contain entry
|
id == NULL) { // cache doesn't contain entry
|
||||||
|
|
||||||
// This function can be called by the VMThread so we have to do all
|
// This function can be called by the VMThread or GC worker threads so we
|
||||||
// things that might block on a safepoint before grabbing the lock.
|
// have to do all things that might block on a safepoint before grabbing the lock.
|
||||||
// Otherwise, we can deadlock with the VMThread or have a cache
|
// Otherwise, we can deadlock with the VMThread or have a cache
|
||||||
// consistency issue. These vars keep track of what we might have
|
// consistency issue. These vars keep track of what we might have
|
||||||
// to free after the lock is dropped.
|
// to free after the lock is dropped.
|
||||||
@ -2186,6 +2179,8 @@ jmethodID InstanceKlass::get_jmethod_id(const methodHandle& method_h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// allocate a new jmethodID that might be used
|
// allocate a new jmethodID that might be used
|
||||||
|
{
|
||||||
|
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
||||||
jmethodID new_id = NULL;
|
jmethodID new_id = NULL;
|
||||||
if (method_h->is_old() && !method_h->is_obsolete()) {
|
if (method_h->is_old() && !method_h->is_obsolete()) {
|
||||||
// The method passed in is old (but not obsolete), we need to use the current version
|
// The method passed in is old (but not obsolete), we need to use the current version
|
||||||
@ -2198,13 +2193,6 @@ jmethodID InstanceKlass::get_jmethod_id(const methodHandle& method_h) {
|
|||||||
new_id = Method::make_jmethod_id(class_loader_data(), method_h());
|
new_id = Method::make_jmethod_id(class_loader_data(), method_h());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Threads::number_of_threads() == 0 ||
|
|
||||||
SafepointSynchronize::is_at_safepoint()) {
|
|
||||||
// we're single threaded or at a safepoint - no locking needed
|
|
||||||
id = get_jmethod_id_fetch_or_update(idnum, new_id, new_jmeths,
|
|
||||||
&to_dealloc_id, &to_dealloc_jmeths);
|
|
||||||
} else {
|
|
||||||
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
|
||||||
id = get_jmethod_id_fetch_or_update(idnum, new_id, new_jmeths,
|
id = get_jmethod_id_fetch_or_update(idnum, new_id, new_jmeths,
|
||||||
&to_dealloc_id, &to_dealloc_jmeths);
|
&to_dealloc_id, &to_dealloc_jmeths);
|
||||||
}
|
}
|
||||||
@ -2254,9 +2242,7 @@ jmethodID InstanceKlass::get_jmethod_id_fetch_or_update(
|
|||||||
assert(new_id != NULL, "sanity check");
|
assert(new_id != NULL, "sanity check");
|
||||||
assert(to_dealloc_id_p != NULL, "sanity check");
|
assert(to_dealloc_id_p != NULL, "sanity check");
|
||||||
assert(to_dealloc_jmeths_p != NULL, "sanity check");
|
assert(to_dealloc_jmeths_p != NULL, "sanity check");
|
||||||
assert(Threads::number_of_threads() == 0 ||
|
assert(JmethodIdCreation_lock->owned_by_self(), "sanity check");
|
||||||
SafepointSynchronize::is_at_safepoint() ||
|
|
||||||
JmethodIdCreation_lock->owned_by_self(), "sanity check");
|
|
||||||
|
|
||||||
// reacquire the cache - we are locked, single threaded or at a safepoint
|
// reacquire the cache - we are locked, single threaded or at a safepoint
|
||||||
jmethodID* jmeths = methods_jmethod_ids_acquire();
|
jmethodID* jmeths = methods_jmethod_ids_acquire();
|
||||||
@ -2664,13 +2650,15 @@ static void method_release_C_heap_structures(Method* m) {
|
|||||||
m->release_C_heap_structures();
|
m->release_C_heap_structures();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called also by InstanceKlass::deallocate_contents, with false for release_constant_pool.
|
// Called also by InstanceKlass::deallocate_contents, with false for release_sub_metadata.
|
||||||
void InstanceKlass::release_C_heap_structures(bool release_constant_pool) {
|
void InstanceKlass::release_C_heap_structures(bool release_sub_metadata) {
|
||||||
// Clean up C heap
|
// Clean up C heap
|
||||||
Klass::release_C_heap_structures();
|
Klass::release_C_heap_structures();
|
||||||
|
|
||||||
// Deallocate and call destructors for MDO mutexes
|
// Deallocate and call destructors for MDO mutexes
|
||||||
|
if (release_sub_metadata) {
|
||||||
methods_do(method_release_C_heap_structures);
|
methods_do(method_release_C_heap_structures);
|
||||||
|
}
|
||||||
|
|
||||||
// Destroy the init_monitor
|
// Destroy the init_monitor
|
||||||
delete _init_monitor;
|
delete _init_monitor;
|
||||||
@ -2710,7 +2698,7 @@ void InstanceKlass::release_C_heap_structures(bool release_constant_pool) {
|
|||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, _source_debug_extension);
|
FREE_C_HEAP_ARRAY(char, _source_debug_extension);
|
||||||
|
|
||||||
if (release_constant_pool) {
|
if (release_sub_metadata) {
|
||||||
constants()->release_C_heap_structures();
|
constants()->release_C_heap_structures();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1012,7 +1012,7 @@ public:
|
|||||||
// callbacks for actions during class unloading
|
// callbacks for actions during class unloading
|
||||||
static void unload_class(InstanceKlass* ik);
|
static void unload_class(InstanceKlass* ik);
|
||||||
|
|
||||||
virtual void release_C_heap_structures(bool release_constant_pool = true);
|
virtual void release_C_heap_structures(bool release_sub_metadata = true);
|
||||||
|
|
||||||
// Naming
|
// Naming
|
||||||
const char* signature_name() const;
|
const char* signature_name() const;
|
||||||
|
@ -141,10 +141,9 @@ void Method::deallocate_contents(ClassLoaderData* loader_data) {
|
|||||||
|
|
||||||
void Method::release_C_heap_structures() {
|
void Method::release_C_heap_structures() {
|
||||||
if (method_data()) {
|
if (method_data()) {
|
||||||
#if INCLUDE_JVMCI
|
method_data()->release_C_heap_structures();
|
||||||
FailedSpeculation::free_failed_speculations(method_data()->get_failed_speculations_address());
|
|
||||||
#endif
|
// Destroy MethodData embedded lock
|
||||||
// Destroy MethodData
|
|
||||||
method_data()->~MethodData();
|
method_data()->~MethodData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2165,9 +2164,7 @@ JNIMethodBlockNode::JNIMethodBlockNode(int num_methods) : _top(0), _next(NULL) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
void Method::ensure_jmethod_ids(ClassLoaderData* cld, int capacity) {
|
||||||
ClassLoaderData* cld = loader_data;
|
|
||||||
if (!SafepointSynchronize::is_at_safepoint()) {
|
|
||||||
// Have to add jmethod_ids() to class loader data thread-safely.
|
// Have to add jmethod_ids() to class loader data thread-safely.
|
||||||
// Also have to add the method to the list safely, which the lock
|
// Also have to add the method to the list safely, which the lock
|
||||||
// protects as well.
|
// protects as well.
|
||||||
@ -2177,38 +2174,19 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
|
|||||||
} else {
|
} else {
|
||||||
cld->jmethod_ids()->ensure_methods(capacity);
|
cld->jmethod_ids()->ensure_methods(capacity);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// At safepoint, we are single threaded and can set this.
|
|
||||||
if (cld->jmethod_ids() == NULL) {
|
|
||||||
cld->set_jmethod_ids(new JNIMethodBlock(capacity));
|
|
||||||
} else {
|
|
||||||
cld->jmethod_ids()->ensure_methods(capacity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a method id to the jmethod_ids
|
// Add a method id to the jmethod_ids
|
||||||
jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
|
jmethodID Method::make_jmethod_id(ClassLoaderData* cld, Method* m) {
|
||||||
ClassLoaderData* cld = loader_data;
|
|
||||||
|
|
||||||
if (!SafepointSynchronize::is_at_safepoint()) {
|
|
||||||
// Have to add jmethod_ids() to class loader data thread-safely.
|
// Have to add jmethod_ids() to class loader data thread-safely.
|
||||||
// Also have to add the method to the list safely, which the lock
|
// Also have to add the method to the list safely, which the lock
|
||||||
// protects as well.
|
// protects as well.
|
||||||
MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
|
assert(JmethodIdCreation_lock->owned_by_self(), "sanity check");
|
||||||
if (cld->jmethod_ids() == NULL) {
|
if (cld->jmethod_ids() == NULL) {
|
||||||
cld->set_jmethod_ids(new JNIMethodBlock());
|
cld->set_jmethod_ids(new JNIMethodBlock());
|
||||||
}
|
}
|
||||||
// jmethodID is a pointer to Method*
|
// jmethodID is a pointer to Method*
|
||||||
return (jmethodID)cld->jmethod_ids()->add_method(m);
|
return (jmethodID)cld->jmethod_ids()->add_method(m);
|
||||||
} else {
|
|
||||||
// At safepoint, we are single threaded and can set this.
|
|
||||||
if (cld->jmethod_ids() == NULL) {
|
|
||||||
cld->set_jmethod_ids(new JNIMethodBlock());
|
|
||||||
}
|
|
||||||
// jmethodID is a pointer to Method*
|
|
||||||
return (jmethodID)cld->jmethod_ids()->add_method(m);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jmethodID Method::jmethod_id() {
|
jmethodID Method::jmethod_id() {
|
||||||
@ -2218,8 +2196,7 @@ jmethodID Method::jmethod_id() {
|
|||||||
|
|
||||||
// Mark a jmethodID as free. This is called when there is a data race in
|
// Mark a jmethodID as free. This is called when there is a data race in
|
||||||
// InstanceKlass while creating the jmethodID cache.
|
// InstanceKlass while creating the jmethodID cache.
|
||||||
void Method::destroy_jmethod_id(ClassLoaderData* loader_data, jmethodID m) {
|
void Method::destroy_jmethod_id(ClassLoaderData* cld, jmethodID m) {
|
||||||
ClassLoaderData* cld = loader_data;
|
|
||||||
Method** ptr = (Method**)m;
|
Method** ptr = (Method**)m;
|
||||||
assert(cld->jmethod_ids() != NULL, "should have method handles");
|
assert(cld->jmethod_ids() != NULL, "should have method handles");
|
||||||
cld->jmethod_ids()->destroy_method(ptr);
|
cld->jmethod_ids()->destroy_method(ptr);
|
||||||
|
@ -774,13 +774,13 @@ public:
|
|||||||
// however, can be GC'ed away if the class is unloaded or if the method is
|
// however, can be GC'ed away if the class is unloaded or if the method is
|
||||||
// made obsolete or deleted -- in these cases, the jmethodID
|
// made obsolete or deleted -- in these cases, the jmethodID
|
||||||
// refers to NULL (as is the case for any weak reference).
|
// refers to NULL (as is the case for any weak reference).
|
||||||
static jmethodID make_jmethod_id(ClassLoaderData* loader_data, Method* mh);
|
static jmethodID make_jmethod_id(ClassLoaderData* cld, Method* mh);
|
||||||
static void destroy_jmethod_id(ClassLoaderData* loader_data, jmethodID mid);
|
static void destroy_jmethod_id(ClassLoaderData* cld, jmethodID mid);
|
||||||
|
|
||||||
// Ensure there is enough capacity in the internal tracking data
|
// Ensure there is enough capacity in the internal tracking data
|
||||||
// structures to hold the number of jmethodIDs you plan to generate.
|
// structures to hold the number of jmethodIDs you plan to generate.
|
||||||
// This saves substantial time doing allocations.
|
// This saves substantial time doing allocations.
|
||||||
static void ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity);
|
static void ensure_jmethod_ids(ClassLoaderData* cld, int capacity);
|
||||||
|
|
||||||
// Use resolve_jmethod_id() in situations where the caller is expected
|
// Use resolve_jmethod_id() in situations where the caller is expected
|
||||||
// to provide a valid jmethodID; the only sanity checks are in asserts;
|
// to provide a valid jmethodID; the only sanity checks are in asserts;
|
||||||
|
@ -1821,3 +1821,13 @@ void MethodData::clean_weak_method_links() {
|
|||||||
clean_extra_data(&cl);
|
clean_extra_data(&cl);
|
||||||
verify_extra_data_clean(&cl);
|
verify_extra_data_clean(&cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MethodData::deallocate_contents(ClassLoaderData* loader_data) {
|
||||||
|
release_C_heap_structures();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MethodData::release_C_heap_structures() {
|
||||||
|
#if INCLUDE_JVMCI
|
||||||
|
FailedSpeculation::free_failed_speculations(get_failed_speculations_address());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -2449,8 +2449,9 @@ public:
|
|||||||
virtual void metaspace_pointers_do(MetaspaceClosure* iter);
|
virtual void metaspace_pointers_do(MetaspaceClosure* iter);
|
||||||
virtual MetaspaceObj::Type type() const { return MethodDataType; }
|
virtual MetaspaceObj::Type type() const { return MethodDataType; }
|
||||||
|
|
||||||
// Deallocation support - no metaspace pointer fields to deallocate
|
// Deallocation support
|
||||||
void deallocate_contents(ClassLoaderData* loader_data) {}
|
void deallocate_contents(ClassLoaderData* loader_data);
|
||||||
|
void release_C_heap_structures();
|
||||||
|
|
||||||
// GC support
|
// GC support
|
||||||
void set_size(int object_size_in_bytes) { _size = object_size_in_bytes; }
|
void set_size(int object_size_in_bytes) { _size = object_size_in_bytes; }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -51,24 +51,28 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
|
|||||||
* various {@code next} methods.
|
* various {@code next} methods.
|
||||||
*
|
*
|
||||||
* <p>For example, this code allows a user to read a number from
|
* <p>For example, this code allows a user to read a number from
|
||||||
* {@code System.in}:
|
* the console.
|
||||||
* <blockquote><pre>{@code
|
* {@snippet :
|
||||||
* Scanner sc = new Scanner(System.in);
|
* var con = System.console();
|
||||||
|
* if (con != null) {
|
||||||
|
* // @link substring="reader()" target="java.io.Console#reader()" :
|
||||||
|
* Scanner sc = new Scanner(con.reader());
|
||||||
* int i = sc.nextInt();
|
* int i = sc.nextInt();
|
||||||
* }</pre></blockquote>
|
* }
|
||||||
|
* }
|
||||||
*
|
*
|
||||||
* <p>As another example, this code allows {@code long} types to be
|
* <p>As another example, this code allows {@code long} types to be
|
||||||
* assigned from entries in a file {@code myNumbers}:
|
* assigned from entries in a file {@code myNumbers}:
|
||||||
* <blockquote><pre>{@code
|
* {@snippet :
|
||||||
* Scanner sc = new Scanner(new File("myNumbers"));
|
* Scanner sc = new Scanner(new File("myNumbers"));
|
||||||
* while (sc.hasNextLong()) {
|
* while (sc.hasNextLong()) {
|
||||||
* long aLong = sc.nextLong();
|
* long aLong = sc.nextLong();
|
||||||
* }
|
* }
|
||||||
* }</pre></blockquote>
|
* }
|
||||||
*
|
*
|
||||||
* <p>The scanner can also use delimiters other than whitespace. This
|
* <p>The scanner can also use delimiters other than whitespace. This
|
||||||
* example reads several items in from a string:
|
* example reads several items in from a string:
|
||||||
* <blockquote><pre>{@code
|
* {@snippet :
|
||||||
* String input = "1 fish 2 fish red fish blue fish";
|
* String input = "1 fish 2 fish red fish blue fish";
|
||||||
* Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*");
|
* Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*");
|
||||||
* System.out.println(s.nextInt());
|
* System.out.println(s.nextInt());
|
||||||
@ -76,7 +80,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
|
|||||||
* System.out.println(s.next());
|
* System.out.println(s.next());
|
||||||
* System.out.println(s.next());
|
* System.out.println(s.next());
|
||||||
* s.close();
|
* s.close();
|
||||||
* }</pre></blockquote>
|
* }
|
||||||
* <p>
|
* <p>
|
||||||
* prints the following output:
|
* prints the following output:
|
||||||
* <blockquote><pre>{@code
|
* <blockquote><pre>{@code
|
||||||
@ -88,7 +92,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
|
|||||||
*
|
*
|
||||||
* <p>The same output can be generated with this code, which uses a regular
|
* <p>The same output can be generated with this code, which uses a regular
|
||||||
* expression to parse all four tokens at once:
|
* expression to parse all four tokens at once:
|
||||||
* <blockquote><pre>{@code
|
* {@snippet :
|
||||||
* String input = "1 fish 2 fish red fish blue fish";
|
* String input = "1 fish 2 fish red fish blue fish";
|
||||||
* Scanner s = new Scanner(input);
|
* Scanner s = new Scanner(input);
|
||||||
* s.findInLine("(\\d+) fish (\\d+) fish (\\w+) fish (\\w+)");
|
* s.findInLine("(\\d+) fish (\\d+) fish (\\w+) fish (\\w+)");
|
||||||
@ -96,7 +100,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter;
|
|||||||
* for (int i=1; i<=result.groupCount(); i++)
|
* for (int i=1; i<=result.groupCount(); i++)
|
||||||
* System.out.println(result.group(i));
|
* System.out.println(result.group(i));
|
||||||
* s.close();
|
* s.close();
|
||||||
* }</pre></blockquote>
|
* }
|
||||||
*
|
*
|
||||||
* <p>The <a id="default-delimiter">default whitespace delimiter</a> used
|
* <p>The <a id="default-delimiter">default whitespace delimiter</a> used
|
||||||
* by a scanner is as recognized by {@link Character#isWhitespace(char)
|
* by a scanner is as recognized by {@link Character#isWhitespace(char)
|
||||||
|
@ -401,7 +401,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder {
|
|||||||
ENTITLEMENTS.fetchFrom(params));
|
ENTITLEMENTS.fetchFrom(params));
|
||||||
}
|
}
|
||||||
restoreKeychainList(params);
|
restoreKeychainList(params);
|
||||||
} else if (Platform.isArmMac()) {
|
} else if (Platform.isMac()) {
|
||||||
signAppBundle(params, root, "-", null, null);
|
signAppBundle(params, root, "-", null, null);
|
||||||
} else {
|
} else {
|
||||||
// Calling signAppBundle() without signingIdentity will result in
|
// Calling signAppBundle() without signingIdentity will result in
|
||||||
|
@ -618,8 +618,6 @@ sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8295343 linux-al
|
|||||||
sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all
|
sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all
|
||||||
sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all
|
sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all
|
||||||
|
|
||||||
java/security/SignedJar/spi-calendar-provider/TestSPISigned.java 8298271 windows-all
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# jdk_sound
|
# jdk_sound
|
||||||
|
@ -33,6 +33,7 @@ import java.util.ArrayList;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.io.File;
|
||||||
import static java.util.Calendar.WEDNESDAY;
|
import static java.util.Calendar.WEDNESDAY;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -95,7 +96,7 @@ public class TestSPISigned {
|
|||||||
testRun.add("-Djava.locale.providers=SPI");
|
testRun.add("-Djava.locale.providers=SPI");
|
||||||
testRun.add("-cp");
|
testRun.add("-cp");
|
||||||
String classPath = System.getProperty("java.class.path");
|
String classPath = System.getProperty("java.class.path");
|
||||||
classPath = classPath + ":" + SIGNED_JAR.toAbsolutePath().toString();
|
classPath = classPath + File.pathSeparator + SIGNED_JAR.toAbsolutePath().toString();
|
||||||
testRun.add(classPath);
|
testRun.add(classPath);
|
||||||
testRun.add(TestSPISigned.class.getSimpleName());
|
testRun.add(TestSPISigned.class.getSimpleName());
|
||||||
testRun.add("run-test");
|
testRun.add("run-test");
|
||||||
|
@ -180,10 +180,6 @@ final public class TKit {
|
|||||||
return (OS.contains("mac"));
|
return (OS.contains("mac"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isArmMac() {
|
|
||||||
return (isOSX() && "aarch64".equals(System.getProperty("os.arch")));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isLinux() {
|
public static boolean isLinux() {
|
||||||
return ((OS.contains("nix") || OS.contains("nux")));
|
return ((OS.contains("nix") || OS.contains("nux")));
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class AppContentTest {
|
|||||||
})
|
})
|
||||||
// On macOS aarch64 we always signing app image and signing will fail, since
|
// On macOS aarch64 we always signing app image and signing will fail, since
|
||||||
// test produces invalid app bundle.
|
// test produces invalid app bundle.
|
||||||
.setExpectedExitCode(testPathArgs.contains(TEST_BAD) || TKit.isArmMac() ? 1 : 0)
|
.setExpectedExitCode(testPathArgs.contains(TEST_BAD) || TKit.isOSX() ? 1 : 0)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user