This commit is contained in:
Rachel Protacio 2016-06-17 15:06:47 +00:00
commit c77d3aa077
95 changed files with 496 additions and 117 deletions

View File

@ -3245,6 +3245,15 @@ void java_lang_invoke_MemberName::set_vmindex(oop mname, intptr_t index) {
mname->address_field_put(_vmindex_offset, (address) index);
}
bool java_lang_invoke_MemberName::equals(oop mn1, oop mn2) {
if (mn1 == mn2) {
return true;
}
return (vmtarget(mn1) == vmtarget(mn2) && flags(mn1) == flags(mn2) &&
vmindex(mn1) == vmindex(mn2) &&
clazz(mn1) == clazz(mn2));
}
oop java_lang_invoke_LambdaForm::vmentry(oop lform) {
assert(is_instance(lform), "wrong type");
return lform->obj_field(_vmentry_offset);

View File

@ -1114,6 +1114,8 @@ class java_lang_invoke_MemberName: AllStatic {
static int flags_offset_in_bytes() { return _flags_offset; }
static int vmtarget_offset_in_bytes() { return _vmtarget_offset; }
static int vmindex_offset_in_bytes() { return _vmindex_offset; }
static bool equals(oop mt1, oop mt2);
};

View File

@ -201,7 +201,7 @@ ModuleEntryTable::~ModuleEntryTable() {
}
void ModuleEntryTable::create_unnamed_module(ClassLoaderData* loader_data) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
// Each ModuleEntryTable has exactly one unnamed module
if (loader_data->is_the_null_class_loader_data()) {
@ -227,7 +227,7 @@ void ModuleEntryTable::create_unnamed_module(ClassLoaderData* loader_data) {
ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle, Symbol* name,
Symbol* version, Symbol* location,
ClassLoaderData* loader_data) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtModule);
// Initialize everything BasicHashtable would
@ -258,7 +258,7 @@ ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle
}
void ModuleEntryTable::add_entry(int index, ModuleEntry* new_entry) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
Hashtable<Symbol*, mtModule>::add_entry(index, (HashtableEntry<Symbol*, mtModule>*)new_entry);
}
@ -268,7 +268,7 @@ ModuleEntry* ModuleEntryTable::locked_create_entry_or_null(Handle module_handle,
Symbol* module_location,
ClassLoaderData* loader_data) {
assert(module_name != NULL, "ModuleEntryTable locked_create_entry_or_null should never be called for unnamed module.");
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
// Check if module already exists.
if (lookup_only(module_name) != NULL) {
return NULL;
@ -309,7 +309,7 @@ void ModuleEntryTable::purge_all_module_reads() {
}
void ModuleEntryTable::finalize_javabase(Handle module_handle, Symbol* version, Symbol* location) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
ClassLoaderData* boot_loader_data = ClassLoaderData::the_null_class_loader_data();
ModuleEntryTable* module_table = boot_loader_data->modules();

View File

@ -568,8 +568,8 @@ void Modules::add_module_exports(jobject from_module, jstring package, jobject t
to_module_entry->is_named() ?
to_module_entry->name()->as_C_string() : UNNAMED_MODULE);
// Do nothing if modules are the same or if package is already exported unqualifiedly.
if (from_module_entry != to_module_entry && !package_entry->is_unqual_exported()) {
// Do nothing if modules are the same.
if (from_module_entry != to_module_entry) {
package_entry->set_exported(to_module_entry);
}
}

View File

@ -49,7 +49,7 @@ bool PackageEntry::is_qexported_to(ModuleEntry* m) const {
// Add a module to the package's qualified export list.
void PackageEntry::add_qexport(ModuleEntry* m) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
if (!has_qual_exports_list()) {
// Lazily create a package's qualified exports list.
// Initial size is small, do not anticipate export lists to be large.
@ -157,7 +157,7 @@ PackageEntryTable::~PackageEntryTable() {
}
PackageEntry* PackageEntryTable::new_entry(unsigned int hash, Symbol* name, ModuleEntry* module) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
PackageEntry* entry = (PackageEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtModule);
// Initialize everything BasicHashtable would
@ -180,14 +180,14 @@ PackageEntry* PackageEntryTable::new_entry(unsigned int hash, Symbol* name, Modu
}
void PackageEntryTable::add_entry(int index, PackageEntry* new_entry) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
Hashtable<Symbol*, mtModule>::add_entry(index, (HashtableEntry<Symbol*, mtModule>*)new_entry);
}
// Create package in loader's package entry table and return the entry.
// If entry already exists, return null. Assume Module lock was taken by caller.
PackageEntry* PackageEntryTable::locked_create_entry_or_null(Symbol* name, ModuleEntry* module) {
assert_locked_or_safepoint(Module_lock);
assert(Module_lock->owned_by_self(), "should have the Module_lock");
// Check if package already exists. Return NULL if it does.
if (lookup_only(name) != NULL) {
return NULL;

View File

@ -40,11 +40,7 @@
// package is exported to.
//
// Packages can be exported in the following 3 ways:
// - not exported: the package has not been explicitly qualified to a
// particular module nor has it been specified to be
// unqualifiedly exported to all modules. If all states
// of exportedness are false, the package is considered
// not exported.
// - not exported: the package does not have qualified or unqualified exports.
// - qualified exports: the package has been explicitly qualified to at least
// one particular module or has been qualifiedly exported
// to all unnamed modules.
@ -125,6 +121,7 @@ public:
return _is_exported_unqualified;
}
void set_unqual_exported() {
assert(Module_lock->owned_by_self(), "should have the Module_lock");
_is_exported_unqualified = true;
_is_exported_allUnnamed = false;
_qualified_exports = NULL;

View File

@ -2693,7 +2693,7 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
return NULL;
}
bool InstanceKlass::add_member_name(Handle mem_name) {
oop InstanceKlass::add_member_name(Handle mem_name, bool intern) {
jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
MutexLocker ml(MemberNameTable_lock);
DEBUG_ONLY(NoSafepointVerifier nsv);
@ -2703,7 +2703,7 @@ bool InstanceKlass::add_member_name(Handle mem_name) {
// is called!
Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
if (method->is_obsolete()) {
return false;
return NULL;
} else if (method->is_old()) {
// Replace method with redefined version
java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
@ -2712,8 +2712,11 @@ bool InstanceKlass::add_member_name(Handle mem_name) {
if (_member_names == NULL) {
_member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
}
_member_names->add_member_name(mem_name_wref);
return true;
if (intern) {
return _member_names->find_or_add_member_name(mem_name_wref);
} else {
return _member_names->add_member_name(mem_name_wref);
}
}
// -----------------------------------------------------------------------------------------------------

View File

@ -1298,7 +1298,7 @@ public:
// JSR-292 support
MemberNameTable* member_names() { return _member_names; }
void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
bool add_member_name(Handle member_name);
oop add_member_name(Handle member_name, bool intern);
public:
// JVMTI support

View File

@ -695,7 +695,7 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle))
// This can safepoint and redefine method, so need both new_obj and method
// in a handle, for two different reasons. new_obj can move, method can be
// deleted if nothing is using it on the stack.
m->method_holder()->add_member_name(new_obj());
m->method_holder()->add_member_name(new_obj(), false);
}
}

View File

@ -178,7 +178,7 @@ oop MethodHandles::init_MemberName(Handle mname, Handle target) {
return NULL;
}
oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info, bool intern) {
assert(info.resolved_appendix().is_null(), "only normal methods here");
methodHandle m = info.resolved_method();
assert(m.not_null(), "null method handle");
@ -279,13 +279,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
// If relevant, the vtable or itable value is stored as vmindex.
// This is done eagerly, since it is readily available without
// constructing any new objects.
// TO DO: maybe intern mname_oop
if (m->method_holder()->add_member_name(mname)) {
return mname();
} else {
// Redefinition caused this to fail. Return NULL (and an exception?)
return NULL;
}
return m->method_holder()->add_member_name(mname, intern);
}
oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) {
@ -975,7 +969,9 @@ int MethodHandles::find_MemberNames(KlassHandle k,
if (!java_lang_invoke_MemberName::is_instance(result()))
return -99; // caller bug!
CallInfo info(m);
oop saved = MethodHandles::init_method_MemberName(result, info);
// Since this is going through the methods to create MemberNames, don't search
// for matching methods already in the table
oop saved = MethodHandles::init_method_MemberName(result, info, /*intern*/false);
if (saved != result())
results->obj_at_put(rfill-1, saved); // show saved instance to user
} else if (++overflow >= overflow_limit) {
@ -1056,9 +1052,34 @@ MemberNameTable::~MemberNameTable() {
}
}
void MemberNameTable::add_member_name(jweak mem_name_wref) {
oop MemberNameTable::add_member_name(jweak mem_name_wref) {
assert_locked_or_safepoint(MemberNameTable_lock);
this->push(mem_name_wref);
return JNIHandles::resolve(mem_name_wref);
}
oop MemberNameTable::find_or_add_member_name(jweak mem_name_wref) {
assert_locked_or_safepoint(MemberNameTable_lock);
oop new_mem_name = JNIHandles::resolve(mem_name_wref);
// Find matching member name in the list.
// This is linear because these because these are short lists.
int len = this->length();
int new_index = len;
for (int idx = 0; idx < len; idx++) {
oop mname = JNIHandles::resolve(this->at(idx));
if (mname == NULL) {
new_index = idx;
continue;
}
if (java_lang_invoke_MemberName::equals(new_mem_name, mname)) {
JNIHandles::destroy_weak_global(mem_name_wref);
return mname;
}
}
// Not found, push the new one, or reuse empty slot
this->at_put_grow(new_index, mem_name_wref);
return new_mem_name;
}
#if INCLUDE_JVMTI

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2016, 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
@ -66,7 +66,7 @@ class MethodHandles: AllStatic {
static Handle new_MemberName(TRAPS); // must be followed by init_MemberName
static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target
static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
static oop init_method_MemberName(Handle mname_h, CallInfo& info);
static oop init_method_MemberName(Handle mname_h, CallInfo& info, bool intern = true);
static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true);
static int find_MemberNames(KlassHandle k, Symbol* name, Symbol* sig,
int mflags, KlassHandle caller,
@ -253,7 +253,8 @@ class MemberNameTable : public GrowableArray<jweak> {
public:
MemberNameTable(int methods_cnt);
~MemberNameTable();
void add_member_name(jweak mem_name_ref);
oop add_member_name(jweak mem_name_ref);
oop find_or_add_member_name(jweak mem_name_ref);
#if INCLUDE_JVMTI
// RedefineClasses() API support:

View File

@ -1,4 +1,4 @@
#
#
# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@ -19,7 +19,7 @@
# 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.
#
#
#
@ -31,10 +31,10 @@ keys=cte_test jcmd nmt regression gc stress
groups=TEST.groups [closed/TEST.groups]
# Source files for classes that will be used at the beginning of each test suite run,
# to determine additional characteristics of the system for use with the @requires tag.
# Source files for classes that will be used at the beginning of each test suite run,
# to determine additional characteristics of the system for use with the @requires tag.
requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java
requires.properties=sun.arch.data.model
requires.properties=sun.arch.data.model vm.simpleArch
# Tests using jtreg 4.2 b02 features
requiredVersion=4.2 b02

View File

@ -25,7 +25,7 @@
/*
* @test TestSSE4Disabled
* @bug 8158214
* @requires (os.simpleArch == "x64")
* @requires (vm.simpleArch == "x64")
* @summary Test correct execution without SSE 4.
* @run main/othervm -Xcomp -XX:UseSSE=3 TestSSE4Disabled
*/

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /
* @modules java.base/jdk.internal.misc
* @modules jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib/
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -21,7 +21,7 @@ import java.util.Map;
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @ignore 8139383

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib/
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @library ../common/patches

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib/
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
* @test
* @bug 8136421
* @ignore 8158860
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /
* @modules java.base/jdk.internal.misc
* @modules jdk.vm.ci/jdk.vm.ci.hotspot

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method
* @library /testlibrary /test/lib /
* @library ../common/patches

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8138708
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method
* @library /testlibrary /test/lib /
* @library ../common/patches

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary /test/lib/
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -25,7 +25,7 @@
/**
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.code
* jdk.vm.ci/jdk.vm.ci.code.site

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.code
* jdk.vm.ci/jdk.vm.ci.code.site

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.code
* jdk.vm.ci/jdk.vm.ci.code.site

View File

@ -24,7 +24,7 @@
/**
* @test
* @bug 8156034
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library / /testlibrary
* @library ../common/patches
* @modules java.base/jdk.internal.misc

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8136421
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /
* @modules java.base/jdk.internal.misc
* @modules jdk.vm.ci/jdk.vm.ci.hotspot

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") & os.arch != "aarch64"
* @library /
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.meta

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") & os.arch != "aarch64"
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.code
* jdk.vm.ci/jdk.vm.ci.code.site

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") & os.arch != "aarch64"
* @library /
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.meta

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") & os.arch != "aarch64"
* @library /
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.meta

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") & os.arch != "aarch64"
* @library /
* @modules jdk.vm.ci/jdk.vm.ci.hotspot
* jdk.vm.ci/jdk.vm.ci.meta

View File

@ -23,7 +23,7 @@
/*
* @test jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.runtime
* jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.hotspot

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8152341
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.common

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8152343
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules jdk.vm.ci/jdk.vm.ci.meta
* jdk.vm.ci/jdk.vm.ci.runtime

View File

@ -23,7 +23,7 @@
/**
* @test
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library ../../../../../
* @modules java.base/jdk.internal.reflect
* jdk.vm.ci/jdk.vm.ci.meta

View File

@ -24,7 +24,7 @@
/**
* @test
* @bug 8151664
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
* @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.vm.annotation

View File

@ -35,7 +35,7 @@ import jdk.test.lib.Asserts;
* @key cte_test
* @bug 4345157
* @summary JDK 1.3.0 alters thread signal mask
* @requires (os.simpleArch == "sparcv9")
* @requires (vm.simpleArch == "sparcv9")
* @modules java.base/jdk.internal.misc
* @library /testlibrary
* @compile Prog.java

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2016, 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.
*/
import javax.tools.JavaCompiler;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* This class consists exclusively of static utility methods for invoking the
* java compiler.
*
* This class will eventually move to jdk.testlibrary.
*/
public final class CompilerUtils {
private CompilerUtils() { }
/**
* Compile all the java sources in {@code <source>/**} to
* {@code <destination>/**}. The destination directory will be created if
* it doesn't exist.
*
* All warnings/errors emitted by the compiler are output to System.out/err.
*
* @return true if the compilation is successful
*
* @throws IOException if there is an I/O error scanning the source tree or
* creating the destination directory
*/
public static boolean compile(Path source, Path destination, String ... options)
throws IOException
{
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager jfm = compiler.getStandardFileManager(null, null, null);
List<Path> sources
= Files.find(source, Integer.MAX_VALUE,
(file, attrs) -> (file.toString().endsWith(".java")))
.collect(Collectors.toList());
Files.createDirectories(destination);
jfm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT,
Arrays.asList(destination));
List<String> opts = Arrays.asList(options);
JavaCompiler.CompilationTask task
= compiler.getTask(null, jfm, null, opts, null,
jfm.getJavaFileObjectsFromPaths(sources));
return task.call();
}
}

View File

@ -0,0 +1,80 @@
/*
* Copyright (c) 2016, 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 8156871
* @summary package in the boot layer is repeatedly exported to unique module created in layers on top of the boot layer
* @modules java.base/jdk.internal.misc
* @library /testlibrary /test/lib
* @compile ../CompilerUtils.java
* @build ExportModuleStressTest
* @run main/othervm ExportModuleStressTest
*/
import java.nio.file.Path;
import java.nio.file.Paths;
import jdk.test.lib.*;
public class ExportModuleStressTest {
private static final String TEST_SRC = System.getProperty("test.src");
private static final String TEST_CLASSES = System.getProperty("test.classes");
private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
private static final Path MODS_DIR = Paths.get(TEST_CLASSES, "mods");
/**
* Compiles all module definitions used by the test
*/
public static void main(String[] args) throws Exception {
boolean compiled;
// Compile module jdk.test declaration
compiled = CompilerUtils.compile(
SRC_DIR.resolve("jdk.test"),
MODS_DIR.resolve("jdk.test"));
if (!compiled) {
throw new RuntimeException("Test failed to compile module jdk.test");
}
// Compile module jdk.translet declaration
compiled = CompilerUtils.compile(
SRC_DIR.resolve("jdk.translet"),
MODS_DIR.resolve("jdk.translet"),
"-XaddExports:jdk.test/test=jdk.translet",
"-mp", MODS_DIR.toString());
if (!compiled) {
throw new RuntimeException("Test failed to compile module jdk.translet");
}
// Sanity check that the test, jdk.test/test/Main.java
// runs without error.
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-mp", MODS_DIR.toString(),
"-m", "jdk.test/test.Main");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("failed: 0")
.shouldHaveExitValue(0);
}
}

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2016, 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.
*/
module jdk.test {
}

View File

@ -0,0 +1,105 @@
/*
* Copyright (c) 2016, 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.
*/
package test;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.lang.reflect.Layer;
import java.lang.reflect.Method;
import java.lang.reflect.Module;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class Main {
private static final Path MODS_DIR = Paths.get(System.getProperty("jdk.module.path"));
static final String MODULE_NAME = "jdk.translet";
public static void main(String[] args) throws Exception {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
Layer layerBoot = Layer.boot();
Configuration cf = layerBoot
.configuration()
.resolveRequires(ModuleFinder.of(), finder, Set.of(MODULE_NAME));
Module testModule = Main.class.getModule();
ClassLoader scl = ClassLoader.getSystemClassLoader();
// Create an unique module/class loader in a layer above the boot layer.
// Export this module to the jdk.test/test package.
Callable<Void> task = new Callable<Void>() {
@Override
public Void call() throws Exception {
Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
Module transletModule = layer.findModule(MODULE_NAME).get();
testModule.addExports("test", transletModule);
Class<?> c = layer.findLoader(MODULE_NAME).loadClass("translet.Main");
Method method = c.getDeclaredMethod("go");
method.invoke(null);
return null;
}
};
List<Future<Void>> results = new ArrayList<>();
// Repeatedly create the layer above stressing the exportation of
// package jdk.test/test to several different modules.
ExecutorService pool = Executors.newFixedThreadPool(Math.min(100, Runtime.getRuntime().availableProcessors()*10));
try {
for (int i = 0; i < 10000; i++) {
results.add(pool.submit(task));
}
} finally {
pool.shutdown();
}
int passed = 0;
int failed = 0;
// The failed state should be 0, the created modules in layers above the
// boot layer should be allowed access to the contents of the jdk.test/test
// package since that package was exported to the transletModule above.
for (Future<Void> result : results) {
try {
result.get();
passed++;
} catch (Throwable x) {
x.printStackTrace();
failed++;
}
}
System.out.println("passed: " + passed);
System.out.println("failed: " + failed);
}
public static void callback() { }
}

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 2016, 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.
*/
module jdk.translet {
requires jdk.test;
exports translet;
}

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2016, 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.
*/
package translet;
public class Main {
public static void go() {
test.Main.callback();
}
}