This commit is contained in:
Phil Race 2020-08-31 12:26:58 -07:00
commit 9d71814dca
89 changed files with 1851 additions and 752 deletions

View File

@ -172,6 +172,10 @@ define SetupAotModuleBody
$1_JAOTC_OPTS += --compile-with-assertions
endif
ifneq ($$(filter -XX:+VerifyOops, $$($1_VM_OPTIONS)), )
$1_JAOTC_OPTS += -J-Dgraal.AOTVerifyOops=true
endif
$$($1_AOT_LIB): $$(JDK_UNDER_TEST)/release \
$$(call DependOnVariable, $1_JAOTC_OPTS) \
$$(call DependOnVariable, JDK_UNDER_TEST)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2020, 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,7 +50,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036
LVL428-LYD434-MAD504-MDL498-MGA969-MGF450-MKD807-MMK104-MNT496-MOP446-MRO478-MRU929-\
MTL470-MUR480-MVR462-MWK454-MXN484-MXV979-MYR458-MZM508-MZN943-NAD516-NGN566-\
NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\
PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
PKR586-PLN985-PTE620-PYG600-QAR634-ROL642-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
SRD968-SRG740-SSP728-STD678-STN930-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
@ -588,7 +588,7 @@ ZW=ZWL
minor0=\
ADP-BEF-BIF-BYB-BYR-CLP-DJF-ESP-GNF-\
GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-RWF-\
GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-ROL-RWF-\
TPE-TRL-UGX-UYI-VND-VUV-XAF-XOF-XPF
minor3=\
BHD-IQD-JOD-KWD-LYD-OMR-TND

View File

@ -2696,122 +2696,6 @@ int os::vm_allocation_granularity() {
#define MEM_LARGE_PAGES 0x20000000
#endif
#define VirtualFreeChecked(mem, size, type) \
do { \
bool ret = VirtualFree(mem, size, type); \
assert(ret, "Failed to free memory: " PTR_FORMAT, p2i(mem)); \
} while (false)
// The number of bytes is setup to match 1 pixel and 32 bits per pixel.
static const int gdi_tiny_bitmap_width_bytes = 4;
static HBITMAP gdi_create_tiny_bitmap(void* mem) {
// The documentation for CreateBitmap states a word-alignment requirement.
STATIC_ASSERT(is_aligned_(gdi_tiny_bitmap_width_bytes, sizeof(WORD)));
// Some callers use this function to test if memory crossing separate memory
// reservations can be used. Create a height of 2 to make sure that one pixel
// ends up in the first reservation and the other in the second.
int nHeight = 2;
assert(is_aligned(mem, gdi_tiny_bitmap_width_bytes), "Incorrect alignment");
// Width is one pixel and correlates with gdi_tiny_bitmap_width_bytes.
int nWidth = 1;
// Calculate bit count - will be 32.
UINT nBitCount = gdi_tiny_bitmap_width_bytes / nWidth * BitsPerByte;
return CreateBitmap(
nWidth,
nHeight,
1, // nPlanes
nBitCount,
mem); // lpBits
}
// It has been found that some of the GDI functions fail under these two situations:
// 1) When used with large pages
// 2) When mem crosses the boundary between two separate memory reservations.
//
// This is a small test used to see if the current GDI implementation is
// susceptible to any of these problems.
static bool gdi_can_use_memory(void* mem) {
HBITMAP bitmap = gdi_create_tiny_bitmap(mem);
if (bitmap != NULL) {
DeleteObject(bitmap);
return true;
}
// Verify that the bitmap could be created with a normal page.
// If this fails, the testing method above isn't reliable.
#ifdef ASSERT
void* verify_mem = ::malloc(4 * 1024);
HBITMAP verify_bitmap = gdi_create_tiny_bitmap(verify_mem);
if (verify_bitmap == NULL) {
fatal("Couldn't create test bitmap with malloced memory");
} else {
DeleteObject(verify_bitmap);
}
::free(verify_mem);
#endif
return false;
}
// Test if GDI functions work when memory spans
// two adjacent memory reservations.
static bool gdi_can_use_split_reservation_memory(bool use_large_pages, size_t granule) {
DWORD mem_large_pages = use_large_pages ? MEM_LARGE_PAGES : 0;
// Find virtual memory range. Two granules for regions and one for alignment.
void* reserved = VirtualAlloc(NULL,
granule * 3,
MEM_RESERVE,
PAGE_NOACCESS);
if (reserved == NULL) {
// Can't proceed with test - pessimistically report false
return false;
}
VirtualFreeChecked(reserved, 0, MEM_RELEASE);
// Ensure proper alignment
void* res0 = align_up(reserved, granule);
void* res1 = (char*)res0 + granule;
// Reserve and commit the first part
void* mem0 = VirtualAlloc(res0,
granule,
MEM_RESERVE|MEM_COMMIT|mem_large_pages,
PAGE_READWRITE);
if (mem0 != res0) {
// Can't proceed with test - pessimistically report false
return false;
}
// Reserve and commit the second part
void* mem1 = VirtualAlloc(res1,
granule,
MEM_RESERVE|MEM_COMMIT|mem_large_pages,
PAGE_READWRITE);
if (mem1 != res1) {
VirtualFreeChecked(mem0, 0, MEM_RELEASE);
// Can't proceed with test - pessimistically report false
return false;
}
// Set the bitmap's bits to point one "width" bytes before, so that
// the bitmap extends across the reservation boundary.
void* bitmapBits = (char*)mem1 - gdi_tiny_bitmap_width_bytes;
bool success = gdi_can_use_memory(bitmapBits);
VirtualFreeChecked(mem1, 0, MEM_RELEASE);
VirtualFreeChecked(mem0, 0, MEM_RELEASE);
return success;
}
// Container for NUMA node list info
class NUMANodeListHolder {
private:
@ -2914,12 +2798,6 @@ static bool numa_interleaving_init() {
return false;
}
if (!gdi_can_use_split_reservation_memory(UseLargePages, min_interleave_granularity)) {
WARN("Windows GDI cannot handle split reservations.");
WARN("...Ignoring UseNUMAInterleaving flag.");
return false;
}
if (log_is_enabled(Debug, os, cpu)) {
Log(os, cpu) log;
log.debug("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count());
@ -3080,25 +2958,6 @@ static size_t large_page_init_decide_size() {
size = LargePageSizeInBytes;
}
// Now test allocating a page
void* large_page = VirtualAlloc(NULL,
size,
MEM_RESERVE|MEM_COMMIT|MEM_LARGE_PAGES,
PAGE_READWRITE);
if (large_page == NULL) {
WARN("JVM cannot allocate one single large page.");
return 0;
}
// Detect if GDI can use memory backed by large pages
if (!gdi_can_use_memory(large_page)) {
WARN("JVM cannot use large pages because of bug in Windows GDI.");
return 0;
}
// Release test page
VirtualFreeChecked(large_page, 0, MEM_RELEASE);
#undef WARN
return size;
@ -3119,16 +2978,6 @@ void os::large_page_init() {
}
UseLargePages = _large_page_size != 0;
if (UseLargePages && UseLargePagesIndividualAllocation) {
if (!gdi_can_use_split_reservation_memory(true /* use_large_pages */, _large_page_size)) {
if (FLAG_IS_CMDLINE(UseLargePagesIndividualAllocation)) {
warning("Windows GDI cannot handle split reservations.");
warning("...Ignoring UseLargePagesIndividualAllocation flag.");
}
UseLargePagesIndividualAllocation = false;
}
}
}
int os::create_file_for_heap(const char* dir) {

View File

@ -44,6 +44,7 @@
#include "runtime/deoptimization.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/java.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vmOperations.hpp"
@ -566,6 +567,10 @@ void AOTCodeHeap::link_stub_routines_symbols() {
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_throw_delayed_StackOverflowError_entry", address, StubRoutines::_throw_delayed_StackOverflowError_entry);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_verify_oops", intptr_t, VerifyOops);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_verify_oop_count_address", jint *, &StubRoutines::_verify_oop_count);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_verify_oop_bits", intptr_t, Universe::verify_oop_bits());
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_verify_oop_mask", intptr_t, Universe::verify_oop_mask());
}
void AOTCodeHeap::link_os_symbols() {

View File

@ -32,6 +32,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/reflectionUtils.hpp"
// ciField
//

View File

@ -39,6 +39,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "utilities/copy.hpp"
#include "utilities/macros.hpp"
#include "utilities/utf8.hpp"

View File

@ -28,6 +28,7 @@
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/defaultMethods.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/fieldLayoutBuilder.hpp"

View File

@ -36,6 +36,7 @@
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/javaCalls.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/hashtable.inline.hpp"

View File

@ -0,0 +1,99 @@
/*
* Copyright (c) 2020, 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_CLASSFILE_CLASSLOADINFO_HPP
#define SHARE_CLASSFILE_CLASSLOADINFO_HPP
#include "runtime/handles.hpp"
class InstanceKlass;
template <typename T> class GrowableArray;
class ClassInstanceInfo : public StackObj {
private:
InstanceKlass* _dynamic_nest_host;
Handle _class_data;
public:
ClassInstanceInfo() {
_dynamic_nest_host = NULL;
_class_data = Handle();
}
ClassInstanceInfo(InstanceKlass* dynamic_nest_host, Handle class_data) {
_dynamic_nest_host = dynamic_nest_host;
_class_data = class_data;
}
InstanceKlass* dynamic_nest_host() const { return _dynamic_nest_host; }
Handle class_data() const { return _class_data; }
friend class ClassLoadInfo;
};
class ClassLoadInfo : public StackObj {
private:
Handle _protection_domain;
const InstanceKlass* _unsafe_anonymous_host;
GrowableArray<Handle>* _cp_patches;
ClassInstanceInfo _class_hidden_info;
bool _is_hidden;
bool _is_strong_hidden;
bool _can_access_vm_annotations;
public:
ClassLoadInfo(Handle protection_domain) {
_protection_domain = protection_domain;
_unsafe_anonymous_host = NULL;
_cp_patches = NULL;
_class_hidden_info._dynamic_nest_host = NULL;
_class_hidden_info._class_data = Handle();
_is_hidden = false;
_is_strong_hidden = false;
_can_access_vm_annotations = false;
}
ClassLoadInfo(Handle protection_domain, const InstanceKlass* unsafe_anonymous_host,
GrowableArray<Handle>* cp_patches, InstanceKlass* dynamic_nest_host,
Handle class_data, bool is_hidden, bool is_strong_hidden,
bool can_access_vm_annotations) {
_protection_domain = protection_domain;
_unsafe_anonymous_host = unsafe_anonymous_host;
_cp_patches = cp_patches;
_class_hidden_info._dynamic_nest_host = dynamic_nest_host;
_class_hidden_info._class_data = class_data;
_is_hidden = is_hidden;
_is_strong_hidden = is_strong_hidden;
_can_access_vm_annotations = can_access_vm_annotations;
}
Handle protection_domain() const { return _protection_domain; }
const InstanceKlass* unsafe_anonymous_host() const { return _unsafe_anonymous_host; }
GrowableArray<Handle>* cp_patches() const { return _cp_patches; }
const ClassInstanceInfo* class_hidden_info_ptr() const { return &_class_hidden_info; }
bool is_hidden() const { return _is_hidden; }
bool is_strong_hidden() const { return _is_strong_hidden; }
bool can_access_vm_annotations() const { return _can_access_vm_annotations; }
};
#endif // SHARE_CLASSFILE_CLASSLOADINFO_HPP

View File

@ -29,6 +29,7 @@
#include "classfile/classLoader.inline.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/moduleEntry.hpp"
#include "classfile/modules.hpp"

View File

@ -28,6 +28,7 @@
#include "classfile/classLoader.inline.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/klassFactory.hpp"
#include "classfile/modules.hpp"
#include "classfile/systemDictionaryShared.hpp"

View File

@ -33,6 +33,7 @@
#include "memory/metaspaceClosure.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oopHandle.inline.hpp"
#include "runtime/arguments.hpp"
@ -418,6 +419,23 @@ void SymbolPropertyEntry::free_entry() {
_method_type.release(Universe::vm_global());
}
void SymbolPropertyEntry::print_entry(outputStream* st) const {
symbol()->print_value_on(st);
st->print("/mode=" INTX_FORMAT, symbol_mode());
st->print(" -> ");
bool printed = false;
if (method() != NULL) {
method()->print_value_on(st);
printed = true;
}
if (method_type() != NULL) {
if (printed) st->print(" and ");
st->print(INTPTR_FORMAT, p2i((void *)method_type()));
printed = true;
}
st->print_cr(printed ? "" : "(empty)");
}
SymbolPropertyTable::SymbolPropertyTable(int table_size)
: Hashtable<Symbol*, mtSymbol>(table_size, sizeof(SymbolPropertyEntry))
{

View File

@ -25,8 +25,6 @@
#ifndef SHARE_CLASSFILE_DICTIONARY_HPP
#define SHARE_CLASSFILE_DICTIONARY_HPP
#include "classfile/protectionDomainCache.hpp"
#include "classfile/systemDictionary.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.hpp"
#include "oops/oopHandle.hpp"
@ -34,7 +32,7 @@
#include "utilities/ostream.hpp"
class DictionaryEntry;
class BoolObjectClosure;
class ProtectionDomainEntry;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The data structure for the class loader data dictionaries.
@ -208,22 +206,7 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
return (SymbolPropertyEntry**)HashtableEntry<Symbol*, mtSymbol>::next_addr();
}
void print_entry(outputStream* st) const {
symbol()->print_value_on(st);
st->print("/mode=" INTX_FORMAT, symbol_mode());
st->print(" -> ");
bool printed = false;
if (method() != NULL) {
method()->print_value_on(st);
printed = true;
}
if (method_type() != NULL) {
if (printed) st->print(" and ");
st->print(INTPTR_FORMAT, p2i((void *)method_type()));
printed = true;
}
st->print_cr(printed ? "" : "(empty)");
}
void print_entry(outputStream* st) const;
};
// A system-internal mapping of symbols to pointers, both managed

View File

@ -62,6 +62,7 @@
#include "runtime/java.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/thread.inline.hpp"

View File

@ -28,6 +28,7 @@
#include "classfile/systemDictionary.hpp"
#include "jvmtifiles/jvmti.h"
#include "oops/oop.hpp"
#include "oops/instanceKlass.hpp"
#include "runtime/os.hpp"
class RecordComponent;

View File

@ -28,6 +28,7 @@
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/klassFactory.hpp"
#include "memory/filemap.hpp"
#include "memory/metaspaceShared.hpp"

View File

@ -31,6 +31,7 @@
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.inline.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/klassFactory.hpp"
@ -111,46 +112,6 @@ OopHandle SystemDictionary::_java_platform_loader;
const int defaultProtectionDomainCacheSize = 1009;
ClassLoadInfo::ClassLoadInfo() {
_protection_domain = Handle();
_unsafe_anonymous_host = NULL;
_cp_patches = NULL;
_class_hidden_info._dynamic_nest_host = NULL;
_class_hidden_info._class_data = Handle();
_is_hidden = false;
_is_strong_hidden = false;
_can_access_vm_annotations = false;
}
ClassLoadInfo::ClassLoadInfo(Handle protection_domain) {
_protection_domain = protection_domain;
_unsafe_anonymous_host = NULL;
_cp_patches = NULL;
_class_hidden_info._dynamic_nest_host = NULL;
_class_hidden_info._class_data = Handle();
_is_hidden = false;
_is_strong_hidden = false;
_can_access_vm_annotations = false;
}
ClassLoadInfo::ClassLoadInfo(Handle protection_domain,
const InstanceKlass* unsafe_anonymous_host,
GrowableArray<Handle>* cp_patches,
InstanceKlass* dynamic_nest_host,
Handle class_data,
bool is_hidden,
bool is_strong_hidden,
bool can_access_vm_annotations) {
_protection_domain = protection_domain;
_unsafe_anonymous_host = unsafe_anonymous_host;
_cp_patches = cp_patches;
_class_hidden_info._dynamic_nest_host = dynamic_nest_host;
_class_hidden_info._class_data = class_data;
_is_hidden = is_hidden;
_is_strong_hidden = is_strong_hidden;
_can_access_vm_annotations = can_access_vm_annotations;
}
// ----------------------------------------------------------------------------
// Java-level SystemLoader and PlatformLoader
@ -2047,6 +2008,10 @@ bool SystemDictionary::is_well_known_klass(Symbol* class_name) {
}
return false;
}
bool SystemDictionary::is_well_known_klass(Klass* k) {
return is_well_known_klass(k->name());
}
#endif
bool SystemDictionary::resolve_wk_klass(WKID id, TRAPS) {
@ -2951,6 +2916,19 @@ ProtectionDomainCacheEntry* SystemDictionary::cache_get(Handle protection_domain
return _pd_cache_table->get(protection_domain);
}
ClassLoaderData* SystemDictionary::class_loader_data(Handle class_loader) {
return ClassLoaderData::class_loader_data(class_loader());
}
bool SystemDictionary::is_wk_klass_loaded(InstanceKlass* klass) {
return !(klass == NULL || !klass->is_loaded());
}
bool SystemDictionary::is_nonpublic_Object_method(Method* m) {
assert(m != NULL, "Unexpected NULL Method*");
return !m->is_public() && m->method_holder() == SystemDictionary::Object_klass();
}
// ----------------------------------------------------------------------------
void SystemDictionary::print_on(outputStream *st) {

View File

@ -25,62 +25,10 @@
#ifndef SHARE_CLASSFILE_SYSTEMDICTIONARY_HPP
#define SHARE_CLASSFILE_SYSTEMDICTIONARY_HPP
#include "classfile/classLoaderData.hpp"
#include "oops/objArrayOop.hpp"
#include "classfile/vmSymbols.hpp"
#include "oops/oopHandle.hpp"
#include "oops/symbol.hpp"
#include "runtime/java.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/handles.hpp"
#include "runtime/signature.hpp"
#include "utilities/hashtable.hpp"
class ClassInstanceInfo : public StackObj {
private:
InstanceKlass* _dynamic_nest_host;
Handle _class_data;
public:
ClassInstanceInfo() {
_dynamic_nest_host = NULL;
_class_data = Handle();
}
ClassInstanceInfo(InstanceKlass* dynamic_nest_host, Handle class_data) {
_dynamic_nest_host = dynamic_nest_host;
_class_data = class_data;
}
InstanceKlass* dynamic_nest_host() const { return _dynamic_nest_host; }
Handle class_data() const { return _class_data; }
friend class ClassLoadInfo;
};
class ClassLoadInfo : public StackObj {
private:
Handle _protection_domain;
const InstanceKlass* _unsafe_anonymous_host;
GrowableArray<Handle>* _cp_patches;
ClassInstanceInfo _class_hidden_info;
bool _is_hidden;
bool _is_strong_hidden;
bool _can_access_vm_annotations;
public:
ClassLoadInfo();
ClassLoadInfo(Handle protection_domain);
ClassLoadInfo(Handle protection_domain, const InstanceKlass* unsafe_anonymous_host,
GrowableArray<Handle>* cp_patches, InstanceKlass* dynamic_nest_host,
Handle class_data, bool is_hidden, bool is_strong_hidden,
bool can_access_vm_annotations);
Handle protection_domain() const { return _protection_domain; }
const InstanceKlass* unsafe_anonymous_host() const { return _unsafe_anonymous_host; }
GrowableArray<Handle>* cp_patches() const { return _cp_patches; }
const ClassInstanceInfo* class_hidden_info_ptr() const { return &_class_hidden_info; }
bool is_hidden() const { return _is_hidden; }
bool is_strong_hidden() const { return _is_strong_hidden; }
bool can_access_vm_annotations() const { return _can_access_vm_annotations; }
};
// The dictionary in each ClassLoaderData stores all loaded classes, either
// initiatied by its class loader or defined by its class loader:
@ -123,16 +71,20 @@ class ClassLoadInfo : public StackObj {
class BootstrapInfo;
class ClassFileStream;
class ClassLoadInfo;
class Dictionary;
class PlaceholderTable;
class LoaderConstraintTable;
template <MEMFLAGS F> class HashtableBucket;
class ResolutionErrorTable;
class SymbolPropertyTable;
class PackageEntry;
class ProtectionDomainCacheTable;
class ProtectionDomainCacheEntry;
class GCTimer;
class EventClassLoad;
class Symbol;
class TableStatistics;
#define WK_KLASS_ENUM_NAME(kname) kname##_knum
@ -445,22 +397,15 @@ public:
}
static BasicType box_klass_type(Klass* k); // inverse of box_klass
#ifdef ASSERT
static bool is_well_known_klass(Klass* k) {
return is_well_known_klass(k->name());
}
static bool is_well_known_klass(Klass* k);
static bool is_well_known_klass(Symbol* class_name);
#endif
protected:
// Returns the class loader data to be used when looking up/updating the
// system dictionary.
static ClassLoaderData *class_loader_data(Handle class_loader) {
return ClassLoaderData::class_loader_data(class_loader());
}
static bool is_wk_klass_loaded(InstanceKlass* klass) {
return !(klass == NULL || !klass->is_loaded());
}
static ClassLoaderData *class_loader_data(Handle class_loader);
static bool is_wk_klass_loaded(InstanceKlass* klass);
public:
static bool Object_klass_loaded() { return is_wk_klass_loaded(WK_KLASS(Object_klass)); }
@ -670,10 +615,7 @@ public:
is_system_class_loader(class_loader);
}
// Returns TRUE if the method is a non-public member of class java.lang.Object.
static bool is_nonpublic_Object_method(Method* m) {
assert(m != NULL, "Unexpected NULL Method*");
return !m->is_public() && m->method_holder() == SystemDictionary::Object_klass();
}
static bool is_nonpublic_Object_method(Method* m);
// Return Symbol or throw exception if name given is can not be a valid Symbol.
static Symbol* class_name_symbol(const char* name, Symbol* exception, TRAPS);

View File

@ -26,7 +26,6 @@
#define SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
#include "oops/klass.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/packageEntry.hpp"
#include "classfile/systemDictionary.hpp"
#include "memory/filemap.hpp"
@ -103,6 +102,7 @@
#define UNREGISTERED_INDEX -9999
class ClassFileStream;
class Dictionary;
class DumpTimeSharedClassInfo;
class DumpTimeSharedClassTable;
class LambdaProxyClassDictionary;

View File

@ -34,6 +34,7 @@
#include "gc/shared/workerPolicy.hpp"
#include "runtime/globals.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
static const double MaxRamFractionForYoung = 0.8;
size_t G1Arguments::MaxMemoryForYoung;
@ -274,4 +275,4 @@ size_t G1Arguments::heap_reserved_size_bytes() {
size_t G1Arguments::heap_max_size_bytes() {
return MaxHeapSize;
}
}

View File

@ -98,6 +98,7 @@
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/init.hpp"
#include "runtime/java.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/threadSMR.hpp"
#include "runtime/vmThread.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, 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
@ -29,6 +29,7 @@
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/java.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/threadSMR.hpp"
#include "utilities/align.hpp"

View File

@ -73,6 +73,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/vmThread.hpp"
#include "services/memTracker.hpp"

View File

@ -92,8 +92,8 @@ void DefNewGeneration::FastKeepAliveClosure::do_oop(narrowOop* p) { DefNewGenera
DefNewGeneration::FastEvacuateFollowersClosure::
FastEvacuateFollowersClosure(SerialHeap* heap,
FastScanClosure* cur,
FastScanClosure* older) :
DefNewScanClosure* cur,
DefNewYoungerGenClosure* older) :
_heap(heap), _scan_cur_or_nonheap(cur), _scan_older(older)
{
}
@ -105,12 +105,6 @@ void DefNewGeneration::FastEvacuateFollowersClosure::do_void() {
guarantee(_heap->young_gen()->promo_failure_scan_is_complete(), "Failed to finish scan");
}
FastScanClosure::FastScanClosure(DefNewGeneration* g, bool gc_barrier) :
OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier)
{
_boundary = _g->reserved().end();
}
void CLDScanClosure::do_cld(ClassLoaderData* cld) {
NOT_PRODUCT(ResourceMark rm);
log_develop_trace(gc, scavenge)("CLDScanClosure::do_cld " PTR_FORMAT ", %s, dirty: %s",
@ -570,16 +564,16 @@ void DefNewGeneration::collect(bool full,
assert(heap->no_allocs_since_save_marks(),
"save marks have not been newly set.");
FastScanClosure fsc_with_no_gc_barrier(this, false);
FastScanClosure fsc_with_gc_barrier(this, true);
DefNewScanClosure scan_closure(this);
DefNewYoungerGenClosure younger_gen_closure(this, _old_gen);
CLDScanClosure cld_scan_closure(&fsc_with_no_gc_barrier,
CLDScanClosure cld_scan_closure(&scan_closure,
heap->rem_set()->cld_rem_set()->accumulate_modified_oops());
set_promo_failure_scan_stack_closure(&fsc_with_no_gc_barrier);
set_promo_failure_scan_stack_closure(&scan_closure);
FastEvacuateFollowersClosure evacuate_followers(heap,
&fsc_with_no_gc_barrier,
&fsc_with_gc_barrier);
&scan_closure,
&younger_gen_closure);
assert(heap->no_allocs_since_save_marks(),
"save marks have not been newly set.");
@ -591,8 +585,8 @@ void DefNewGeneration::collect(bool full,
StrongRootsScope srs(0);
heap->young_process_roots(&srs,
&fsc_with_no_gc_barrier,
&fsc_with_gc_barrier,
&scan_closure,
&younger_gen_closure,
&cld_scan_closure);
}

View File

@ -35,10 +35,12 @@
#include "utilities/stack.hpp"
class ContiguousSpace;
class STWGCTimer;
class CSpaceCounters;
class DefNewYoungerGenClosure;
class DefNewScanClosure;
class ScanWeakRefClosure;
class SerialHeap;
class STWGCTimer;
// DefNewGeneration is a young generation containing eden, from- and
// to-space.
@ -180,12 +182,12 @@ protected:
class FastEvacuateFollowersClosure: public VoidClosure {
SerialHeap* _heap;
FastScanClosure* _scan_cur_or_nonheap;
FastScanClosure* _scan_older;
DefNewScanClosure* _scan_cur_or_nonheap;
DefNewYoungerGenClosure* _scan_older;
public:
FastEvacuateFollowersClosure(SerialHeap* heap,
FastScanClosure* cur,
FastScanClosure* older);
DefNewScanClosure* cur,
DefNewYoungerGenClosure* older);
void do_void();
};

View File

@ -90,11 +90,10 @@ inline void DefNewGeneration::FastKeepAliveClosure::do_oop_work(T* p) {
template <typename OopClosureType>
void DefNewGeneration::oop_since_save_marks_iterate(OopClosureType* cl) {
cl->set_generation(this);
eden()->oop_since_save_marks_iterate(cl);
to()->oop_since_save_marks_iterate(cl);
from()->oop_since_save_marks_iterate(cl);
cl->reset_generation();
save_marks();
}

View File

@ -90,8 +90,8 @@ GrowableArray<MemoryPool*> SerialHeap::memory_pools() {
}
void SerialHeap::young_process_roots(StrongRootsScope* scope,
OopsInGenClosure* root_closure,
OopsInGenClosure* old_gen_closure,
OopIterateClosure* root_closure,
OopIterateClosure* old_gen_closure,
CLDClosure* cld_closure) {
MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
@ -99,13 +99,11 @@ void SerialHeap::young_process_roots(StrongRootsScope* scope,
cld_closure, cld_closure, &mark_code_closure);
if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
root_closure->reset_generation();
}
old_gen_closure->set_generation(_old_gen);
rem_set()->at_younger_refs_iterate();
old_gen()->younger_refs_iterate(old_gen_closure, scope->n_threads());
old_gen_closure->reset_generation();
_process_strong_tasks->all_tasks_completed(scope->n_threads());
}

View File

@ -32,7 +32,7 @@
class GCMemoryManager;
class MemoryPool;
class OopsInGenClosure;
class OopIterateClosure;
class TenuredGeneration;
class SerialHeap : public GenCollectedHeap {
@ -78,8 +78,8 @@ public:
OopClosureType2* older);
void young_process_roots(StrongRootsScope* scope,
OopsInGenClosure* root_closure,
OopsInGenClosure* old_gen_closure,
OopIterateClosure* root_closure,
OopIterateClosure* old_gen_closure,
CLDClosure* cld_closure);
};

View File

@ -55,9 +55,8 @@ bool TenuredGeneration::block_is_obj(const HeapWord* addr) const {
template <typename OopClosureType>
void TenuredGeneration::oop_since_save_marks_iterate(OopClosureType* blk) {
blk->set_generation(this);
_the_space->oop_since_save_marks_iterate(blk);
blk->reset_generation();
save_marks();
}

View File

@ -36,6 +36,7 @@
#include "memory/universe.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/init.hpp"
#include "runtime/java.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/macros.hpp"
#include "utilities/preserveException.hpp"

View File

@ -34,91 +34,76 @@ class CardTableBarrierSet;
class DefNewGeneration;
class KlassRemSet;
// Closure for iterating roots from a particular generation
// Note: all classes deriving from this MUST call this do_barrier
// method at the end of their own do_oop method!
// Note: no do_oop defined, this is an abstract class.
class OopsInGenClosure : public OopIterateClosure {
private:
Generation* _orig_gen; // generation originally set in ctor
Generation* _gen; // generation being scanned
protected:
// Some subtypes need access.
HeapWord* _gen_boundary; // start of generation
CardTableRS* _rs; // remembered set
// For assertions
Generation* generation() { return _gen; }
CardTableRS* rs() { return _rs; }
// Derived classes that modify oops so that they might be old-to-young
// pointers must call the method below.
template <class T> void do_barrier(T* p);
public:
OopsInGenClosure(Generation* gen);
void set_generation(Generation* gen);
void reset_generation() { _gen = _orig_gen; }
HeapWord* gen_boundary() { return _gen_boundary; }
};
class BasicOopsInGenClosure: public OopsInGenClosure {
public:
BasicOopsInGenClosure(Generation* gen);
virtual bool do_metadata() { return false; }
virtual void do_klass(Klass* k) { ShouldNotReachHere(); }
virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); }
};
// Super class for scan closures. It contains code to dirty scanned class loader data.
class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure {
ClassLoaderData* _scanned_cld;
public:
OopsInClassLoaderDataOrGenClosure(Generation* g) : BasicOopsInGenClosure(g), _scanned_cld(NULL) {}
void set_scanned_cld(ClassLoaderData* cld) {
assert(cld == NULL || _scanned_cld == NULL, "Must be");
_scanned_cld = cld;
}
bool is_scanning_a_cld() { return _scanned_cld != NULL; }
void do_cld_barrier();
};
#if INCLUDE_SERIALGC
// Closure for scanning DefNewGeneration.
// Super closure class for scanning DefNewGeneration.
//
// This closure only performs barrier store calls on
// pointers into the DefNewGeneration.
class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
protected:
DefNewGeneration* _g;
HeapWord* _boundary;
bool _gc_barrier;
template <class T> inline void do_oop_work(T* p);
public:
FastScanClosure(DefNewGeneration* g, bool gc_barrier);
// - Derived: The derived type provides necessary barrier
// after an oop has been updated.
template <typename Derived>
class FastScanClosure : public BasicOopIterateClosure {
private:
DefNewGeneration* _young_gen;
HeapWord* _young_gen_end;
template <typename T>
void do_oop_work(T* p);
protected:
FastScanClosure(DefNewGeneration* g);
public:
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
};
#endif // INCLUDE_SERIALGC
// Closure for scanning DefNewGeneration when iterating over the old generation.
//
// This closure performs barrier store calls on pointers into the DefNewGeneration.
class DefNewYoungerGenClosure : public FastScanClosure<DefNewYoungerGenClosure> {
private:
Generation* _old_gen;
HeapWord* _old_gen_start;
CardTableRS* _rs;
public:
DefNewYoungerGenClosure(DefNewGeneration* young_gen, Generation* old_gen);
template <typename T>
void barrier(T* p);
};
// Closure for scanning DefNewGeneration when *not* iterating over the old generation.
//
// This closures records changes to oops in CLDs.
class DefNewScanClosure : public FastScanClosure<DefNewScanClosure> {
ClassLoaderData* _scanned_cld;
public:
DefNewScanClosure(DefNewGeneration* g);
void set_scanned_cld(ClassLoaderData* cld) {
assert(cld == NULL || _scanned_cld == NULL, "Must be");
_scanned_cld = cld;
}
template <typename T>
void barrier(T* p);
};
class CLDScanClosure: public CLDClosure {
OopsInClassLoaderDataOrGenClosure* _scavenge_closure;
DefNewScanClosure* _scavenge_closure;
// true if the the modified oops state should be saved.
bool _accumulate_modified_oops;
bool _accumulate_modified_oops;
public:
CLDScanClosure(OopsInClassLoaderDataOrGenClosure* scavenge_closure,
CLDScanClosure(DefNewScanClosure* scavenge_closure,
bool accumulate_modified_oops) :
_scavenge_closure(scavenge_closure), _accumulate_modified_oops(accumulate_modified_oops) {}
void do_cld(ClassLoaderData* cld);
};
#endif // INCLUDE_SERIALGC
class FilteringClosure: public OopIterateClosure {
private:
HeapWord* _boundary;

View File

@ -37,65 +37,64 @@
#include "gc/serial/defNewGeneration.inline.hpp"
#endif
inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
OopIterateClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
set_generation(gen);
}
inline void OopsInGenClosure::set_generation(Generation* gen) {
_gen = gen;
_gen_boundary = _gen->reserved().start();
// Barrier set for the heap, must be set after heap is initialized
if (_rs == NULL) {
_rs = GenCollectedHeap::heap()->rem_set();
}
}
template <class T> inline void OopsInGenClosure::do_barrier(T* p) {
assert(generation()->is_in_reserved(p), "expected ref in generation");
T heap_oop = RawAccess<>::oop_load(p);
assert(!CompressedOops::is_null(heap_oop), "expected non-null oop");
oop obj = CompressedOops::decode_not_null(heap_oop);
// If p points to a younger generation, mark the card.
if (cast_from_oop<HeapWord*>(obj) < _gen_boundary) {
_rs->inline_write_ref_field_gc(p, obj);
}
}
inline BasicOopsInGenClosure::BasicOopsInGenClosure(Generation* gen) : OopsInGenClosure(gen) {
}
inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
assert(_scanned_cld != NULL, "Must be");
if (!_scanned_cld->has_modified_oops()) {
_scanned_cld->record_modified_oops();
}
}
#if INCLUDE_SERIALGC
template <class T> inline void FastScanClosure::do_oop_work(T* p) {
template <typename Derived>
inline FastScanClosure<Derived>::FastScanClosure(DefNewGeneration* g) :
BasicOopIterateClosure(g->ref_processor()),
_young_gen(g),
_young_gen_end(g->reserved().end()) {}
template <typename Derived>
template <typename T>
inline void FastScanClosure<Derived>::do_oop_work(T* p) {
T heap_oop = RawAccess<>::oop_load(p);
// Should we copy the obj?
if (!CompressedOops::is_null(heap_oop)) {
oop obj = CompressedOops::decode_not_null(heap_oop);
if (cast_from_oop<HeapWord*>(obj) < _boundary) {
assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?");
if (cast_from_oop<HeapWord*>(obj) < _young_gen_end) {
assert(!_young_gen->to()->is_in_reserved(obj), "Scanning field twice?");
oop new_obj = obj->is_forwarded() ? obj->forwardee()
: _g->copy_to_survivor_space(obj);
: _young_gen->copy_to_survivor_space(obj);
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
if (is_scanning_a_cld()) {
do_cld_barrier();
} else if (_gc_barrier) {
// Now call parent closure
do_barrier(p);
}
static_cast<Derived*>(this)->barrier(p);
}
}
}
inline void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); }
inline void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); }
template <typename Derived>
inline void FastScanClosure<Derived>::do_oop(oop* p) { do_oop_work(p); }
template <typename Derived>
inline void FastScanClosure<Derived>::do_oop(narrowOop* p) { do_oop_work(p); }
inline DefNewYoungerGenClosure::DefNewYoungerGenClosure(DefNewGeneration* young_gen, Generation* old_gen) :
FastScanClosure<DefNewYoungerGenClosure>(young_gen),
_old_gen(old_gen),
_old_gen_start(old_gen->reserved().start()),
_rs(GenCollectedHeap::heap()->rem_set()) {}
template <typename T>
void DefNewYoungerGenClosure::barrier(T* p) {
assert(_old_gen->is_in_reserved(p), "expected ref in generation");
T heap_oop = RawAccess<>::oop_load(p);
assert(!CompressedOops::is_null(heap_oop), "expected non-null oop");
oop obj = CompressedOops::decode_not_null(heap_oop);
// If p points to a younger generation, mark the card.
if (cast_from_oop<HeapWord*>(obj) < _old_gen_start) {
_rs->inline_write_ref_field_gc(p, obj);
}
}
inline DefNewScanClosure::DefNewScanClosure(DefNewGeneration* g) :
FastScanClosure<DefNewScanClosure>(g), _scanned_cld(NULL) {}
template <class T>
void DefNewScanClosure::barrier(T* p) {
if (_scanned_cld != NULL && !_scanned_cld->has_modified_oops()) {
_scanned_cld->record_modified_oops();
}
}
#endif // INCLUDE_SERIALGC

View File

@ -56,7 +56,6 @@ class CompactibleSpace;
class ContiguousSpace;
class CompactPoint;
class OopClosure;
class FastScanClosure;
class GenCollectedHeap;
class GCStats;

View File

@ -26,6 +26,7 @@
#include "jvm.h"
#include "classfile/classFileParser.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/moduleEntry.hpp"
#include "classfile/modules.hpp"

View File

@ -1386,6 +1386,10 @@ void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, JVMCIObject si
case CRC_TABLE_ADDRESS:
case LOG_OF_HEAP_REGION_GRAIN_BYTES:
case INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED:
case VERIFY_OOPS:
case VERIFY_OOP_BITS:
case VERIFY_OOP_MASK:
case VERIFY_OOP_COUNT_ADDRESS:
break;
default:
JVMCI_ERROR("invalid mark id: %d", id);

View File

@ -160,6 +160,10 @@ private:
LOG_OF_HEAP_REGION_GRAIN_BYTES,
INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED,
DEOPT_MH_HANDLER_ENTRY,
VERIFY_OOPS,
VERIFY_OOP_BITS,
VERIFY_OOP_MASK,
VERIFY_OOP_COUNT_ADDRESS,
INVOKE_INVALID = -1
};

View File

@ -50,6 +50,7 @@
#include "runtime/frame.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/vframe_hp.hpp"

View File

@ -28,8 +28,9 @@
#include "jvmci/jvmciJavaClasses.hpp"
#include "jvmci/jvmciRuntime.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/java.hpp"
// ------------------------------------------------------------------

View File

@ -43,7 +43,9 @@
#include "runtime/deoptimization.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/sharedRuntime.hpp"
#if INCLUDE_G1GC
#include "gc/g1/g1ThreadLocalData.hpp"

View File

@ -472,6 +472,10 @@
declare_constant(CodeInstaller::LOG_OF_HEAP_REGION_GRAIN_BYTES) \
declare_constant(CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED) \
declare_constant(CodeInstaller::DEOPT_MH_HANDLER_ENTRY) \
declare_constant(CodeInstaller::VERIFY_OOP_COUNT_ADDRESS) \
declare_constant(CodeInstaller::VERIFY_OOPS) \
declare_constant(CodeInstaller::VERIFY_OOP_BITS) \
declare_constant(CodeInstaller::VERIFY_OOP_MASK) \
declare_constant(CodeInstaller::INVOKE_INVALID) \
\
declare_constant(vmIntrinsics::FIRST_MH_SIG_POLY) \

View File

@ -29,6 +29,7 @@
#include "oops/compressedOops.hpp"
#include "oops/markWord.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "services/memTracker.hpp"
#include "utilities/align.hpp"

View File

@ -77,6 +77,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/thread.inline.hpp"
#include "services/classLoadingService.hpp"
#include "services/threadService.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@ -26,10 +26,8 @@
#define SHARE_OOPS_KLASS_INLINE_HPP
#include "classfile/classLoaderData.inline.hpp"
#include "oops/compressedOops.hpp"
#include "oops/klass.hpp"
#include "oops/markWord.hpp"
#include "oops/oopHandle.inline.hpp"
inline void Klass::set_prototype_header(markWord header) {
assert(!header.has_bias_pattern() || is_instance_klass(), "biased locking currently only supported for Java instances");

View File

@ -42,7 +42,6 @@
// Forward declarations.
class OopClosure;
class FastScanClosure;
class FilteringClosure;
class PSPromotionManager;

View File

@ -4674,16 +4674,81 @@ void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node*
}
}
tty->cr();
int ct = 0;
Node *dbg_legal = LCA;
while(!dbg_legal->is_Start() && ct < 100) {
tty->print("idom[%d] ",ct); dbg_legal->dump();
ct++;
dbg_legal = idom(dbg_legal);
}
tty->print_cr("idoms of early %d:", early->_idx);
dump_idom(early);
tty->cr();
tty->print_cr("idoms of (wrong) LCA %d:", LCA->_idx);
dump_idom(LCA);
tty->cr();
dump_real_LCA(early, LCA);
tty->cr();
}
#endif
// Find the real LCA of early and the wrongly assumed LCA.
void PhaseIdealLoop::dump_real_LCA(Node* early, Node* wrong_lca) {
assert(!is_dominator(early, wrong_lca) && !is_dominator(early, wrong_lca),
"sanity check that one node does not dominate the other");
assert(!has_ctrl(early) && !has_ctrl(wrong_lca), "sanity check, no data nodes");
ResourceMark rm;
Node_List nodes_seen;
Node* real_LCA = NULL;
Node* n1 = wrong_lca;
Node* n2 = early;
uint count_1 = 0;
uint count_2 = 0;
// Add early and wrong_lca to simplify calculation of idom indices
nodes_seen.push(n1);
nodes_seen.push(n2);
// Walk the idom chain up from early and wrong_lca and stop when they intersect.
while (!n1->is_Start() && !n2->is_Start()) {
n1 = idom(n1);
n2 = idom(n2);
if (n1 == n2) {
// Both idom chains intersect at the same index
real_LCA = n1;
count_1 = nodes_seen.size() / 2;
count_2 = count_1;
break;
}
if (check_idom_chains_intersection(n1, count_1, count_2, &nodes_seen)) {
real_LCA = n1;
break;
}
if (check_idom_chains_intersection(n2, count_2, count_1, &nodes_seen)) {
real_LCA = n2;
break;
}
nodes_seen.push(n1);
nodes_seen.push(n2);
}
assert(real_LCA != NULL, "must always find an LCA");
tty->print_cr("Real LCA of early %d (idom[%d]) and (wrong) LCA %d (idom[%d]):", early->_idx, count_2, wrong_lca->_idx, count_1);
real_LCA->dump();
}
// Check if n is already on nodes_seen (i.e. idom chains of early and wrong_lca intersect at n). Determine the idom index of n
// on both idom chains and return them in idom_idx_new and idom_idx_other, respectively.
bool PhaseIdealLoop::check_idom_chains_intersection(const Node* n, uint& idom_idx_new, uint& idom_idx_other, const Node_List* nodes_seen) const {
if (nodes_seen->contains(n)) {
// The idom chain has just discovered n.
// Divide by 2 because nodes_seen contains the same amount of nodes from both chains.
idom_idx_new = nodes_seen->size() / 2;
// The other chain already contained n. Search the index.
for (uint i = 0; i < nodes_seen->size(); i++) {
if (nodes_seen->at(i) == n) {
// Divide by 2 because nodes_seen contains the same amount of nodes from both chains.
idom_idx_other = i / 2;
}
}
return true;
}
return false;
}
#endif // ASSERT
#ifndef PRODUCT
//------------------------------dump-------------------------------------------
@ -4753,7 +4818,19 @@ void PhaseIdealLoop::dump(IdealLoopTree* loop, uint idx, Node_List &rpo_list) co
}
}
}
#endif
void PhaseIdealLoop::dump_idom(Node* n) const {
if (has_ctrl(n)) {
tty->print_cr("No idom for data nodes");
} else {
for (int i = 0; i < 100 && !n->is_Start(); i++) {
tty->print("idom[%d] ", i);
n->dump();
n = idom(n);
}
}
}
#endif // NOT PRODUCT
// Collect a R-P-O for the whole CFG.
// Result list is in post-order (scan backwards for RPO)

View File

@ -1440,6 +1440,10 @@ private:
uint idx_before_clone, Node_List &old_new);
bool _created_loop_node;
#ifdef ASSERT
void dump_real_LCA(Node* early, Node* wrong_lca);
bool check_idom_chains_intersection(const Node* n, uint& idom_idx_new, uint& idom_idx_other, const Node_List* nodes_seen) const;
#endif
public:
void set_created_loop_node() { _created_loop_node = true; }
@ -1452,6 +1456,7 @@ public:
#ifndef PRODUCT
void dump() const;
void dump_idom(Node* n) const;
void dump(IdealLoopTree* loop, uint rpo_idx, Node_List &rpo_list) const;
void verify() const; // Major slow :-)
void verify_compare(Node* n, const PhaseIdealLoop* loop_verify, VectorSet &visited) const;

View File

@ -1495,7 +1495,10 @@ void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
// to fold a StoreP and an AddP together (as part of an
// address expression) and the AddP and StoreP have
// different controls.
if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
if (!x->is_Load() && !x->is_DecodeNarrowPtr() && !x->is_AddP() && !bs->is_gc_barrier_node(x)) {
_igvn._worklist.yank(x);
}
}
_igvn.remove_dead_node(n);
}

View File

@ -28,6 +28,7 @@
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/javaAssertions.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/moduleEntry.hpp"

View File

@ -24,8 +24,9 @@
#include "precompiled.hpp"
#include "aot/aotLoader.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/metadataOnStackMark.hpp"
#include "classfile/symbolTable.hpp"

View File

@ -51,6 +51,7 @@
#include "runtime/jniHandles.inline.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/reflection.hpp"
#include "runtime/reflectionUtils.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"

View File

@ -27,6 +27,7 @@
#include "jvm.h"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoadInfo.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmSymbols.hpp"
#include "jfr/jfrEvents.hpp"

View File

@ -25,6 +25,7 @@
#ifndef SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
#define SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
#include "runtime/fieldDescriptor.hpp"
#include "runtime/handles.inline.hpp"
// All fieldDescriptor inline functions that (directly or indirectly) use "_cp()" or "_cp->"

View File

@ -308,6 +308,12 @@ BasicType Signature::basic_type(int ch) {
return btcode;
}
Symbol* Signature::strip_envelope(const Symbol* signature) {
assert(has_envelope(signature), "precondition");
return SymbolTable::new_symbol((char*) signature->bytes() + 1,
signature->utf8_length() - 2);
}
static const int jl_len = 10, object_len = 6, jl_object_len = jl_len + object_len;
static const char jl_str[] = "java/lang/";

View File

@ -25,7 +25,6 @@
#ifndef SHARE_RUNTIME_SIGNATURE_HPP
#define SHARE_RUNTIME_SIGNATURE_HPP
#include "classfile/symbolTable.hpp"
#include "memory/allocation.hpp"
#include "oops/method.hpp"
@ -131,11 +130,7 @@ class Signature : AllStatic {
// inside the envelope, by stripping 'L' and ';'.
// Caller is responsible for decrementing the newly created
// Symbol's refcount, use TempNewSymbol.
static Symbol* strip_envelope(const Symbol* signature) {
assert(has_envelope(signature), "precondition");
return SymbolTable::new_symbol((char*) signature->bytes() + 1,
signature->utf8_length() - 2);
}
static Symbol* strip_envelope(const Symbol* signature);
// Assuming it's either a field or method descriptor, determine
// whether it is in fact a method descriptor:

View File

@ -112,7 +112,7 @@ typedef uint64_t julong;
#if defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
inline int g_isnan(float f) { return isnanf(f); }
inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"

View File

@ -60,7 +60,7 @@ typedef struct {
/*
* Signal to unblock thread
*/
static int sigWakeup = (__SIGRTMAX - 2);
#define WAKEUP_SIGNAL (SIGRTMAX - 2)
/*
* fdTable holds one entry per file descriptor, up to a certain
@ -152,10 +152,10 @@ static void __attribute((constructor)) init() {
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(sigWakeup, &sa, NULL);
sigaction(WAKEUP_SIGNAL, &sa, NULL);
sigemptyset(&sigset);
sigaddset(&sigset, sigWakeup);
sigaddset(&sigset, WAKEUP_SIGNAL);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
}
@ -305,7 +305,7 @@ static int closefd(int fd1, int fd2) {
threadEntry_t *curr = fdEntry->threads;
while (curr != NULL) {
curr->intr = 1;
pthread_kill( curr->thr, sigWakeup );
pthread_kill( curr->thr, WAKEUP_SIGNAL);
curr = curr->next;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
@ -304,6 +304,31 @@ abstract class DoublePipeline<E_IN>
};
}
@Override
public final DoubleStream mapMulti(DoubleMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return new StatelessOp<>(this, StreamShape.DOUBLE_VALUE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<Double> opWrapSink(int flags, Sink<Double> sink) {
return new Sink.ChainedDouble<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(double t) {
mapper.accept(t, (DoubleConsumer) downstream);
}
};
}
};
}
@Override
public DoubleStream unordered() {
if (!isOrdered())

View File

@ -163,6 +163,43 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
*/
DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper);
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with multiple elements, specifically zero or more elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain DoubleConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain DoubleConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMap flatMap} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with a {@code DoubleConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates a {@code DoubleStream} from the
* internal buffer. Finally, it returns this stream to {@code flatMap}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see Stream#mapMulti Stream.mapMulti
* @since 16
*/
default DoubleStream mapMulti(DoubleMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return flatMap(e -> {
SpinedBuffer.OfDouble buffer = new SpinedBuffer.OfDouble();
mapper.accept(e, buffer);
return StreamSupport.doubleStream(buffer.spliterator(), false);
});
}
/**
* Returns a stream consisting of the distinct elements of this stream. The
* elements are compared for equality according to
@ -1180,4 +1217,30 @@ public interface DoubleStream extends BaseStream<Double, DoubleStream> {
*/
DoubleStream build();
}
/**
* Represents an operation that accepts a {@code double}-valued argument
* and a DoubleConsumer, and returns no result. This functional interface is
* used by {@link DoubleStream#mapMulti(DoubleMapMultiConsumer) DoubleStream.mapMulti}
* to replace a double value with zero or more double values.
*
* <p>This is a <a href="../function/package-summary.html">functional interface</a>
* whose functional method is {@link #accept(double, DoubleConsumer)}.
*
* @see DoubleStream#mapMulti(DoubleMapMultiConsumer)
*
* @since 16
*/
@FunctionalInterface
interface DoubleMapMultiConsumer {
/**
* Replaces the given {@code value} with zero or more values by feeding the mapped
* values to the {@code dc} consumer.
*
* @param value the double value coming from upstream
* @param dc a {@code DoubleConsumer} accepting the mapped values
*/
void accept(double value, DoubleConsumer dc);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@ -338,6 +338,30 @@ abstract class IntPipeline<E_IN>
};
}
@Override
public final IntStream mapMulti(IntMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return new StatelessOp<>(this, StreamShape.INT_VALUE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<Integer> opWrapSink(int flags, Sink<Integer> sink) {
return new Sink.ChainedInt<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(int t) {
mapper.accept(t, (IntConsumer) downstream);
}
};
}
};
}
@Override
public IntStream unordered() {
if (!isOrdered())

View File

@ -164,6 +164,43 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
*/
IntStream flatMap(IntFunction<? extends IntStream> mapper);
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with multiple elements, specifically zero or more elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain IntConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain IntConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMap flatMap} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with an {@code IntConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates an {@code IntStream} from the
* internal buffer. Finally, it returns this stream to {@code flatMap}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see Stream#mapMulti Stream.mapMulti
* @since 16
*/
default IntStream mapMulti(IntMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return flatMap(e -> {
SpinedBuffer.OfInt buffer = new SpinedBuffer.OfInt();
mapper.accept(e, buffer);
return StreamSupport.intStream(buffer.spliterator(), false);
});
}
/**
* Returns a stream consisting of the distinct elements of this stream.
*
@ -1173,4 +1210,30 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
*/
IntStream build();
}
/**
* Represents an operation that accepts an {@code int}-valued argument
* and an IntConsumer, and returns no result. This functional interface is
* used by {@link IntStream#mapMulti(IntMapMultiConsumer) IntStream.mapMulti}
* to replace an int value with zero or more int values.
*
* <p>This is a <a href="../function/package-summary.html">functional interface</a>
* whose functional method is {@link #accept(int, IntConsumer)}.
*
* @see IntStream#mapMulti(IntMapMultiConsumer)
*
* @since 16
*/
@FunctionalInterface
interface IntMapMultiConsumer {
/**
* Replaces the given {@code value} with zero or more values by feeding the mapped
* values to the {@code ic} consumer.
*
* @param value the int value coming from upstream
* @param ic an {@code IntConsumer} accepting the mapped values
*/
void accept(int value, IntConsumer ic);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
@ -320,6 +320,30 @@ abstract class LongPipeline<E_IN>
};
}
@Override
public final LongStream mapMulti(LongMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return new LongPipeline.StatelessOp<>(this, StreamShape.LONG_VALUE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<Long> opWrapSink(int flags, Sink<Long> sink) {
return new Sink.ChainedLong<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(long t) {
mapper.accept(t, (LongConsumer) downstream);
}
};
}
};
}
@Override
public LongStream unordered() {
if (!isOrdered())

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
@ -164,6 +164,43 @@ public interface LongStream extends BaseStream<Long, LongStream> {
*/
LongStream flatMap(LongFunction<? extends LongStream> mapper);
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with multiple elements, specifically zero or more elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain LongConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain LongConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMap flatMap} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with a {@code LongConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates a {@code LongStream} from the
* internal buffer. Finally, it returns this stream to {@code flatMap}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see Stream#mapMulti Stream.mapMulti
* @since 16
*/
default LongStream mapMulti(LongMapMultiConsumer mapper) {
Objects.requireNonNull(mapper);
return flatMap(e -> {
SpinedBuffer.OfLong buffer = new SpinedBuffer.OfLong();
mapper.accept(e, buffer);
return StreamSupport.longStream(buffer.spliterator(), false);
});
}
/**
* Returns a stream consisting of the distinct elements of this stream.
*
@ -1177,4 +1214,30 @@ public interface LongStream extends BaseStream<Long, LongStream> {
*/
LongStream build();
}
/**
* Represents an operation that accepts a {@code long}-valued argument
* and a LongConsumer, and returns no result. This functional interface is
* used by {@link LongStream#mapMulti(LongStream.LongMapMultiConsumer) LongStream.mapMulti}
* to replace a long value with zero or more long values.
*
* <p>This is a <a href="../function/package-summary.html">functional interface</a>
* whose functional method is {@link #accept(long, LongConsumer)}.
*
* @see LongStream#mapMulti(LongStream.LongMapMultiConsumer)
*
* @since 16
*/
@FunctionalInterface
interface LongMapMultiConsumer {
/**
* Replaces the given {@code value} with zero or more values by feeding the mapped
* values to the {@code lc} consumer.
*
* @param value the long value coming from upstream
* @param lc a {@code LongConsumer} accepting the mapped values
*/
void accept(long value, LongConsumer lc);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@ -257,7 +257,7 @@ abstract class ReferencePipeline<P_IN, P_OUT>
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<P_OUT> opWrapSink(int flags, Sink<R> sink) {
return new Sink.ChainedReference<P_OUT, R>(sink) {
return new Sink.ChainedReference<>(sink) {
// true if cancellationRequested() has been called
boolean cancellationRequestedCalled;
@ -428,6 +428,103 @@ abstract class ReferencePipeline<P_IN, P_OUT>
};
}
@Override
public final <R> Stream<R> mapMulti(BiConsumer<? super P_OUT, ? super Consumer<R>> mapper) {
Objects.requireNonNull(mapper);
return new StatelessOp<>(this, StreamShape.REFERENCE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<P_OUT> opWrapSink(int flags, Sink<R> sink) {
return new Sink.ChainedReference<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (Consumer<R>) downstream);
}
};
}
};
}
@Override
public final IntStream mapMultiToInt(BiConsumer<? super P_OUT, ? super IntConsumer> mapper) {
Objects.requireNonNull(mapper);
return new IntPipeline.StatelessOp<>(this, StreamShape.REFERENCE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<P_OUT> opWrapSink(int flags, Sink<Integer> sink) {
return new Sink.ChainedReference<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (IntConsumer)downstream);
}
};
}
};
}
@Override
public final LongStream mapMultiToLong(BiConsumer<? super P_OUT, ? super LongConsumer> mapper) {
Objects.requireNonNull(mapper);
return new LongPipeline.StatelessOp<>(this, StreamShape.REFERENCE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<P_OUT> opWrapSink(int flags, Sink<Long> sink) {
return new Sink.ChainedReference<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (LongConsumer) downstream);
}
};
}
};
}
@Override
public final DoubleStream mapMultiToDouble(BiConsumer<? super P_OUT, ? super DoubleConsumer> mapper) {
Objects.requireNonNull(mapper);
return new DoublePipeline.StatelessOp<>(this, StreamShape.REFERENCE,
StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT | StreamOpFlag.NOT_SIZED) {
@Override
Sink<P_OUT> opWrapSink(int flags, Sink<Double> sink) {
return new Sink.ChainedReference<>(sink) {
@Override
public void begin(long size) {
downstream.begin(-1);
}
@Override
@SuppressWarnings("unchecked")
public void accept(P_OUT u) {
mapper.accept(u, (DoubleConsumer) downstream);
}
};
}
};
}
@Override
public final Stream<P_OUT> peek(Consumer<? super P_OUT> action) {
Objects.requireNonNull(action);

View File

@ -26,20 +26,17 @@ package java.util.stream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Objects;
import java.util.Optional;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.DoubleConsumer;
import java.util.function.Function;
import java.util.function.IntConsumer;
import java.util.function.IntFunction;
import java.util.function.LongConsumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.function.ToDoubleFunction;
@ -279,6 +276,7 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
* function to apply to each element which produces a stream
* of new values
* @return the new stream
* @see #mapMulti
*/
<R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper);
@ -342,6 +340,210 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
*/
DoubleStream flatMapToDouble(Function<? super T, ? extends DoubleStream> mapper);
/**
* Returns a stream consisting of the results of replacing each element of
* this stream with multiple elements, specifically zero or more elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain Consumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain Consumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMap flatMap} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with a {@code Consumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates a stream from the
* internal buffer. Finally, it returns this stream to {@code flatMap}.
*
* @apiNote
* This method is similar to {@link #flatMap flatMap} in that it applies a one-to-many
* transformation to the elements of the stream and flattens the result elements
* into a new stream. This method is preferable to {@code flatMap} in the following
* circumstances:
* <ul>
* <li>When replacing each stream element with a small (possibly zero) number of
* elements. Using this method avoids the overhead of creating a new Stream instance
* for every group of result elements, as required by {@code flatMap}.</li>
* <li>When it is easier to use an imperative approach for generating result
* elements than it is to return them in the form of a Stream.</li>
* </ul>
*
* <p>If a lambda expression is provided as the mapper function argument, additional type
* information maybe be necessary for proper inference of the element type {@code <R>} of
* the returned stream. This can be provided in the form of explicit type declarations for
* the lambda parameters or as an explicit type argument to the {@code mapMulti} call.
*
* <p><b>Examples</b>
*
* <p>Given a stream of {@code Number} objects, the following
* produces a list containing only the {@code Integer} objects:
* <pre>{@code
* Stream<Number> numbers = ... ;
* List<Integer> integers = numbers.<Integer>mapMulti((number, consumer) -> {
* if (number instanceof Integer)
* consumer.accept((Integer) number);
* })
* .collect(Collectors.toList());
* }</pre>
*
* <p>If we have an {@code Iterable<Object>} and need to recursively expand its elements
* that are themselves of type {@code Iterable}, we can use {@code mapMulti} as follows:
* <pre>{@code
* class C {
* static void expandIterable(Object e, Consumer<Object> c) {
* if (e instanceof Iterable) {
* for (Object ie: (Iterable<?>) e) {
* expandIterable(ie, c);
* }
* } else if (e != null) {
* c.accept(e);
* }
* }
*
* public static void main(String[] args) {
* Stream<Object> stream = ...;
* Stream<Object> expandedStream = stream.mapMulti(C::expandIterable);
* }
* }
* }</pre>
*
* @param <R> The element type of the new stream
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see #flatMap flatMap
* @since 16
*/
default <R> Stream<R> mapMulti(BiConsumer<? super T, ? super Consumer<R>> mapper) {
Objects.requireNonNull(mapper);
return flatMap(e -> {
SpinedBuffer<R> buffer = new SpinedBuffer<>();
mapper.accept(e, buffer);
return StreamSupport.stream(buffer.spliterator(), false);
});
}
/**
* Returns an {@code IntStream} consisting of the results of replacing each
* element of this stream with multiple elements, specifically zero or more
* elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain IntConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain IntConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMapToInt flatMapToInt} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with an {@code IntConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates an {@code IntStream} from
* the internal buffer. Finally, it returns this stream to {@code flatMapToInt}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see #mapMulti mapMulti
* @since 16
*/
default IntStream mapMultiToInt(BiConsumer<? super T, ? super IntConsumer> mapper) {
Objects.requireNonNull(mapper);
return flatMapToInt(e -> {
SpinedBuffer.OfInt buffer = new SpinedBuffer.OfInt();
mapper.accept(e, buffer);
return StreamSupport.intStream(buffer.spliterator(), false);
});
}
/**
* Returns a {@code LongStream} consisting of the results of replacing each
* element of this stream with multiple elements, specifically zero or more
* elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain LongConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain LongConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMapToLong flatMapToLong} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with a {@code LongConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates a {@code LongStream} from
* the internal buffer. Finally, it returns this stream to {@code flatMapToLong}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see #mapMulti mapMulti
* @since 16
*/
default LongStream mapMultiToLong(BiConsumer<? super T, ? super LongConsumer> mapper) {
Objects.requireNonNull(mapper);
return flatMapToLong(e -> {
SpinedBuffer.OfLong buffer = new SpinedBuffer.OfLong();
mapper.accept(e, buffer);
return StreamSupport.longStream(buffer.spliterator(), false);
});
}
/**
* Returns a {@code DoubleStream} consisting of the results of replacing each
* element of this stream with multiple elements, specifically zero or more
* elements.
* Replacement is performed by applying the provided mapping function to each
* element in conjunction with a {@linkplain DoubleConsumer consumer} argument
* that accepts replacement elements. The mapping function calls the consumer
* zero or more times to provide the replacement elements.
*
* <p>This is an <a href="package-summary.html#StreamOps">intermediate
* operation</a>.
*
* <p>If the {@linkplain DoubleConsumer consumer} argument is used outside the scope of
* its application to the mapping function, the results are undefined.
*
* @implSpec
* The default implementation invokes {@link #flatMapToDouble flatMapToDouble} on this stream,
* passing a function that behaves as follows. First, it calls the mapper function
* with an {@code DoubleConsumer} that accumulates replacement elements into a newly created
* internal buffer. When the mapper function returns, it creates a {@code DoubleStream} from
* the internal buffer. Finally, it returns this stream to {@code flatMapToDouble}.
*
* @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
* <a href="package-summary.html#Statelessness">stateless</a>
* function that generates replacement elements
* @return the new stream
* @see #mapMulti mapMulti
* @since 16
*/
default DoubleStream mapMultiToDouble(BiConsumer<? super T, ? super DoubleConsumer> mapper) {
Objects.requireNonNull(mapper);
return flatMapToDouble(e -> {
SpinedBuffer.OfDouble buffer = new SpinedBuffer.OfDouble();
mapper.accept(e, buffer);
return StreamSupport.doubleStream(buffer.spliterator(), false);
});
}
/**
* Returns a stream consisting of the distinct elements (according to
* {@link Object#equals(Object)}) of this stream.

View File

@ -32,17 +32,15 @@
#include "sun_nio_ch_NativeThread.h"
#include "nio_util.h"
#include <signal.h>
#include <pthread.h>
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 1)
#elif defined(_ALLBSD_SOURCE)
#include <pthread.h>
/* Also defined in net/bsd_close.c */
#define INTERRUPT_SIGNAL SIGIO
#else

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -262,10 +262,10 @@ public class FileHandler extends StreamHandler {
* Construct a default {@code FileHandler}. This will be configured
* entirely from {@code LogManager} properties (or their default values).
*
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control"))}.
* @exception NullPointerException if pattern property is an empty String.
* @throws NullPointerException if pattern property is an empty String.
*/
public FileHandler() throws IOException, SecurityException {
checkPermission();
@ -290,10 +290,10 @@ public class FileHandler extends StreamHandler {
* so use this with care.
*
* @param pattern the name of the output file
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern) throws IOException, SecurityException {
if (pattern.length() < 1 ) {
@ -322,10 +322,10 @@ public class FileHandler extends StreamHandler {
*
* @param pattern the name of the output file
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern, boolean append) throws IOException,
SecurityException {
@ -358,11 +358,11 @@ public class FileHandler extends StreamHandler {
* @param pattern the pattern for naming the output file
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern, int limit, int count)
throws IOException, SecurityException {
@ -396,11 +396,11 @@ public class FileHandler extends StreamHandler {
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*
*/
public FileHandler(String pattern, int limit, int count, boolean append)
@ -427,11 +427,11 @@ public class FileHandler extends StreamHandler {
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*
* @since 9
*
@ -769,7 +769,7 @@ public class FileHandler extends StreamHandler {
/**
* Close all the files.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -148,7 +148,7 @@ public abstract class Handler {
* should no longer be used. Method calls may either be silently
* ignored or may throw runtime exceptions.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public abstract void close() throws SecurityException;
@ -161,7 +161,7 @@ public abstract class Handler {
* which case the {@code Formatter} will be remembered, but not used.
*
* @param newFormatter the {@code Formatter} to use (may not be null)
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setFormatter(Formatter newFormatter) throws SecurityException {
@ -185,9 +185,9 @@ public abstract class Handler {
*
* @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is
* @throws UnsupportedEncodingException if the named encoding is
* not supported.
*/
public synchronized void setEncoding(String encoding)
@ -223,7 +223,7 @@ public abstract class Handler {
* {@code LogRecord} should be published or discarded.
*
* @param newFilter a {@code Filter} object (may be null)
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setFilter(Filter newFilter) throws SecurityException {
@ -247,7 +247,7 @@ public abstract class Handler {
* errors occur while using this Handler.
*
* @param em the new ErrorManager
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setErrorManager(ErrorManager em) {
@ -262,7 +262,7 @@ public abstract class Handler {
* Retrieves the ErrorManager for this Handler.
*
* @return the ErrorManager for this Handler
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public ErrorManager getErrorManager() {
@ -299,7 +299,7 @@ public abstract class Handler {
* {@code Handlers}.
*
* @param newLevel the new value for the log level
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setLevel(Level newLevel) throws SecurityException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -1184,7 +1184,7 @@ public class LogManager {
* @param logger the new logger.
* @return true if the argument logger was registered successfully,
* false if a logger of that name already exists.
* @exception NullPointerException if the logger name is null.
* @throws NullPointerException if the logger name is null.
*/
public boolean addLogger(Logger logger) {
final String name = logger.getName();
@ -2439,7 +2439,7 @@ public class LogManager {
* If the check fails we throw a SecurityException, otherwise
* we return normally.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
*/
public void checkAccess() throws SecurityException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -226,7 +226,7 @@ public class MemoryHandler extends Handler {
* Close the {@code Handler} and free all associated resources.
* This will also close the target {@code Handler}.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override
@ -241,7 +241,7 @@ public class MemoryHandler extends Handler {
* the {@code pushLevel}, then {@code push} will be called.
*
* @param newLevel the new value of the {@code pushLevel}
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setPushLevel(Level newLevel) throws SecurityException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -152,7 +152,7 @@ public class SocketHandler extends StreamHandler {
/**
* Close this output stream.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -119,7 +119,7 @@ public class StreamHandler extends Handler {
* Then the output stream is replaced with the new output stream.
*
* @param out New output stream. May not be null.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
@ -151,9 +151,9 @@ public class StreamHandler extends Handler {
*
* @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is
* @throws UnsupportedEncodingException if the named encoding is
* not supported.
*/
@Override
@ -282,7 +282,7 @@ public class StreamHandler extends Handler {
* yet been written to the stream, it will be written before the
* "tail" string.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
*/
@Override

View File

@ -464,6 +464,22 @@ public final class BinaryContainer implements SymbolTable {
return "_aot_inline_contiguous_allocation_supported";
}
public static String getVerifyOopsSymbolName() {
return "_aot_verify_oops";
}
public static String getVerifyOopCountAddressSymbolName() {
return "_aot_verify_oop_count_address";
}
public static String getVerifyOopBitsSymbolName() {
return "_aot_verify_oop_bits";
}
public static String getVerifyOopMaskSymbolName() {
return "_aot_verify_oop_mask";
}
public int getCodeSegmentSize() {
return codeSegmentSize;
}
@ -515,6 +531,10 @@ public final class BinaryContainer implements SymbolTable {
createGotSymbol(getPollingPageSymbolName());
createGotSymbol(getLogOfHeapRegionGrainBytesSymbolName());
createGotSymbol(getInlineContiguousAllocationSupportedSymbolName());
createGotSymbol(getVerifyOopsSymbolName());
createGotSymbol(getVerifyOopCountAddressSymbolName());
createGotSymbol(getVerifyOopBitsSymbolName());
createGotSymbol(getVerifyOopMaskSymbolName());
for (HashMap.Entry<String, String> entry : functionNamesToAOTSymbols.entrySet()) {
createGotSymbol(entry.getValue());

View File

@ -54,6 +54,7 @@ import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues;
import org.graalvm.compiler.hotspot.HotSpotGraalRuntime;
import org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC;
import org.graalvm.compiler.hotspot.HotSpotHostBackend;
import org.graalvm.compiler.hotspot.HotSpotMarkId;
import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin;
import org.graalvm.compiler.java.GraphBuilderPhase;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
@ -177,6 +178,15 @@ public final class Main {
graalOptions = new OptionValues(graalOptions, GeneratePIC, true, ImmutableCode, true);
GraalJVMCICompiler graalCompiler = HotSpotGraalCompilerFactory.createCompiler("JAOTC", JVMCI.getRuntime(), graalOptions, CompilerConfigurationFactory.selectFactory(null, graalOptions));
HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) graalCompiler.getGraalRuntime();
GraalHotSpotVMConfig graalHotSpotVMConfig = runtime.getVMConfig();
if (graalHotSpotVMConfig.verifyOops) {
if (!HotSpotMarkId.VERIFY_OOPS.isAvailable() || !HotSpotMarkId.VERIFY_OOP_COUNT_ADDRESS.isAvailable()) {
System.err.println("Running jaotc with -XX:+VerifyOops is not supported by this JDK");
return false;
}
}
HotSpotHostBackend backend = (HotSpotHostBackend) runtime.getCapability(RuntimeProvider.class).getHostBackend();
MetaAccessProvider metaAccess = backend.getProviders().getMetaAccess();
filters = new GraalFilters(metaAccess);
@ -207,12 +217,12 @@ public final class Main {
return false;
}
};
AOTBackend aotBackend = new AOTBackend(this, graalOptions, backend, indyPlugin);
SnippetReflectionProvider snippetReflection = aotBackend.getProviders().getSnippetReflection();
AOTCompiler compiler = new AOTCompiler(this, graalOptions, aotBackend, options.threads);
classes = compiler.compileClasses(classes);
GraalHotSpotVMConfig graalHotSpotVMConfig = runtime.getVMConfig();
PhaseSuite<HighTierContext> graphBuilderSuite = aotBackend.getGraphBuilderSuite();
ListIterator<BasePhase<? super HighTierContext>> iterator = graphBuilderSuite.findPhase(GraphBuilderPhase.class);
GraphBuilderConfiguration graphBuilderConfig = ((GraphBuilderPhase) iterator.previous()).getGraphBuilderConfig();

View File

@ -69,6 +69,10 @@ final class MarkProcessor {
case NARROW_OOP_BASE_ADDRESS:
case CRC_TABLE_ADDRESS:
case LOG_OF_HEAP_REGION_GRAIN_BYTES:
case VERIFY_OOPS:
case VERIFY_OOP_BITS:
case VERIFY_OOP_MASK:
case VERIFY_OOP_COUNT_ADDRESS:
String vmSymbolName;
switch (markId) {
case POLL_FAR:
@ -90,6 +94,18 @@ final class MarkProcessor {
case LOG_OF_HEAP_REGION_GRAIN_BYTES:
vmSymbolName = BinaryContainer.getLogOfHeapRegionGrainBytesSymbolName();
break;
case VERIFY_OOPS:
vmSymbolName = BinaryContainer.getVerifyOopsSymbolName();
break;
case VERIFY_OOP_COUNT_ADDRESS:
vmSymbolName = BinaryContainer.getVerifyOopCountAddressSymbolName();
break;
case VERIFY_OOP_BITS:
vmSymbolName = BinaryContainer.getVerifyOopBitsSymbolName();
break;
case VERIFY_OOP_MASK:
vmSymbolName = BinaryContainer.getVerifyOopMaskSymbolName();
break;
default:
throw new InternalError("Unhandled mark: " + mark);
}

View File

@ -198,6 +198,9 @@ public final class GraalOptions {
@Option(help = "Generate position independent code", type = OptionType.Expert)
public static final OptionKey<Boolean> GeneratePIC = new OptionKey<>(false);
@Option(help = "Generate verify oop checks in AOT code", type = OptionType.Expert)
public static final OptionKey<Boolean> AOTVerifyOops = new OptionKey<>(false);
// Runtime settings
@Option(help = "", type = OptionType.Expert)
public static final OptionKey<Boolean> SupportJsrBytecodes = new OptionKey<>(true);

View File

@ -27,6 +27,7 @@ package org.graalvm.compiler.hotspot;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;
import org.graalvm.compiler.api.replacements.Fold;
import org.graalvm.compiler.api.replacements.Fold.InjectedParameter;
@ -64,6 +65,7 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
assert check();
reportErrors();
populateMarkConstants();
}
private final CompressEncoding oopEncoding;
@ -893,25 +895,6 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
private static final boolean JDK_8245443 = ((JDK == 11 && JDK_UPDATE >= 8) || JDK >= 15);
// Checkstyle: stop
public final int VERIFIED_ENTRY = getConstant("CodeInstaller::VERIFIED_ENTRY", Integer.class);
public final int UNVERIFIED_ENTRY = getConstant("CodeInstaller::UNVERIFIED_ENTRY", Integer.class);
public final int OSR_ENTRY = getConstant("CodeInstaller::OSR_ENTRY", Integer.class);
public final int EXCEPTION_HANDLER_ENTRY = getConstant("CodeInstaller::EXCEPTION_HANDLER_ENTRY", Integer.class);
public final int DEOPT_HANDLER_ENTRY = getConstant("CodeInstaller::DEOPT_HANDLER_ENTRY", Integer.class);
public final int DEOPT_MH_HANDLER_ENTRY = getConstant("CodeInstaller::DEOPT_MH_HANDLER_ENTRY", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16));
public final int FRAME_COMPLETE = getConstant("CodeInstaller::FRAME_COMPLETE", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_1_b01) : JDK_8245443));
public final int INVOKEINTERFACE = getConstant("CodeInstaller::INVOKEINTERFACE", Integer.class);
public final int INVOKEVIRTUAL = getConstant("CodeInstaller::INVOKEVIRTUAL", Integer.class);
public final int INVOKESTATIC = getConstant("CodeInstaller::INVOKESTATIC", Integer.class);
public final int INVOKESPECIAL = getConstant("CodeInstaller::INVOKESPECIAL", Integer.class);
public final int INLINE_INVOKE = getConstant("CodeInstaller::INLINE_INVOKE", Integer.class);
public final int POLL_NEAR = getConstant("CodeInstaller::POLL_NEAR", Integer.class);
public final int POLL_RETURN_NEAR = getConstant("CodeInstaller::POLL_RETURN_NEAR", Integer.class);
public final int POLL_FAR = getConstant("CodeInstaller::POLL_FAR", Integer.class);
public final int POLL_RETURN_FAR = getConstant("CodeInstaller::POLL_RETURN_FAR", Integer.class);
public final int CARD_TABLE_SHIFT = getConstant("CodeInstaller::CARD_TABLE_SHIFT", Integer.class);
public final int CARD_TABLE_ADDRESS = getConstant("CodeInstaller::CARD_TABLE_ADDRESS", Integer.class);
public final int INVOKE_INVALID = getConstant("CodeInstaller::INVOKE_INVALID", Integer.class);
public final int VMINTRINSIC_FIRST_MH_SIG_POLY = getConstant("vmIntrinsics::FIRST_MH_SIG_POLY", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16));
public final int VMINTRINSIC_LAST_MH_SIG_POLY = getConstant("vmIntrinsics::LAST_MH_SIG_POLY", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16));
public final int VMINTRINSIC_INVOKE_GENERIC = getConstant("vmIntrinsics::_invokeGeneric", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16));
@ -920,17 +903,51 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
public final boolean CPU_HAS_INTEL_JCC_ERRATUM = getFieldValue("VM_Version::_has_intel_jcc_erratum", Boolean.class, "bool",
true, "amd64".equals(osArch) && (JVMCI ? jvmciGE(JVMCI_20_1_b01) : JDK >= 15));
/**
* The following constants are given default values here since they are missing in the native
* JVMCI-8 code but are still required for {@link HotSpotMarkId} to work in a JDK8 environment.
*/
public final int NARROW_KLASS_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_KLASS_BASE_ADDRESS", Integer.class, 19, JDK > 9);
public final int NARROW_OOP_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_OOP_BASE_ADDRESS", Integer.class, 20, JDK > 9);
public final int CRC_TABLE_ADDRESS = getConstant("CodeInstaller::CRC_TABLE_ADDRESS", Integer.class, 21, JDK > 9);
public final int LOG_OF_HEAP_REGION_GRAIN_BYTES = getConstant("CodeInstaller::LOG_OF_HEAP_REGION_GRAIN_BYTES", Integer.class, 22, JDK > 9);
// Checkstyle: resume
private static void checkForMissingRequiredValue(HotSpotMarkId markId, boolean required) {
if (!markId.isAvailable() && required) {
GraalHotSpotVMConfigAccess.reportError("Unsupported Mark " + markId);
}
}
private void populateMarkConstants() {
boolean jdk13JvmciBackport = (JVMCI && JDK > 8) ? jvmciGE(JVMCI_19_3_b03) : JDK > 9;
boolean verifyOopsMarkSupported = JDK >= 16;
Map<String, Long> constants = getStore().getConstants();
for (HotSpotMarkId markId : HotSpotMarkId.values()) {
Integer value = null;
String key = "CodeInstaller::" + markId.name();
Long result = constants.get(key);
if (result != null) {
value = result.intValue();
}
markId.setValue(value);
switch (markId) {
case FRAME_COMPLETE:
checkForMissingRequiredValue(markId, JVMCI ? jvmciGE(JVMCI_20_1_b01) : JDK_8245443);
break;
case DEOPT_MH_HANDLER_ENTRY:
checkForMissingRequiredValue(markId, JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16);
break;
case NARROW_KLASS_BASE_ADDRESS:
case CRC_TABLE_ADDRESS:
case NARROW_OOP_BASE_ADDRESS:
case LOG_OF_HEAP_REGION_GRAIN_BYTES:
checkForMissingRequiredValue(markId, jdk13JvmciBackport);
break;
case VERIFY_OOPS:
case VERIFY_OOP_BITS:
case VERIFY_OOP_MASK:
case VERIFY_OOP_COUNT_ADDRESS:
checkForMissingRequiredValue(markId, verifyOopsMarkSupported);
break;
default:
checkForMissingRequiredValue(markId, true);
}
}
}
protected boolean check() {
for (Field f : getClass().getDeclaredFields()) {
int modifiers = f.getModifiers();
@ -952,7 +969,7 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
}
public boolean supportsMethodHandleDeoptimizationEntry() {
return DEOPT_MH_HANDLER_ENTRY != -1 && VMINTRINSIC_FIRST_MH_SIG_POLY != -1 && VMINTRINSIC_LAST_MH_SIG_POLY != -1 && VMINTRINSIC_INVOKE_GENERIC != -1 &&
return HotSpotMarkId.DEOPT_MH_HANDLER_ENTRY.isAvailable() && VMINTRINSIC_FIRST_MH_SIG_POLY != -1 && VMINTRINSIC_LAST_MH_SIG_POLY != -1 && VMINTRINSIC_INVOKE_GENERIC != -1 &&
VMINTRINSIC_COMPILED_LAMBDA_FORM != -1;
}

View File

@ -26,6 +26,7 @@ package org.graalvm.compiler.hotspot;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Formatter;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -127,6 +128,7 @@ public class GraalHotSpotVMConfigAccess {
public final String osArch;
protected static final Version JVMCI_0_55 = new Version2(0, 55);
protected static final Version JVMCI_20_2_b04 = new Version3(20, 2, 4);
protected static final Version JVMCI_20_2_b01 = new Version3(20, 2, 1);
protected static final Version JVMCI_20_1_b01 = new Version3(20, 1, 1);
protected static final Version JVMCI_20_0_b03 = new Version3(20, 0, 3);
@ -135,7 +137,7 @@ public class GraalHotSpotVMConfigAccess {
protected static final Version JVMCI_19_3_b07 = new Version3(19, 3, 7);
public static boolean jvmciGE(Version v) {
return JVMCI_PRERELEASE || !JVMCI_VERSION.isLessThan(v);
return !JVMCI_VERSION.isLessThan(v);
}
public static final int JDK = JavaVersionUtil.JAVA_SPEC;
@ -143,12 +145,12 @@ public class GraalHotSpotVMConfigAccess {
public static final boolean IS_OPENJDK = getProperty("java.vm.name", "").startsWith("OpenJDK");
public static final Version JVMCI_VERSION;
public static final boolean JVMCI;
public static final boolean JVMCI_PRERELEASE;
public static final boolean JDK_PRERELEASE;
static {
String vmVersion = getProperty("java.vm.version");
JVMCI_VERSION = Version.parse(vmVersion);
JVMCI_PRERELEASE = vmVersion.contains("SNAPSHOT") || vmVersion.contains("internal") || vmVersion.contains("-dev");
JVMCI = JVMCI_VERSION != null || JVMCI_PRERELEASE;
JDK_PRERELEASE = vmVersion.contains("SNAPSHOT") || vmVersion.contains("-dev");
JVMCI = JVMCI_VERSION != null;
}
private final List<String> missing = new ArrayList<>();
@ -179,7 +181,7 @@ public class GraalHotSpotVMConfigAccess {
private boolean deferErrors = this instanceof GraalHotSpotVMConfig;
private void recordError(String name, List<String> list, String unexpectedValue) {
if (JVMCI_PRERELEASE) {
if (JDK_PRERELEASE) {
return;
}
String message = name;
@ -224,7 +226,25 @@ public class GraalHotSpotVMConfigAccess {
messages.add(String.format("VM config values not expected to be present in %s:%n %s", runtime,
unexpected.stream().sorted().collect(Collectors.joining(System.lineSeparator() + " "))));
}
throw new JVMCIError(String.join(System.lineSeparator(), messages));
reportError(String.join(System.lineSeparator(), messages));
}
}
static void reportError(String rawErrorMessage) {
String value = getProperty("JVMCI_CONFIG_CHECK");
Formatter errorMessage = new Formatter().format(rawErrorMessage);
String javaHome = getProperty("java.home");
String vmName = getProperty("java.vm.name");
errorMessage.format("%nSet the JVMCI_CONFIG_CHECK system property to \"ignore\" to suppress ");
errorMessage.format("this error or to \"warn\" to emit a warning and continue execution.%n");
errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
errorMessage.format("Currently used VM configuration is: %s%n", vmName);
if ("ignore".equals(value)) {
return;
} else if ("warn".equals(value) || JDK_PRERELEASE) {
System.err.println(errorMessage.toString());
} else {
throw new JVMCIError(errorMessage.toString());
}
}

View File

@ -25,12 +25,9 @@
package org.graalvm.compiler.hotspot;
import static org.graalvm.compiler.debug.GraalError.shouldNotReachHere;
import org.graalvm.compiler.code.CompilationResult;
import jdk.vm.ci.common.NativeImageReinitialize;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
/**
* Constants used to mark special positions in code being installed into the code cache by Graal C++
@ -43,7 +40,7 @@ public enum HotSpotMarkId implements CompilationResult.MarkId {
EXCEPTION_HANDLER_ENTRY(false),
DEOPT_HANDLER_ENTRY(false),
DEOPT_MH_HANDLER_ENTRY(false),
FRAME_COMPLETE(true, true),
FRAME_COMPLETE(true),
INVOKEINTERFACE(false),
INVOKEVIRTUAL(false),
INVOKESTATIC(false),
@ -57,31 +54,22 @@ public enum HotSpotMarkId implements CompilationResult.MarkId {
NARROW_KLASS_BASE_ADDRESS(true),
NARROW_OOP_BASE_ADDRESS(true),
CRC_TABLE_ADDRESS(true),
LOG_OF_HEAP_REGION_GRAIN_BYTES(true);
LOG_OF_HEAP_REGION_GRAIN_BYTES(true),
VERIFY_OOPS(true),
VERIFY_OOP_BITS(true),
VERIFY_OOP_MASK(true),
VERIFY_OOP_COUNT_ADDRESS(true);
private final boolean isMarkAfter;
@NativeImageReinitialize private Integer value;
private final boolean optional;
HotSpotMarkId(boolean isMarkAfter) {
this(isMarkAfter, false);
}
HotSpotMarkId(boolean isMarkAfter, boolean optional) {
this.isMarkAfter = isMarkAfter;
this.optional = optional;
this.value = null;
}
private Integer getValue() {
if (value == null) {
Long result = HotSpotJVMCIRuntime.runtime().getConfigStore().getConstants().get("CodeInstaller::" + name());
if (result != null) {
this.value = result.intValue();
} else if (!optional) {
throw shouldNotReachHere("Unsupported Mark " + name());
}
}
return value;
void setValue(Integer value) {
this.value = value;
}
@Override
@ -92,7 +80,7 @@ public enum HotSpotMarkId implements CompilationResult.MarkId {
@Override
public Object getId() {
assert isAvailable() : this;
return getValue();
return value;
}
@Override
@ -101,14 +89,14 @@ public enum HotSpotMarkId implements CompilationResult.MarkId {
}
public boolean isAvailable() {
return getValue() != null;
return value != null;
}
@Override
public String toString() {
return "HotSpotCodeMark{" + name() +
", value=" + getValue() +
", optional=" + optional +
", value=" + value +
'}';
}
}

View File

@ -25,6 +25,7 @@
package org.graalvm.compiler.hotspot.nodes;
import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
import static org.graalvm.compiler.core.common.GraalOptions.AOTVerifyOops;
import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1;
import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
@ -70,6 +71,7 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
super(TYPE, stamp);
this.config = config;
this.markId = markId;
assert markId != null;
}
/**
@ -83,6 +85,7 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
super(TYPE, StampFactory.forKind(kind));
this.config = config;
this.markId = markId;
assert markId != null;
}
@Override
@ -97,6 +100,9 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
@NodeIntrinsic
private static native int loadIntConfigValue(@ConstantNodeParameter HotSpotMarkId markId);
@NodeIntrinsic
private static native boolean loadBoolConfigValue(@ConstantNodeParameter HotSpotMarkId markId);
public static long cardTableAddress() {
return loadLongConfigValue(HotSpotMarkId.CARD_TABLE_ADDRESS);
}
@ -109,6 +115,22 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
return loadIntConfigValue(HotSpotMarkId.LOG_OF_HEAP_REGION_GRAIN_BYTES);
}
public static boolean verifyOops() {
return loadBoolConfigValue(HotSpotMarkId.VERIFY_OOPS);
}
public static long verifyOopBits() {
return loadLongConfigValue(HotSpotMarkId.VERIFY_OOP_BITS);
}
public static long verifyOopMask() {
return loadLongConfigValue(HotSpotMarkId.VERIFY_OOP_MASK);
}
public static long verifyOopCounterAddress() {
return loadLongConfigValue(HotSpotMarkId.VERIFY_OOP_COUNT_ADDRESS);
}
public static boolean intrinsify(GraphBuilderContext b, @InjectedNodeParameter Stamp returnStamp, @InjectedNodeParameter GraalHotSpotVMConfig config, HotSpotMarkId mark) {
if (b.getReplacements().isEncodingSnippets()) {
// This plugin must be deferred so that these constants aren't embedded in libgraal
@ -120,19 +142,36 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
@Override
public Node canonical(CanonicalizerTool tool) {
Boolean generatePIC = GeneratePIC.getValue(tool.getOptions());
if (markId == null) {
return ConstantNode.forBoolean(!generatePIC);
} else if (!generatePIC) {
boolean generatePIC = GeneratePIC.getValue(tool.getOptions());
boolean aotVerifyOops = AOTVerifyOops.getValue(tool.getOptions());
if (!generatePIC || !markId.isAvailable()) {
if (markId == HotSpotMarkId.CARD_TABLE_ADDRESS) {
return ConstantNode.forLong(config.cardtableStartAddress);
} else if (markId == HotSpotMarkId.CRC_TABLE_ADDRESS) {
return ConstantNode.forLong(config.crcTableAddress);
} else if (markId == HotSpotMarkId.LOG_OF_HEAP_REGION_GRAIN_BYTES) {
return ConstantNode.forInt(config.logOfHRGrainBytes);
} else if (markId == HotSpotMarkId.VERIFY_OOPS) {
return ConstantNode.forBoolean(config.verifyOops);
} else if (markId == HotSpotMarkId.VERIFY_OOP_BITS) {
return ConstantNode.forLong(config.verifyOopBits);
} else if (markId == HotSpotMarkId.VERIFY_OOP_MASK) {
return ConstantNode.forLong(config.verifyOopMask);
} else if (markId == HotSpotMarkId.VERIFY_OOP_COUNT_ADDRESS) {
return ConstantNode.forLong(config.verifyOopCounterAddress);
} else {
throw GraalError.shouldNotReachHere(markId.toString());
}
} else if (generatePIC && !aotVerifyOops) {
if (markId == HotSpotMarkId.VERIFY_OOPS) {
return ConstantNode.forBoolean(false);
} else if (markId == HotSpotMarkId.VERIFY_OOP_BITS) {
return ConstantNode.forLong(0L);
} else if (markId == HotSpotMarkId.VERIFY_OOP_MASK) {
return ConstantNode.forLong(0L);
} else if (markId == HotSpotMarkId.VERIFY_OOP_COUNT_ADDRESS) {
return ConstantNode.forLong(0L);
}
}
return this;
}

View File

@ -149,7 +149,7 @@ public final class HotSpotG1WriteBarrierSnippets extends G1WriteBarrierSnippets
@Override
protected boolean verifyOops() {
return HotSpotReplacementsUtil.verifyOops(INJECTED_VMCONFIG);
return GraalHotSpotVMConfigNode.verifyOops();
}
@Override

View File

@ -41,6 +41,7 @@ import org.graalvm.compiler.graph.Node.ConstantNodeParameter;
import org.graalvm.compiler.graph.Node.NodeIntrinsic;
import org.graalvm.compiler.graph.spi.CanonicalizerTool;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
import org.graalvm.compiler.hotspot.word.KlassPointer;
import org.graalvm.compiler.nodes.CanonicalizableLocation;
import org.graalvm.compiler.nodes.CompressionNode;
@ -192,11 +193,6 @@ public class HotSpotReplacementsUtil {
return config.useG1GC;
}
@Fold
public static boolean verifyOops(@InjectedParameter GraalHotSpotVMConfig config) {
return config.verifyOops;
}
/**
* @see GraalHotSpotVMConfig#doingUnsafeAccessOffset
*/
@ -726,7 +722,7 @@ public class HotSpotReplacementsUtil {
}
public static Object verifyOop(Object object) {
if (verifyOops(INJECTED_VMCONFIG)) {
if (GraalHotSpotVMConfigNode.verifyOops()) {
verifyOopStub(VERIFY_OOP, object);
}
return object;

View File

@ -29,7 +29,6 @@ import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFI
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.clearPendingException;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getPendingException;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadHubIntrinsic;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.verifyOops;
import static org.graalvm.compiler.hotspot.stubs.StubUtil.fatal;
import org.graalvm.compiler.api.replacements.Fold;
@ -39,6 +38,7 @@ import org.graalvm.compiler.debug.DebugHandlersFactory;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
import org.graalvm.compiler.hotspot.nodes.DeoptimizeCallerNode;
import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
import org.graalvm.compiler.hotspot.word.KlassPointer;
import org.graalvm.compiler.nodes.NamedLocationIdentity;
import org.graalvm.compiler.nodes.PiNode;
@ -87,15 +87,15 @@ public class ForeignCallSnippets implements Snippets {
*/
@Snippet
public static Object verifyObject(Object object) {
if (verifyOops(INJECTED_VMCONFIG)) {
Word verifyOopCounter = WordFactory.unsigned(verifyOopCounterAddress(INJECTED_VMCONFIG));
if (GraalHotSpotVMConfigNode.verifyOops()) {
Word verifyOopCounter = WordFactory.unsigned(GraalHotSpotVMConfigNode.verifyOopCounterAddress());
verifyOopCounter.writeInt(0, verifyOopCounter.readInt(0) + 1);
Pointer oop = Word.objectToTrackedPointer(object);
if (object != null) {
GuardingNode anchorNode = SnippetAnchorNode.anchor();
// make sure object is 'reasonable'
if (!oop.and(WordFactory.unsigned(verifyOopMask(INJECTED_VMCONFIG))).equal(WordFactory.unsigned(verifyOopBits(INJECTED_VMCONFIG)))) {
if (!oop.and(WordFactory.unsigned(GraalHotSpotVMConfigNode.verifyOopMask())).equal(WordFactory.unsigned(GraalHotSpotVMConfigNode.verifyOopBits()))) {
fatal("oop not in heap: %p", oop.rawValue());
}
@ -108,11 +108,6 @@ public class ForeignCallSnippets implements Snippets {
return object;
}
@Fold
static long verifyOopCounterAddress(@InjectedParameter GraalHotSpotVMConfig config) {
return config.verifyOopCounterAddress;
}
@Fold
static long verifyOopMask(@InjectedParameter GraalHotSpotVMConfig config) {
return config.verifyOopMask;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, 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
@ -702,15 +702,24 @@ static jdwpTransportError startListening(struct addrinfo *ai, int *socket, char*
return JDWPTRANSPORT_ERROR_NONE;
}
static int isEqualIPv6Addr(const struct addrinfo *ai, const struct in6_addr in6Addr)
{
if (ai->ai_addr->sa_family == AF_INET6) {
const struct sockaddr_in6 sa = *((struct sockaddr_in6*) ai->ai_addr);
return (memcmp(&sa.sin6_addr, &in6Addr, sizeof(in6Addr)) == 0);
}
return 0;
}
static jdwpTransportError JNICALL
socketTransport_startListening(jdwpTransportEnv* env, const char* address,
char** actualAddress)
{
int err;
int pass;
struct addrinfo *addrInfo = NULL;
struct addrinfo *listenAddr = NULL;
struct addrinfo *ai = NULL;
struct in6_addr mappedAny = IN6ADDR_ANY_INIT;
/* no address provided */
if ((address == NULL) || (address[0] == '\0')) {
@ -722,23 +731,42 @@ socketTransport_startListening(jdwpTransportEnv* env, const char* address,
return err;
}
/* 1st pass - preferredAddressFamily (by default IPv4), 2nd pass - the rest */
for (pass = 0; pass < 2 && listenAddr == NULL; pass++) {
for (ai = addrInfo; ai != NULL; ai = ai->ai_next) {
if ((pass == 0 && ai->ai_family == preferredAddressFamily) ||
(pass == 1 && ai->ai_family != preferredAddressFamily))
{
listenAddr = ai;
break;
}
// Try to find bind address of preferred address family first.
for (ai = addrInfo; ai != NULL; ai = ai->ai_next) {
if (ai->ai_family == preferredAddressFamily) {
listenAddr = ai;
break;
}
}
if (listenAddr == NULL) {
// No address of preferred addres family found, grab the fist one.
listenAddr = &(addrInfo[0]);
}
if (listenAddr == NULL) {
dbgsysFreeAddrInfo(addrInfo);
RETURN_ERROR(JDWPTRANSPORT_ERROR_INTERNAL, "listen failed: wrong address");
}
// Binding to IN6ADDR_ANY allows to serve both IPv4 and IPv6 connections,
// but binding to mapped INADDR_ANY (::ffff:0.0.0.0) allows to serve IPv4
// connections only. Make sure that IN6ADDR_ANY is preferred over
// mapped INADDR_ANY if preferredAddressFamily is AF_INET6 or not set.
if (preferredAddressFamily != AF_INET) {
inet_pton(AF_INET6, "::ffff:0.0.0.0", &mappedAny);
if (isEqualIPv6Addr(listenAddr, mappedAny)) {
for (ai = addrInfo; ai != NULL; ai = ai->ai_next) {
if (isEqualIPv6Addr(listenAddr, in6addr_any)) {
listenAddr = ai;
break;
}
}
}
}
err = startListening(listenAddr, &serverSocketFD, actualAddress);
dbgsysFreeAddrInfo(addrInfo);

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2020, 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.
*/
/*
* @test
* @bug 8249607
* @summary A LoadNode is pinned in split_if_with_blocks_post() on a loop exit node x that is part of a strip mined loop. It has a late control y outside
the outer strip mined loop. After pre-main-post, the dominator chain of y does not include x anymore resulting in an assertion failure.
* @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.loopopts.TestSplitIfPinnedLoadInStripMinedLoop::*
* compiler.loopopts.TestSplitIfPinnedLoadInStripMinedLoop
*/
package compiler.loopopts;
public class TestSplitIfPinnedLoadInStripMinedLoop {
public boolean bFld = false;
public short sFld = 4;
public static int iFld = 5;
public static float fFld= 6.0f;
public static int iArrFld[] = new int[400];
public void test() {
int x = 7;
int y = 8;
int a = 9;
float f = 10.0f;
double d = 11.0f;
double dArr[] = new double[400];
for (int i = 16; i < 350; i++) {
for (int j = 1; j < 75; j++) {
for (int k = 1; k < 3; k++) {
}
f = j * 6;
y = j;
try {
x = (y / 148);
} catch (ArithmeticException a_e) {}
if (bFld) {
break;
}
dArr[1] = 4;
}
for (int k = 75; k > i; k--) {
iArrFld[k] = 5;
}
for (int k = 4; k < 75; k++) {
f -= fFld;
// The LoadSNode for sFld is cloned in split_if_with_blocks_post() for each use such that they can float out of the loop. All control
// inputs of the clone are set to the latest control of the original LoadSNode which in this case is the StoreSNode for iFld that is
// aninput to a MergeMemNode which is an input to the SafePointNode in the outer strip mined loop. Both these nodes are not part
// of the loop body and thus the StoreNode is also not part of the loop anymore. This means that all the new LoadNode clones get
// the loop exit l inside the outer strip mined loop as control input. Some of these clones (**) have a late control outside of
// this outer strip mined loop. The dominator chain from the controls nodes of (**) contain l. However, after pre-main-post, we
// insert additional Region nodes but do not account for these control inputs of the LoadSNodes. They remain unchanged and still
// have l as control input. As a consequence, we do not find l on the dominator chains from the control nodes of (**) anymore
// resulting in a dominator assertion failure.
iFld = sFld;
}
switch ((i % 8) + 27) {
case 27:
if (bFld) {
for (a = 1; a < 75; a++) {
iFld += 6; // (**)
}
} else {
d -= x;
}
break;
case 28:
iFld = y;
// Fall through
case 33:
case 34:
iFld -= (int)d; // (**)
break;
}
}
}
public static void main(String[] strArr) {
TestSplitIfPinnedLoadInStripMinedLoop t = new TestSplitIfPinnedLoadInStripMinedLoop();
for (int i = 0; i < 10; i++) {
t.test();
}
}
}

View File

@ -44,6 +44,6 @@
* @build vm.mlvm.mixed.stress.java.findDeadlock.INDIFY_Test
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
* @run main/othervm vm.mlvm.mixed.stress.java.findDeadlock.INDIFY_Test
* @run main/othervm -Xlog:gc,safepoint vm.mlvm.mixed.stress.java.findDeadlock.INDIFY_Test
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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,7 +33,6 @@ import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Supplier;
@ -74,6 +73,7 @@ public class FlatMapOpTest extends OpTestCase {
assertCountSum(countTo(10).stream().flatMap(mfId), 10, 55);
assertCountSum(countTo(10).stream().flatMap(mfNull), 0, 0);
assertCountSum(countTo(3).stream().flatMap(mfLt), 6, 4);
assertCountSum(countTo(10).stream().flatMap(e -> Stream.empty()), 0, 0);
exerciseOps(TestData.Factory.ofArray("stringsArray", stringsArray), s -> s.flatMap(flattenChars));
exerciseOps(TestData.Factory.ofArray("LONG_STRING", new String[] {LONG_STRING}), s -> s.flatMap(flattenChars));

View File

@ -0,0 +1,323 @@
/*
* Copyright (c) 2020, 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.
*/
/*
* @test
* @summary Test mapMulti(BiConsumer) and primitive stream operations
*/
package org.openjdk.tests.java.util.stream;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.Collection;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.DefaultMethodStreams;
import java.util.stream.DoubleStream;
import java.util.stream.DoubleStreamTestDataProvider;
import java.util.stream.IntStream;
import java.util.stream.IntStreamTestDataProvider;
import java.util.stream.LongStream;
import java.util.stream.LongStreamTestDataProvider;
import java.util.stream.OpTestCase;
import java.util.stream.Stream;
import java.util.stream.StreamTestDataProvider;
import java.util.stream.TestData;
import static java.util.stream.DefaultMethodStreams.delegateTo;
import static java.util.stream.LambdaTestHelpers.LONG_STRING;
import static java.util.stream.LambdaTestHelpers.assertConcat;
import static java.util.stream.LambdaTestHelpers.assertContents;
import static java.util.stream.LambdaTestHelpers.assertCountSum;
import static java.util.stream.LambdaTestHelpers.countTo;
import static java.util.stream.LambdaTestHelpers.flattenChars;
import static java.util.stream.LambdaTestHelpers.mfId;
import static java.util.stream.LambdaTestHelpers.mfLt;
import static java.util.stream.LambdaTestHelpers.mfNull;
import static java.util.stream.ThrowableHelper.checkNPE;
@Test
public class mapMultiOpTest extends OpTestCase {
BiConsumer<Integer, Consumer<Integer>> nullConsumer =
(e, sink) -> mfNull.apply(e).forEach(sink);
BiConsumer<Integer, Consumer<Integer>> idConsumer =
(e, sink) -> mfId.apply(e).forEach(sink);
BiConsumer<Integer, Consumer<Integer>> listConsumer =
(e, sink) -> mfLt.apply(e).forEach(sink);
BiConsumer<String, Consumer<Character>> charConsumer =
(e, sink) -> flattenChars.apply(e).forEach(sink);
BiConsumer<Integer, Consumer<Integer>> emptyStreamConsumer =
(e, sink) -> Stream.empty().forEach(i -> sink.accept((Integer) i));
BiConsumer<Integer, Consumer<Integer>> intRangeConsumer =
(e, sink) -> IntStream.range(0, e).boxed().forEach(sink);
BiConsumer<Integer, Consumer<Integer>> rangeConsumerWithLimit =
(e, sink) -> IntStream.range(0, e).boxed().limit(10).forEach(sink);
@DataProvider(name = "Stream<Integer>")
public Object[][] streamProvider() {
return new Object[][]{
{Stream.of(0, 1, 2)},
{DefaultMethodStreams.delegateTo(Stream.of(0, 1, 2))}
};
}
@Test(dataProvider = "Stream<Integer>")
public void testNullMapper(Stream<Integer> s) {
checkNPE(() -> s.mapMulti(null));
checkNPE(() -> s.mapMultiToInt(null));
checkNPE(() -> s.mapMultiToDouble(null));
checkNPE(() -> s.mapMultiToLong(null));
}
@Test
public void testMapMulti() {
String[] stringsArray = {"hello", "there", "", "yada"};
Stream<String> strings = Arrays.asList(stringsArray).stream();
assertConcat(strings.mapMulti(charConsumer)
.iterator(), "hellothereyada");
assertCountSum((countTo(10).stream().mapMulti(idConsumer)),
10, 55);
assertCountSum(countTo(10).stream().mapMulti(nullConsumer),
0, 0);
assertCountSum(countTo(3).stream().mapMulti(listConsumer),
6, 4);
exerciseOps(TestData.Factory.ofArray("stringsArray",
stringsArray), s -> s.mapMulti(charConsumer));
exerciseOps(TestData.Factory.ofArray("LONG_STRING",
new String[]{LONG_STRING}), s -> s.mapMulti(charConsumer));
}
@Test
public void testDefaultMapMulti() {
String[] stringsArray = {"hello", "there", "", "yada"};
Stream<String> strings = Arrays.stream(stringsArray);
assertConcat(delegateTo(strings)
.mapMulti(charConsumer).iterator(), "hellothereyada");
assertCountSum(delegateTo(countTo(10).stream())
.mapMulti(idConsumer), 10, 55);
assertCountSum(delegateTo(countTo(10).stream())
.mapMulti(nullConsumer), 0, 0);
assertCountSum(delegateTo(countTo(3).stream())
.mapMulti(listConsumer), 6, 4);
exerciseOps(TestData.Factory.ofArray("stringsArray",
stringsArray), s -> delegateTo(s).mapMulti(charConsumer));
exerciseOps(TestData.Factory.ofArray("LONG_STRING",
new String[]{LONG_STRING}), s -> delegateTo(s).mapMulti(charConsumer));
}
@Test(dataProvider = "StreamTestData<Integer>",
dataProviderClass = StreamTestDataProvider.class)
public void testOps(String name, TestData.OfRef<Integer> data) {
testOps(name, data, s -> s);
testOps(name, data, s -> delegateTo(s));
}
private void testOps(String name,
TestData.OfRef<Integer> data,
Function<Stream<Integer>, Stream<Integer>> sf) {
Collection<Integer> result;
result = exerciseOps(data, s -> sf.apply(s).mapMulti(idConsumer));
assertEquals(data.size(), result.size());
result = exerciseOps(data, s -> sf.apply(s).mapMulti(nullConsumer));
assertEquals(0, result.size());
result = exerciseOps(data, s -> sf.apply(s).mapMulti(emptyStreamConsumer));
assertEquals(0, result.size());
}
@Test(dataProvider = "StreamTestData<Integer>.small",
dataProviderClass = StreamTestDataProvider.class)
public void testOpsX(String name, TestData.OfRef<Integer> data) {
exerciseOps(data, s -> s.mapMulti(listConsumer));
exerciseOps(data, s -> s.mapMulti(intRangeConsumer));
exerciseOps(data, s -> s.mapMulti(rangeConsumerWithLimit));
}
@Test(dataProvider = "StreamTestData<Integer>.small",
dataProviderClass = StreamTestDataProvider.class)
public void testDefaultOpsX(String name, TestData.OfRef<Integer> data) {
exerciseOps(data, s -> delegateTo(s).mapMulti(listConsumer));
exerciseOps(data, s -> delegateTo(s).mapMulti(intRangeConsumer));
exerciseOps(data, s -> delegateTo(s).mapMulti(rangeConsumerWithLimit));
}
// Int
@DataProvider(name = "IntStream")
public Object[][] intStreamProvider() {
return new Object[][]{
{IntStream.of(0, 1, 2)},
{DefaultMethodStreams.delegateTo(IntStream.of(0, 1, 2))}
};
}
@Test(dataProvider = "IntStream")
public void testIntNullMapper(IntStream s) {
checkNPE(() -> s.mapMulti(null));
}
@Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
public void testIntOps(String name, TestData.OfInt data) {
testIntOps(name, data, s -> s);
testIntOps(name, data, s -> delegateTo(s));
}
private void testIntOps(String name,
TestData.OfInt data,
Function<IntStream, IntStream> sf) {
Collection<Integer> result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> IntStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).boxed().mapMultiToInt((i, sink) -> IntStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> IntStream.empty().forEach(sink)));
assertEquals(0, result.size());
}
@Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class)
public void testIntOpsX(String name, TestData.OfInt data) {
exerciseOps(data, s -> s.mapMulti((e, sink) -> IntStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> s.mapMulti((e, sink) -> IntStream.range(0, e).limit(10).forEach(sink)));
exerciseOps(data, s -> s.boxed().mapMultiToInt((e, sink) -> IntStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> s.boxed().mapMultiToInt((e, sink) -> IntStream.range(0, e).limit(10).forEach(sink)));
}
@Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class)
public void testDefaultIntOpsX(String name, TestData.OfInt data) {
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> IntStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> IntStream.range(0, e).limit(10).forEach(sink)));
exerciseOps(data, s -> delegateTo(s).boxed().mapMultiToInt((e, sink) -> IntStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> delegateTo(s).boxed().mapMultiToInt((e, sink) -> IntStream.range(0, e).limit(10).forEach(sink)));
}
// Double
@DataProvider(name = "DoubleStream")
public Object[][] doubleStreamProvider() {
return new Object[][]{
{DoubleStream.of(0, 1, 2)},
{DefaultMethodStreams.delegateTo(DoubleStream.of(0, 1, 2))}
};
}
@Test(dataProvider = "DoubleStream")
public void testDoubleNullMapper(DoubleStream s) {
checkNPE(() -> s.mapMulti(null));
}
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOps(String name, TestData.OfDouble data) {
testDoubleOps(name, data, s -> s);
testDoubleOps(name, data, s -> delegateTo(s));
}
private void testDoubleOps(String name,
TestData.OfDouble data,
Function<DoubleStream, DoubleStream> sf) {
Collection<Double> result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> DoubleStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).boxed().mapMultiToDouble((i, sink) -> DoubleStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> DoubleStream.empty().forEach(sink)));
assertEquals(0, result.size());
}
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOpsX(String name, TestData.OfDouble data) {
exerciseOps(data, s -> s.mapMulti((e, sink) -> IntStream.range(0, (int) e).asDoubleStream().forEach(sink)));
exerciseOps(data, s -> s.mapMulti((e, sink) -> IntStream.range(0, (int) e).limit(10).asDoubleStream().forEach(sink)));
}
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDefaultDoubleOpsX(String name, TestData.OfDouble data) {
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> IntStream.range(0, (int) e).asDoubleStream().forEach(sink)));
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> IntStream.range(0, (int) e).limit(10).asDoubleStream().forEach(sink)));
}
// Long
@DataProvider(name = "LongStream")
public Object[][] longStreamProvider() {
return new Object[][]{
{LongStream.of(0, 1, 2)},
{DefaultMethodStreams.delegateTo(LongStream.of(0, 1, 2))}
};
}
@Test(dataProvider = "LongStream")
public void testLongNullMapper(LongStream s) {
checkNPE(() -> s.mapMulti(null));
}
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOps(String name, TestData.OfLong data) {
testLongOps(name, data, s -> s);
testLongOps(name, data, s -> delegateTo(s));
}
private void testLongOps(String name,
TestData.OfLong data,
Function<LongStream, LongStream> sf) {
Collection<Long> result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> LongStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).boxed().mapMultiToLong((i, sink) -> LongStream.of(i).forEach(sink)));
assertEquals(data.size(), result.size());
assertContents(data, result);
result = exerciseOps(data, s -> sf.apply(s).mapMulti((i, sink) -> LongStream.empty().forEach(sink)));
assertEquals(0, result.size());
}
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOpsX(String name, TestData.OfLong data) {
exerciseOps(data, s -> s.mapMulti((e, sink) -> LongStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> s.mapMulti((e, sink) -> LongStream.range(0, e).limit(10).forEach(sink)));
}
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testDefaultLongOpsX(String name, TestData.OfLong data) {
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> LongStream.range(0, e).forEach(sink)));
exerciseOps(data, s -> delegateTo(s).mapMulti((e, sink) -> LongStream.range(0, e).limit(10).forEach(sink)));
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020, 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
@ -23,7 +23,7 @@
/*
* @test
* @bug 8216577
* @bug 8216577 8249176
* @summary Interoperability tests with GlobalSign R6 CA
* @build ValidatePathWithParams
* @run main/othervm -Djava.security.debug=certpath GlobalSignR6CA OCSP
@ -42,139 +42,150 @@
*/
public class GlobalSignR6CA {
// Owner: CN=GlobalSign R6 Admin CA - SHA256 - G3, O=GlobalSign nv-sa, C=BE
// Owner: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE
// Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign Root CA - R6
// Serial number: 48a402ddb5defd50accfc0fcf13f
// Valid from: Tue Sep 20 17:00:00 PDT 2016 until: Mon Sep 20 17:00:00 PDT 2021
// Serial number: 7803182afbecd89eb19309bb4a25bdaa
// Valid from: Mon Jul 27 17:00:00 PDT 2020 until: Sat Jul 27 17:00:00 PDT 2030
private static final String INT = "-----BEGIN CERTIFICATE-----\n" +
"MIIFmjCCA4KgAwIBAgIOSKQC3bXe/VCsz8D88T8wDQYJKoZIhvcNAQELBQAwTDEg\n" +
"MB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2Jh\n" +
"bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMTYwOTIxMDAwMDAwWhcNMjEw\n" +
"OTIxMDAwMDAwWjBXMQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBu\n" +
"di1zYTEtMCsGA1UEAxMkR2xvYmFsU2lnbiBSNiBBZG1pbiBDQSAtIFNIQTI1NiAt\n" +
"IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmyyfJA4reymawDG1\n" +
"FNDCSFBqst/+Jih2Zg1ThovSfkxVWcviBhIZfu0t/Hv9hmolN2dxPibKCHhjyfMp\n" +
"WaGj+S8VPPaR3xoeOvHtuf/2uOyBZa/3mgiWWRF50fLy0fzyWNJL9lbTH459oUci\n" +
"QN2H0nFEuD1tGGzFdjtXCRVjWy9dZW8Vv2831buzuPLTtOPSKhqOiigpXFTo6SL9\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JhbHNpZ24uY29tL3JlcG9zaXRvcnkvMAcGBWeBDAEB\n" +
"MA0GCSqGSIb3DQEBDAUAA4ICAQBD+97H2N1BgiliKQFrb+jcWjkmPP8cdF/eiBW1\n" +
"cEzOOhsuVqxbyIk8qdw3UueHSDjqWUjHYoo8TV3DLqUXmIy1Ks3MkESsFKeLpEbk\n" +
"VMZga0lbDnqqRc5a2yzrXmwVYDeWVeD20s5vPoKCnFzmcR+2v9TKD4bI6XWVl84q\n" +
"GzfFRVdY9f8KN+7891+47ZhptvxtNqJKVI2O+EAP/PvTpwes983LkFzsev4/+Qxs\n" +
"EszD7/pE+Byj3t9CMat2XoX0jfJjbEXgewFb/gCwHvqNKLNWrYfE9qN8b6qm4xQk\n" +
"qGQKTrFKsBJx4TU+h10qXDhpmOBswiJqoG16XCV32oSn0JUYvXVAvP6YjueOv/jr\n" +
"0ZMTWGh8wCz6v3XBaXR0rxDAz9GImpU+xPx2XjuHac7OnYbN+i8p7cJPUxABjHiA\n" +
"LWXIZtCn5ziCfvYC6+SCp8x9TPJzAIfJ4NKv/8SpvvzuchVkAQqlQaGFBEdkX84R\n" +
"I/WYYG+2BliFIpbQnfljYWCURbfsYz7+Zxb94+4yzva49p8T6lALoK3s2kqIVLKN\n" +
"s6qAnk/qX6JihkaR3W+iViHMC5tqQX/pd8QIXccF3PA2OdeNGU4iUNZqUbYB4VZd\n" +
"AaOaeaUl0LwAta6DB5w344eUIqDgaitSwQZBnxppmwL3tGzP1ero2e2RvBmphbxI\n" +
"atIdxA==\n" +
"-----END CERTIFICATE-----";
// Owner: CN=valid.r6.roots.globalsign.com, O=GMO GlobalSign Inc., STREET="Two International Drive, Suite 150",
// L=Portsmouth, ST=New Hampshire, C=US, OID.1.3.6.1.4.1.311.60.2.1.2=New Hampshire, OID.1.3.6.1.4.1.311.60.2.1.3=US,
// SERIALNUMBER=578611, OID.2.5.4.15=Private Organization
// Issuer: CN=GlobalSign R6 Admin CA - SHA256 - G3, O=GlobalSign nv-sa, C=BE
// Serial number: 1355071ec648a599cea67b3b
// Valid from: Wed Jun 13 21:31:05 PDT 2018 until: Sat Jun 13 21:31:05 PDT 2020
// Owner: CN=valid.r6.roots.globalsign.com,
// O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent,
// C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB
// Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE
// Serial number: 1aff2829dd8bf07aa65a7b3c920ca4b
// Valid from: Thu Aug 27 00:20:06 PDT 2020 until: Tue Sep 28 00:20:06 PDT 2021
private static final String VALID = "-----BEGIN CERTIFICATE-----\n" +
"MIIHUjCCBjqgAwIBAgIME1UHHsZIpZnOpns7MA0GCSqGSIb3DQEBCwUAMFcxCzAJ\n" +
"BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMS0wKwYDVQQDEyRH\n" +
"bG9iYWxTaWduIFI2IEFkbWluIENBIC0gU0hBMjU2IC0gRzMwHhcNMTgwNjE0MDQz\n" +
"MTA1WhcNMjAwNjE0MDQzMTA1WjCCARIxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5p\n" +
"emF0aW9uMQ8wDQYDVQQFEwY1Nzg2MTExEzARBgsrBgEEAYI3PAIBAxMCVVMxHjAc\n" +
"BgsrBgEEAYI3PAIBAhMNTmV3IEhhbXBzaGlyZTELMAkGA1UEBhMCVVMxFjAUBgNV\n" +
"BAgTDU5ldyBIYW1wc2hpcmUxEzARBgNVBAcTClBvcnRzbW91dGgxKzApBgNVBAkT\n" +
"IlR3byBJbnRlcm5hdGlvbmFsIERyaXZlLCBTdWl0ZSAxNTAxHDAaBgNVBAoTE0dN\n" +
"TyBHbG9iYWxTaWduIEluYy4xJjAkBgNVBAMTHXZhbGlkLnI2LnJvb3RzLmdsb2Jh\n" +
"bHNpZ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RUW6CMRT58svhcswDQYJKoZIhvcNAQELBQADggIBAByb\n" +
"hoL/sArmkNjTFiEEBocMfb+brgRQdb08NKC1BDxGnfIFjUmOFzI2SVgtBmcoF8FI\n" +
"0WyXQv6ZxVE01DFZpeZpsJJYfBAjg9NR4/B7UjajvOJwQNpaciAGQ0ZzTu+SmHja\n" +
"jIiC2KqiA7Me2MoUne6hhxZ3dXEneIml8hnbTf2mjSBCVpQqyf2goslhGduPitI6\n" +
"guTtVD2PVaNCVkjlRn4Euspl2JjQWzGcEruqGyQN+Bu4yt1hsD4Jj6V9Hmzo8Vrd\n" +
"5LUxFPRGIgCUDiiwnENVsQB/D24y3IapPkojujrvsVsmQN42GIgOY5tLK/8cCziD\n" +
"vf0GzZnmL1D2ezi3TaBj+XBWFcAyF2Y9AnVRmC9CrVcp6EX0KhD4g9ZgbpJZpVlk\n" +
"G3xfOiZWTeqLnQhCMXcdcutWIwXAX5gueyF1t545vECCE4PeGZNAeWqdbrj7xaS8\n" +
"3rKQdgwF9r6p7F5HHwEVCckhovEYU4DNFzYb9n/YmC3hmskFB1keTYqydKUYEGZ5\n" +
"fvLvsjRj9xwOCqIs5j1vuKw2CaqmHxrfYaDMMSZPq/iYrOWrf72wZIvtnAHePt3X\n" +
"atQMqNbDMQrjul31ljDP9CIbbtuZSkSACyMxiC10l4uTTLQiTxtZPkwIazOjnbBe\n" +
"A4fruOEQ2k1gu5oFgqmo+xuclOKNjwd/RkK4FXnD\n" +
"-----END CERTIFICATE-----";
// Owner: CN=revoked.r6.roots.globalsign.com, O=GMO GlobalSign Inc., STREET="Two International Drive, Suite 150",
// L=Portsmouth, ST=New Hampshire, C=US, OID.1.3.6.1.4.1.311.60.2.1.2=New Hampshire, OID.1.3.6.1.4.1.311.60.2.1.3=US,
// SERIALNUMBER=578611, OID.2.5.4.15=Private Organization
// Issuer: CN=GlobalSign R6 Admin CA - SHA256 - G3, O=GlobalSign nv-sa, C=BE
// Serial number: 535589c9d767cf1cd892f1dc
// Valid from: Wed Jun 13 21:36:04 PDT 2018 until: Sat Jun 13 21:36:04 PDT 2020
// Owner: CN=revoked.r6.roots.globalsign.com,
// O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent,
// C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB
// Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE
// Serial number: 1df30d84796ac20c47da63b8e681e8f
// Valid from: Thu Aug 27 00:37:53 PDT 2020 until: Tue Sep 28 00:37:53 PDT 2021
private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" +
"MIIHVTCCBj2gAwIBAgIMU1WJyddnzxzYkvHcMA0GCSqGSIb3DQEBCwUAMFcxCzAJ\n" +
"BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMS0wKwYDVQQDEyRH\n" +
"bG9iYWxTaWduIFI2IEFkbWluIENBIC0gU0hBMjU2IC0gRzMwHhcNMTgwNjE0MDQz\n" +
"NjA0WhcNMjAwNjE0MDQzNjA0WjCCARQxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5p\n" +
"emF0aW9uMQ8wDQYDVQQFEwY1Nzg2MTExEzARBgsrBgEEAYI3PAIBAxMCVVMxHjAc\n" +
"BgsrBgEEAYI3PAIBAhMNTmV3IEhhbXBzaGlyZTELMAkGA1UEBhMCVVMxFjAUBgNV\n" +
"BAgTDU5ldyBIYW1wc2hpcmUxEzARBgNVBAcTClBvcnRzbW91dGgxKzApBgNVBAkT\n" +
"IlR3byBJbnRlcm5hdGlvbmFsIERyaXZlLCBTdWl0ZSAxNTAxHDAaBgNVBAoTE0dN\n" +
"TyBHbG9iYWxTaWduIEluYy4xKDAmBgNVBAMTH3Jldm9rZWQucjYucm9vdHMuZ2xv\n" +
"YmFsc2lnbi5jb20wggEiMA0GCSqGSIb3DQEBAQUAA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LxFoUiounjya1XTRzANBgkqhkiG9w0BAQsFAAOC\n" +
"AgEAdeQotBhB7bn+CztQmF13rdBphHrGkkyHC3hL1bxkmHJcrLQ5ochqPvgdgAVq\n" +
"DXcV8zSyNwVxW6REi+uYzcsOPKo/llmgF7Psqn1t/EDcutWlykh8UwE5UaLJ2EWD\n" +
"HnIu06n47lWtAwlNMXJ/ce0oVjqsgY52Y1u54e8wFXt6lsSw02tzIC6eo1BFKxQ3\n" +
"lDKYVXgg0OvMG/C2rvH/EIq5r+st49rNGWfcWRoHsDUruChZOHwJ9PrXKBLB/QVd\n" +
"4uw2V/0ipOETDudly7yLodXP8quhet4bCEO9gweXppL/MikLrE5xt46HW1/6w+jF\n" +
"wKCHWlq4ViswlaQ8q0oY/97o2udnuDQaNdrLgW3VofMeBIMNPBgkLDicOH6bLwNf\n" +
"lV68qi1ZBxBuOdoOqQyZ9RU9d3EL50XEJ4MtUvjJRAT5EWdFaB8SGGZbD5fyza8c\n" +
"KmeO5tkZWYecLd8CKqwKcW7umPflEwOzw60Cxg6eyBYA8Jfagpbdb/kXsF6Ov8IW\n" +
"vxNdHCnXnR3oBWm2uHddESO2zGF1ZfOb0O3cHHG5nCgVkWW68VpgX/LaN90u6Dzw\n" +
"diJX7esZV5ZaniqD+flWldgAdcfeXlJ5b7I7GnFr61ycmZT/qupagUS1WDq/zfct\n" +
"QcB4QmnAzGe6kcqiDOSyIYWpiw09jha63KpJtJDWRemrlQI=\n" +
"-----END CERTIFICATE-----";
public static void main(String[] args) throws Exception {
@ -195,8 +206,7 @@ public class GlobalSignR6CA {
// Validate Revoked
pathValidator.validate(new String[]{REVOKED, INT},
ValidatePathWithParams.Status.REVOKED,
"Wed Jun 13 23:36:02 PDT 2018", System.out);
"Thu Aug 27 00:38:11 PDT 2020", System.out);
}
}

View File

@ -389,11 +389,6 @@ public class VMProps implements Callable<Map<String, String>> {
return "false";
}
if (WB.getBooleanVMFlag("VerifyOops")) {
// Should be enabled when JDK-8209961 is fixed
return "false";
}
switch (GC.selected()) {
case Serial:
case Parallel: