This commit is contained in:
Jesper Wilhelmsson 2018-07-03 02:07:49 +02:00
commit 4222f3408c
117 changed files with 5032 additions and 252 deletions

View File

@ -490,9 +490,6 @@ a11c1cb542bbd1671d25b85efe7d09b983c48525 jdk-11+15
02934b0d661b82b7fe1052a04998d2091352e08d jdk-11+16
64e4b1686141e57a681936a8283983341484676e jdk-11+17
e1b3def126240d5433902f3cb0e91a4c27f6db50 jdk-11+18
fb8b3f4672774e15654958295558a1af1b576919 jdk-11+19
fb8b3f4672774e15654958295558a1af1b576919 jdk-11+19
36ca515343e00b021dcfc902e986d26ec994a2e5 jdk-11+19
c9cd3ec6a0ebaf373b6ff0071c396cc657f7c4bd jdk-12+0
c9cd3ec6a0ebaf373b6ff0071c396cc657f7c4bd jdk-12+0
95aad0c785e497f1bade3955c4e4a677b629fa9d jdk-12+0
9816d7cc655e53ba081f938b656e31971b8f097a jdk-11+20

View File

@ -487,6 +487,14 @@ test-image-jdk-jtreg-native:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
test-image-jdk-jtreg-native)
build-test-hotspot-jtreg-graal:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
build-test-hotspot-jtreg-graal)
test-image-hotspot-jtreg-graal:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
test-image-hotspot-jtreg-graal)
run-test:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
@ -523,6 +531,7 @@ ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \
run-test exploded-run-test
################################################################################
@ -853,10 +862,14 @@ else
build-test-jdk-jtreg-native: buildtools-jdk java.base-libs
build-test-hotspot-jtreg-graal: exploded-image-optimize
test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
test-image-hotspot-jtreg-graal: build-test-hotspot-jtreg-graal
test-image-hotspot-gtest: hotspot
test-hotspot-internal: exploded-image
@ -993,6 +1006,10 @@ docs-image: docs-jdk
# If not already set, set the JVM specific targets to build the test image
JVM_TEST_IMAGE_TARGETS ?= test-image-hotspot-jtreg-native test-image-hotspot-gtest
ifeq ($(INCLUDE_GRAAL), true)
JVM_TEST_IMAGE_TARGETS += test-image-hotspot-jtreg-graal
endif
# This target builds the test image
test-image: prepare-test-image \
test-image-jdk-jtreg-native test-image-failure-handler \

View File

@ -535,6 +535,8 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -cpa:$$(JIB_JAR)
endif
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
endif

View File

@ -0,0 +1,57 @@
#
# Copyright (c) 2018, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
###############################################################################
#
# Check for graalunit libs, needed for running graalunit tests.
#
AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT],
[
AC_ARG_WITH(graalunit-lib, [AS_HELP_STRING([--with-graalunit-lib],
[specify location of 3rd party libraries used by Graal unit tests])])
GRAALUNIT_LIB=
if test "x${with_graalunit_lib}" != x; then
AC_MSG_CHECKING([for graalunit libs])
if test "x${with_graalunit_lib}" = xno; then
AC_MSG_RESULT([disabled, graalunit tests can not be run])
elif test "x${with_graalunit_lib}" = xyes; then
AC_MSG_RESULT([not specified])
AC_MSG_ERROR([You must specify the path to 3rd party libraries used by Graal unit tests])
else
GRAALUNIT_LIB="${with_graalunit_lib}"
if test ! -d "${GRAALUNIT_LIB}"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find graalunit 3rd party libraries as specified. (${with_graalunit_lib})])
else
AC_MSG_RESULT([$GRAALUNIT_LIB])
fi
fi
fi
BASIC_FIXUP_PATH([GRAALUNIT_LIB])
AC_SUBST(GRAALUNIT_LIB)
])

View File

@ -32,6 +32,7 @@ m4_include([lib-freetype.m4])
m4_include([lib-std.m4])
m4_include([lib-x11.m4])
m4_include([lib-fontconfig.m4])
m4_include([lib-tests.m4])
################################################################################
# Determine which libraries are needed for this configuration
@ -101,6 +102,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_BUNDLED_LIBS
LIB_SETUP_MISC_LIBS
LIB_SETUP_SOLARIS_STLPORT
LIB_TESTS_SETUP_GRAALUNIT
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
GLOBAL_LIBS="-lc"

View File

@ -347,6 +347,7 @@ LIBFFI_LIBS:=@LIBFFI_LIBS@
LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
GRAALUNIT_LIB := @GRAALUNIT_LIB@
PACKAGE_PATH=@PACKAGE_PATH@

View File

@ -378,7 +378,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"linux-x64": {
target_os: "linux",
target_cpu: "x64",
dependencies: ["devkit", "autoconf", "graphviz", "pandoc"],
dependencies: ["devkit", "autoconf", "graphviz", "pandoc", "graalunit_lib"],
configure_args: concat(common.configure_args_64bit,
"--enable-full-docs", "--with-zlib=system"),
default_make_targets: ["docs-bundles"],
@ -396,7 +396,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"macosx-x64": {
target_os: "macosx",
target_cpu: "x64",
dependencies: ["devkit", "autoconf"],
dependencies: ["devkit", "autoconf", "graalunit_lib"],
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
"--with-macosx-version-max=10.9.0"),
},
@ -420,7 +420,7 @@ var getJibProfilesProfiles = function (input, common, data) {
"windows-x64": {
target_os: "windows",
target_cpu: "x64",
dependencies: ["devkit", "autoconf"],
dependencies: ["devkit", "autoconf", "graalunit_lib"],
configure_args: concat(common.configure_args_64bit),
},
@ -972,6 +972,14 @@ var getJibProfilesDependencies = function (input, common) {
configure_args: "",
},
graalunit_lib: {
organization: common.organization,
ext: "zip",
revision: "619_Apr_12_2018",
module: "graalunit-lib",
configure_args: "--with-graalunit-lib=" + input.get("graalunit_lib", "install_path"),
environment_name: "GRAALUNIT_LIB"
},
};
// Need to add a value for the Visual Studio tools variable to make

View File

@ -1,2 +1,2 @@
Github: https://raw.githubusercontent.com/publicsuffix/list/2225db8d9f4a2a27ec697c883360632fa0c16261/public_suffix_list.dat
Date: 2018-05-09
Date: 2018-05-24

View File

@ -0,0 +1,144 @@
#
# Copyright (c) 2018, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
################################################################################
# This file builds Graal component of the JTReg tests for Hotspot.
# It also covers the test-image part, where the built files are copied to the
# test image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include SetupJavaCompilers.gmk
TARGETS_BUILD :=
TARGETS_IMAGE :=
TARGETS_EXTRA_LIB :=
ifeq ($(INCLUDE_GRAAL), true)
ifneq ($(GRAALUNIT_LIB), )
SRC_DIR := $(TOPDIR)/src/jdk.internal.vm.compiler/share/classes
TEST_DIR := $(TOPDIR)/test/hotspot/jtreg/compiler/graalunit
COMPILE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/test/graalunit
LIB_OUTPUTDIR := $(TEST_IMAGE_DIR)/hotspot/jtreg/graal
### Copy 3rd party libs
$(eval $(call SetupCopyFiles, COPY_GRAALUNIT_LIBS, \
FILES := $(wildcard $(GRAALUNIT_LIB)/*.jar), \
DEST := $(LIB_OUTPUTDIR), \
))
TARGETS_EXTRA_LIB += $(COPY_GRAALUNIT_LIBS)
### Compile and build graalunit tests
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS, \
SETUP := GENERATE_USINGJDKBYTECODE, \
SRC := \
$(SRC_DIR)/jdk.internal.vm.compiler.collections.test/src \
$(SRC_DIR)/org.graalvm.compiler.api.directives.test/src \
$(SRC_DIR)/org.graalvm.compiler.api.test/src \
$(SRC_DIR)/org.graalvm.compiler.asm.aarch64.test/src \
$(SRC_DIR)/org.graalvm.compiler.asm.amd64.test/src \
$(SRC_DIR)/org.graalvm.compiler.asm.sparc.test/src \
$(SRC_DIR)/org.graalvm.compiler.asm.test/src \
$(SRC_DIR)/org.graalvm.compiler.core.amd64.test/src \
$(SRC_DIR)/org.graalvm.compiler.core.test/src \
$(SRC_DIR)/org.graalvm.compiler.debug.test/src \
$(SRC_DIR)/org.graalvm.compiler.graph.test/src \
$(SRC_DIR)/org.graalvm.compiler.hotspot.amd64.test/src \
$(SRC_DIR)/org.graalvm.compiler.hotspot.lir.test/src \
$(SRC_DIR)/org.graalvm.compiler.hotspot.sparc.test/src \
$(SRC_DIR)/org.graalvm.compiler.hotspot.test/src \
$(SRC_DIR)/org.graalvm.compiler.lir.test/src \
$(SRC_DIR)/org.graalvm.compiler.loop.test/src \
$(SRC_DIR)/org.graalvm.compiler.nodes.test/src \
$(SRC_DIR)/org.graalvm.compiler.options.test/src \
$(SRC_DIR)/org.graalvm.compiler.phases.common.test/src \
$(SRC_DIR)/org.graalvm.compiler.replacements.test/src \
$(SRC_DIR)/org.graalvm.compiler.test/src \
$(SRC_DIR)/org.graalvm.util.test/src \
$(SRC_DIR)/org.graalvm.compiler.jtt/src \
$(SRC_DIR)/org.graalvm.compiler.lir.jtt/src \
, \
BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
JAR := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests.jar, \
CLASSPATH := \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.compiler \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.ci \
$(LIB_OUTPUTDIR)/junit-4.12.jar \
$(LIB_OUTPUTDIR)/asm-5.0.4.jar \
$(LIB_OUTPUTDIR)/asm-tree-5.0.4.jar \
$(LIB_OUTPUTDIR)/java-allocation-instrumenter.jar \
$(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar \
, \
ADD_JAVAC_FLAGS := \
-Xlint:none -processorpath \
$(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
, \
))
TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS)
### Compile and build mxtool
$(eval $(call SetupJavaCompilation, BUILD_MXTOOL, \
SETUP := GENERATE_USINGJDKBYTECODE, \
SRC := $(TEST_DIR)/com.oracle.mxtool.junit, \
BIN := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit, \
JAR := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit.jar, \
CLASSPATH := $(LIB_OUTPUTDIR)/junit-4.12.jar, \
))
TARGETS_BUILD += $(BUILD_MXTOOL)
################################################################################
# Targets for building test-image.
################################################################################
# Copy to hotspot jtreg test image
$(eval $(call SetupCopyFiles, COPY_HOTSPOT_JTREG_GRAAL, \
SRC := $(COMPILE_OUTPUTDIR), \
DEST := $(LIB_OUTPUTDIR), \
FILES := jdk.vm.compiler.tests.jar com.oracle.mxtool.junit.jar, \
))
TARGETS_IMAGE += $(COPY_HOTSPOT_JTREG_GRAAL)
else
$(info Skip building of Graal unit tests because 3rd party libraries directory is not specified)
endif
endif
$(TARGETS_BUILD): $(TARGETS_EXTRA_LIB)
build-test-hotspot-jtreg-graal: $(TARGETS_BUILD)
test-image-hotspot-jtreg-graal: $(TARGETS_IMAGE)
all: build-test-hotspot-jtreg-graal
test-image: test-image-hotspot-jtreg-graal
.PHONY: default all build-test-hotspot-jtreg-graal test-image-hotspot-jtreg-graal test-image

View File

@ -1638,12 +1638,6 @@ bool CompileBroker::init_compiler_runtime() {
* out to be a problem.
*/
void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) {
// Free buffer blob, if allocated
if (thread->get_buffer_blob() != NULL) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::free(thread->get_buffer_blob());
}
if (comp->should_perform_shutdown()) {
// There are two reasons for shutting down the compiler
// 1) compiler runtime initialization failed

View File

@ -1033,7 +1033,7 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list,
// The last ref must have its discovered field pointing to itself.
oop next_discovered = (current_head != NULL) ? current_head : obj;
oop retest = RawAccess<>::oop_atomic_cmpxchg(next_discovered, discovered_addr, oop(NULL));
oop retest = HeapAccess<AS_NO_KEEPALIVE>::oop_atomic_cmpxchg(next_discovered, discovered_addr, oop(NULL));
if (retest == NULL) {
// This thread just won the right to enqueue the object.

View File

@ -1490,7 +1490,8 @@ Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN *igvn) {
// be skipped. For example, range check predicate has two checks
// for lower and upper bounds.
ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL) {
if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL ||
unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_profile_predicate) != NULL) {
prev_dom = idom;
}

View File

@ -1056,7 +1056,9 @@ void PhaseIdealLoop::loop_predication_follow_branches(Node *n, IdealLoopTree *lo
stack.push(in, 1);
break;
} else if (in->is_IfProj() &&
in->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) {
in->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) &&
(in->in(0)->Opcode() == Op_If ||
in->in(0)->Opcode() == Op_RangeCheck)) {
if (pf.to(in) * loop_trip_cnt >= 1) {
stack.push(in, 1);
}
@ -1281,7 +1283,7 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
Node* n = skip_loop_predicates(entry);
// Check if predicates were already added to the profile predicate
// block
if (n != entry->in(0)->in(0)) {
if (n != entry->in(0)->in(0) || n->outcnt() != 1) {
has_profile_predicates = true;
}
entry = n;

View File

@ -4224,34 +4224,34 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
// which can inhibit range check elimination.
if (least != early) {
Node* ctrl_out = least->unique_ctrl_out();
if (ctrl_out && ctrl_out->is_CountedLoop() &&
if (ctrl_out && ctrl_out->is_Loop() &&
least == ctrl_out->in(LoopNode::EntryControl)) {
// Move the node above predicates as far up as possible so a
// following pass of loop predication doesn't hoist a predicate
// that depends on it above that node.
Node* new_ctrl = least;
// Move the node above predicates so a following pass of loop
// predication doesn't hoist a predicate that depends on it
// above that node.
if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_loop_limit_check) != NULL) {
new_ctrl = new_ctrl->in(0)->in(0);
assert(is_dominator(early, new_ctrl), "least != early so we can move up the dominator tree");
}
if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_profile_predicate) != NULL) {
Node* c = new_ctrl->in(0)->in(0);
assert(is_dominator(early, c), "least != early so we can move up the dominator tree");
new_ctrl = c;
}
if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_predicate) != NULL) {
Node* c = new_ctrl->in(0)->in(0);
assert(is_dominator(early, c), "least != early so we can move up the dominator tree");
new_ctrl = c;
}
if (new_ctrl != ctrl_out) {
least = new_ctrl;
} else if (ctrl_out->is_CountedLoop() || ctrl_out->is_OuterStripMinedLoop()) {
Node* least_dom = idom(least);
if (get_loop(least_dom)->is_member(get_loop(least))) {
least = least_dom;
for (;;) {
if (!new_ctrl->is_Proj()) {
break;
}
CallStaticJavaNode* call = new_ctrl->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none);
if (call == NULL) {
break;
}
int req = call->uncommon_trap_request();
Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req);
if (trap_reason != Deoptimization::Reason_loop_limit_check &&
trap_reason != Deoptimization::Reason_predicate &&
trap_reason != Deoptimization::Reason_profile_predicate) {
break;
}
Node* c = new_ctrl->in(0)->in(0);
if (is_dominator(c, early) && c != early) {
break;
}
new_ctrl = c;
}
least = new_ctrl;
}
}

View File

@ -257,6 +257,7 @@ void PhaseIdealLoop::dominated_by( Node *prevdom, Node *iff, bool flip, bool exc
ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj();
if (exclude_loop_predicate &&
(unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL ||
unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_profile_predicate) != NULL ||
unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check) != NULL)) {
// If this is a range check (IfNode::is_range_check), do not
// reorder because Compile::allow_range_check_smearing might have

View File

@ -518,8 +518,7 @@ Node* LoadNode::find_previous_arraycopy(PhaseTransform* phase, Node* ld_alloc, N
if (ac->is_clonebasic()) {
intptr_t offset;
AllocateNode* alloc = AllocateNode::Ideal_allocation(ac->in(ArrayCopyNode::Dest), phase, offset);
assert(alloc != NULL && (!ReduceBulkZeroing || alloc->initialization()->is_complete_with_arraycopy()), "broken allocation");
if (alloc == ld_alloc) {
if (alloc != NULL && alloc == ld_alloc) {
return ac;
}
}

View File

@ -297,12 +297,12 @@ HandshakeState::HandshakeState() : _operation(NULL), _semaphore(1), _thread_in_p
void HandshakeState::set_operation(JavaThread* target, HandshakeOperation* op) {
_operation = op;
SafepointMechanism::arm_local_poll(target);
SafepointMechanism::arm_local_poll_release(target);
}
void HandshakeState::clear_handshake(JavaThread* target) {
_operation = NULL;
SafepointMechanism::disarm_local_poll(target);
SafepointMechanism::disarm_local_poll_release(target);
}
void HandshakeState::process_self_inner(JavaThread* thread) {

View File

@ -243,9 +243,10 @@ void SafepointSynchronize::begin() {
if (SafepointMechanism::uses_thread_local_poll()) {
// Arming the per thread poll while having _state != _not_synchronized means safepointing
log_trace(safepoint)("Setting thread local yield flag for threads");
OrderAccess::storestore(); // storestore, global state -> local state
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *cur = jtiwh.next(); ) {
// Make sure the threads start polling, it is time to yield.
SafepointMechanism::arm_local_poll(cur); // release store, global state -> local state
SafepointMechanism::arm_local_poll(cur);
}
}
OrderAccess::fence(); // storestore|storeload, global state -> local state
@ -546,7 +547,7 @@ void SafepointSynchronize::end() {
for (; JavaThread *current = jtiwh.next(); ) {
ThreadSafepointState* cur_state = current->safepoint_state();
cur_state->restart(); // TSS _running
SafepointMechanism::disarm_local_poll(current); // release store, local state -> polling page
SafepointMechanism::disarm_local_poll(current);
}
log_info(safepoint)("Leaving safepoint region");
} else {

View File

@ -79,9 +79,13 @@ public:
// Blocks a thread until safepoint is completed
static inline void block_if_requested(JavaThread* thread);
// Caller is responsible for using a memory barrier if needed.
static inline void arm_local_poll(JavaThread* thread);
static inline void disarm_local_poll(JavaThread* thread);
static inline void arm_local_poll_release(JavaThread* thread);
static inline void disarm_local_poll_release(JavaThread* thread);
// Setup the selected safepoint mechanism
static void initialize();
static void initialize_header(JavaThread* thread);

View File

@ -87,4 +87,12 @@ void SafepointMechanism::disarm_local_poll(JavaThread* thread) {
thread->set_polling_page(poll_disarmed_value());
}
void SafepointMechanism::arm_local_poll_release(JavaThread* thread) {
thread->set_polling_page_release(poll_armed_value());
}
void SafepointMechanism::disarm_local_poll_release(JavaThread* thread) {
thread->set_polling_page_release(poll_disarmed_value());
}
#endif // SHARE_VM_RUNTIME_SAFEPOINTMECHANISM_INLINE_HPP

View File

@ -3298,6 +3298,11 @@ CompilerThread::CompilerThread(CompileQueue* queue,
}
CompilerThread::~CompilerThread() {
// Free buffer blob, if allocated
if (get_buffer_blob() != NULL) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::free(get_buffer_blob());
}
// Delete objects which were allocated on heap.
delete _counters;
}

View File

@ -1207,6 +1207,7 @@ class JavaThread: public Thread {
bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; }
void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }
inline void set_polling_page_release(void* poll_value);
inline void set_polling_page(void* poll_value);
inline volatile void* get_polling_page();

View File

@ -170,10 +170,15 @@ inline bool JavaThread::stack_guards_enabled() {
// The release make sure this store is done after storing the handshake
// operation or global state
inline void JavaThread::set_polling_page(void* poll_value) {
inline void JavaThread::set_polling_page_release(void* poll_value) {
OrderAccess::release_store(polling_page_addr(), poll_value);
}
// Caller is responsible for using a memory barrier if needed.
inline void JavaThread::set_polling_page(void* poll_value) {
*polling_page_addr() = poll_value;
}
// The aqcquire make sure reading of polling page is done before
// the reading the handshake operation or the global state
inline volatile void* JavaThread::get_polling_page() {

View File

@ -100,7 +100,7 @@ public class RSAKeyFactory extends KeyFactorySpi {
private static void checkKeyAlgo(Key key, String expectedAlg)
throws InvalidKeyException {
String keyAlg = key.getAlgorithm();
if (!(keyAlg.equalsIgnoreCase(expectedAlg))) {
if (keyAlg == null || !(keyAlg.equalsIgnoreCase(expectedAlg))) {
throw new InvalidKeyException("Expected a " + expectedAlg
+ " key, but got " + keyAlg);
}
@ -123,8 +123,7 @@ public class RSAKeyFactory extends KeyFactorySpi {
return (RSAKey)key;
} else {
try {
String keyAlgo = key.getAlgorithm();
KeyType type = KeyType.lookup(keyAlgo);
KeyType type = KeyType.lookup(key.getAlgorithm());
RSAKeyFactory kf = RSAKeyFactory.getInstance(type);
return (RSAKey) kf.engineTranslateKey(key);
} catch (ProviderException e) {
@ -268,8 +267,7 @@ public class RSAKeyFactory extends KeyFactorySpi {
throw new InvalidKeyException("Invalid key", e);
}
} else if ("X.509".equals(key.getFormat())) {
byte[] encoded = key.getEncoded();
RSAPublicKey translated = new RSAPublicKeyImpl(encoded);
RSAPublicKey translated = new RSAPublicKeyImpl(key.getEncoded());
// ensure the key algorithm matches the current KeyFactory instance
checkKeyAlgo(translated, type.keyAlgo());
return translated;
@ -313,8 +311,8 @@ public class RSAKeyFactory extends KeyFactorySpi {
throw new InvalidKeyException("Invalid key", e);
}
} else if ("PKCS#8".equals(key.getFormat())) {
byte[] encoded = key.getEncoded();
RSAPrivateKey translated = RSAPrivateCrtKeyImpl.newKey(encoded);
RSAPrivateKey translated =
RSAPrivateCrtKeyImpl.newKey(key.getEncoded());
// ensure the key algorithm matches the current KeyFactory instance
checkKeyAlgo(translated, type.keyAlgo());
return translated;

View File

@ -123,6 +123,10 @@ public final class RSAPrivateCrtKeyImpl
* Construct a key from its encoding. Called from newKey above.
*/
RSAPrivateCrtKeyImpl(byte[] encoded) throws InvalidKeyException {
if (encoded == null || encoded.length == 0) {
throw new InvalidKeyException("Missing key encoding");
}
decode(encoded);
RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
try {

View File

@ -116,6 +116,9 @@ public final class RSAPublicKeyImpl extends X509Key implements RSAPublicKey {
* Construct a key from its encoding. Used by RSAKeyFactory.
*/
RSAPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
if (encoded == null || encoded.length == 0) {
throw new InvalidKeyException("Missing key encoding");
}
decode(encoded); // this sets n and e value
RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
checkExponentRange(n, e);

View File

@ -52,7 +52,11 @@ public class RSAUtil {
public String keyAlgo() {
return algo;
}
public static KeyType lookup(String name) {
public static KeyType lookup(String name)
throws InvalidKeyException, ProviderException {
if (name == null) {
throw new InvalidKeyException("Null key algorithm");
}
for (KeyType kt : KeyType.values()) {
if (kt.keyAlgo().equalsIgnoreCase(name)) {
return kt;
@ -133,21 +137,24 @@ public class RSAUtil {
throws ProviderException {
if (params == null) return null;
String algName = params.getAlgorithm();
KeyType type = KeyType.lookup(algName);
Class<? extends AlgorithmParameterSpec> specCls;
switch (type) {
case RSA:
throw new ProviderException("No params accepted for " +
type.keyAlgo());
case PSS:
specCls = PSSParameterSpec.class;
break;
default:
throw new ProviderException("Unsupported RSA algorithm: " + algName);
}
try {
String algName = params.getAlgorithm();
KeyType type = KeyType.lookup(algName);
Class<? extends AlgorithmParameterSpec> specCls;
switch (type) {
case RSA:
throw new ProviderException("No params accepted for " +
type.keyAlgo());
case PSS:
specCls = PSSParameterSpec.class;
break;
default:
throw new ProviderException("Unsupported RSA algorithm: " + algName);
}
return params.getParameterSpec(specCls);
} catch (ProviderException pe) {
// pass it up
throw pe;
} catch (Exception e) {
throw new ProviderException(e);
}

View File

@ -1,7 +1,7 @@
## Mozilla Public Suffix List
### Public Suffix Notice
<pre>
```
You are receiving a copy of the Mozilla Public Suffix List in the following
file: <java-home>/lib/security/public_suffix_list.dat. The terms of the
Oracle license do NOT apply to this file; it is licensed under the
@ -11,17 +11,17 @@ If you do not wish to use the Public Suffix List, you may remove the
The Source Code of this file is available under the
Mozilla Public License, v. 2.0 and is located at
https://github.com/publicsuffix/list/blob/03089bfe4aa5b7a2e291f33e07a28d20f875cb83/public_suffix_list.dat
https://raw.githubusercontent.com/publicsuffix/list/2225db8d9f4a2a27ec697c883360632fa0c16261/public_suffix_list.dat.
If a copy of the MPL was not distributed with this file, you can obtain one
at http://mozilla.org/MPL/2.0/.
at https://mozilla.org/MPL/2.0/.
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
</pre>
```
### MPL v2.0
<pre>
```
Mozilla Public License Version 2.0
==================================
@ -381,7 +381,7 @@ Exhibit A - Source Code Form License Notice
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
@ -396,4 +396,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
</pre>
```

View File

@ -3320,7 +3320,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
} else if (name == "indexForNullComponent") {
isRunsDirty = true;
updateHtmlViews((Integer) e.getNewValue(), true);
} else if (name == "font") {
} else if (name == "font" || SwingUtilities2.isScaleChanged(e)) {
calculatedBaseline = false;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2018, 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
@ -22,67 +22,98 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.awt;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.Vector;
import java.util.Locale;
import java.util.EventListener;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Collections;
import java.applet.Applet;
import java.awt.dnd.DropTarget;
import java.awt.event.ActionEvent;
import java.awt.event.AdjustmentEvent;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.HierarchyBoundsListener;
import java.awt.event.HierarchyEvent;
import java.awt.event.HierarchyListener;
import java.awt.event.InputEvent;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.ItemEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.event.PaintEvent;
import java.awt.event.TextEvent;
import java.awt.im.InputContext;
import java.awt.im.InputMethodRequests;
import java.awt.image.BufferStrategy;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.VolatileImage;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
import java.awt.image.BufferStrategy;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.ColorModel;
import java.awt.image.VolatileImage;
import java.awt.event.*;
import java.io.Serializable;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.Transient;
import java.awt.im.InputContext;
import java.awt.im.InputMethodRequests;
import java.awt.dnd.DropTarget;
import java.security.AccessController;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.security.AccessControlContext;
import javax.accessibility.*;
import java.applet.Applet;
import java.security.AccessController;
import java.util.Collections;
import java.util.EventListener;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.Vector;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleComponent;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleSelection;
import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
import javax.swing.JComponent;
import javax.swing.JRootPane;
import sun.awt.ComponentFactory;
import sun.security.action.GetPropertyAction;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.ComponentFactory;
import sun.awt.ConstrainableGraphics;
import sun.awt.EmbeddedFrame;
import sun.awt.RequestFocusController;
import sun.awt.SubRegionShowable;
import sun.awt.SunToolkit;
import sun.awt.EmbeddedFrame;
import sun.awt.dnd.SunDropTargetEvent;
import sun.awt.im.CompositionArea;
import sun.awt.image.VSyncedBSManager;
import sun.font.FontManager;
import sun.font.FontManagerFactory;
import sun.font.SunFontManager;
import sun.java2d.SunGraphics2D;
import sun.java2d.pipe.Region;
import sun.awt.image.VSyncedBSManager;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
import sun.awt.RequestFocusController;
import sun.java2d.SunGraphicsEnvironment;
import sun.java2d.pipe.Region;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import sun.security.action.GetPropertyAction;
import sun.swing.SwingAccessor;
import sun.util.logging.PlatformLogger;
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_DEFAULT;
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON;
/**
* A <em>component</em> is an object having a graphical representation
* that can be displayed on the screen and that can interact with the
@ -1129,24 +1160,31 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
}
boolean updateGraphicsData(GraphicsConfiguration gc) {
checkTreeLock();
final boolean updateGraphicsData(GraphicsConfiguration gc) {
GraphicsConfiguration oldConfig = graphicsConfig;
// First, update own graphics configuration
boolean ret = updateSelfGraphicsData(gc);
// Second, update children graphics configurations
ret |= updateChildGraphicsData(gc);
// Third, fire PropertyChange if needed
if (oldConfig != gc) {
/*
* If component is moved from one screen to another screen or shown
* for the first time graphicsConfiguration property is fired to
* enable the component to recalculate any rendering data, if needed
*/
firePropertyChange("graphicsConfiguration", oldConfig, gc);
}
return ret;
}
private boolean updateSelfGraphicsData(GraphicsConfiguration gc) {
checkTreeLock();
if (graphicsConfig == gc) {
return false;
}
GraphicsConfiguration oldConfig = graphicsConfig;
graphicsConfig = gc;
/*
* If component is moved from one screen to another sceeen
* graphicsConfiguration property is fired to enable the component
* to recalculate any rendering data, if needed
*/
if (oldConfig != null && gc != null) {
firePropertyChange("graphicsConfiguration", oldConfig, gc);
}
ComponentPeer peer = this.peer;
if (peer != null) {
return peer.updateGraphicsData(gc);
@ -1154,6 +1192,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
return false;
}
boolean updateChildGraphicsData(GraphicsConfiguration gc) {
return false;
}
/**
* Checks that this component's {@code GraphicsDevice}
* {@code idString} matches the string argument.

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.awt;
import java.awt.dnd.DropTarget;
@ -1172,10 +1173,10 @@ public class Container extends Component {
}
@Override
boolean updateGraphicsData(GraphicsConfiguration gc) {
final boolean updateChildGraphicsData(GraphicsConfiguration gc) {
checkTreeLock();
boolean ret = super.updateGraphicsData(gc);
boolean ret = false;
for (Component comp : component) {
if (comp != null) {

View File

@ -35,7 +35,7 @@ import java.awt.Rectangle;
import java.io.Serializable;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
/**
* Renders an item in a list.
@ -259,9 +259,10 @@ public class DefaultListCellRenderer extends JLabel
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
// Strings get interned...
if (propertyName == "text"
|| ((propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
|| ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue)
|| propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
super.firePropertyChange(propertyName, oldValue, newValue);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -75,9 +75,8 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
else if(prop == AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY) {
checkOpacity((AbstractButton) e.getSource() );
}
else if(prop == AbstractButton.TEXT_CHANGED_PROPERTY ||
"font" == prop || "foreground" == prop ||
"ancestor" == prop || "graphicsConfiguration" == prop) {
else if(prop == AbstractButton.TEXT_CHANGED_PROPERTY || "font" == prop
|| "foreground" == prop || SwingUtilities2.isScaleChanged(e)) {
AbstractButton b = (AbstractButton) e.getSource();
BasicHTML.updateRenderer(b, b.getText());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -36,6 +36,7 @@ import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import sun.awt.AppContext;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
import sun.swing.UIAction;
/**
@ -1809,6 +1810,10 @@ public class BasicComboBoxUI extends ComboBoxUI {
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
comboBox.validate();
} else if (SwingUtilities2.isScaleChanged(e)) {
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
comboBox.validate();
}
else if ( propertyName == JComponent.TOOL_TIP_TEXT_KEY ) {
updateToolTipTextForChildren();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -477,8 +477,8 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name == "text" || "font" == name || "foreground" == name ||
"ancestor" == name || "graphicsConfiguration" == name) {
if (name == "text" || "font" == name || "foreground" == name
|| SwingUtilities2.isScaleChanged(e)) {
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -2656,7 +2656,8 @@ public class BasicListUI extends ListUI
updateLayoutStateNeeded |= cellRendererChanged;
redrawList();
}
else if (propertyName == "font") {
else if (propertyName == "font"
|| SwingUtilities2.isScaleChanged(e)) {
updateLayoutStateNeeded |= fontChanged;
redrawList();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -1145,9 +1145,8 @@ public class BasicMenuItemUI extends MenuItemUI
if (name == "labelFor" || name == "displayedMnemonic" ||
name == "accelerator") {
updateAcceleratorBinding();
} else if (name == "text" || "font" == name ||
"foreground" == name ||
"ancestor" == name || "graphicsConfiguration" == name) {
} else if (name == "text" || "font" == name || "foreground" == name
|| SwingUtilities2.isScaleChanged(e)) {
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -35,6 +35,7 @@ import javax.swing.*;
import javax.swing.event.*;
import javax.swing.plaf.*;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
import sun.swing.UIAction;
@ -1829,6 +1830,7 @@ public class BasicSliderUI extends SliderUI{
propertyName == "paintTicks" ||
propertyName == "paintTrack" ||
propertyName == "font" ||
SwingUtilities2.isScaleChanged(e) ||
propertyName == "paintLabels" ||
propertyName == "Slider.paintThumbArrowShape") {
checkedLabelBaselines = false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -4008,7 +4008,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} else if (name == "indexForNullComponent") {
isRunsDirty = true;
updateHtmlViews((Integer)e.getNewValue(), true);
} else if (name == "font") {
} else if (name == "font" || SwingUtilities2.isScaleChanged(e)) {
calculatedBaseline = false;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -260,9 +260,8 @@ public class BasicToolTipUI extends ToolTipUI
PropertyChangeListener {
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals("tiptext") || "font".equals(name) ||
"foreground".equals(name) ||
"ancestor" == name || "graphicsConfiguration" == name) {
if (name.equals("tiptext") || "foreground".equals(name)
|| "font".equals(name) || SwingUtilities2.isScaleChanged(e)) {
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, 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
@ -3843,7 +3843,8 @@ public class BasicTreeUI extends TreeUI
else if(changeName == JTree.SELECTION_MODEL_PROPERTY) {
setSelectionModel(tree.getSelectionModel());
}
else if(changeName == "font") {
else if(changeName == "font"
|| SwingUtilities2.isScaleChanged(event)) {
completeEditing();
if(treeState != null)
treeState.invalidateSizes();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, 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
@ -35,6 +35,7 @@ import javax.swing.plaf.basic.BasicToolTipUI;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.View;
import sun.swing.SwingUtilities2;
/**
* Provides the Synth L&amp;F UI delegate for
@ -226,9 +227,8 @@ public class SynthToolTipUI extends BasicToolTipUI
updateStyle((JToolTip)e.getSource());
}
String name = e.getPropertyName();
if (name.equals("tiptext") || "font".equals(name) ||
"foreground".equals(name) ||
"ancestor" == name || "graphicsConfiguration" == name) {
if (name.equals("tiptext") || SwingUtilities2.isScaleChanged(e)
|| "foreground".equals(name) || "font".equals(name)) {
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.

View File

@ -34,7 +34,7 @@ import java.awt.Rectangle;
import java.io.Serializable;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
/**
* The standard class for rendering (displaying) individual cells
@ -345,11 +345,12 @@ public class DefaultTableCellRenderer extends JLabel
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
// Strings get interned...
if (propertyName=="text"
|| propertyName == "labelFor"
|| propertyName == "displayedMnemonic"
|| ((propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
|| propertyName == "labelFor"
|| propertyName == "displayedMnemonic"
|| ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue)
|| propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
super.firePropertyChange(propertyName, oldValue, newValue);
}

View File

@ -43,6 +43,7 @@ import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
/**
* Displays an entry in a tree.
@ -690,9 +691,10 @@ public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
// Strings get interned...
if (propertyName == "text"
|| ((propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
|| ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue)
|| propertyName == "font" || propertyName == "foreground")
&& oldValue != newValue
&& getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
super.firePropertyChange(propertyName, oldValue, newValue);
}

View File

@ -25,48 +25,95 @@
package sun.swing;
import java.lang.reflect.*;
import java.awt.*;
import static java.awt.RenderingHints.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.Rectangle2D;
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FocusTraversalPolicy;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.PrintGraphics;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextHitInfo;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import static java.awt.geom.AffineTransform.TYPE_FLIP;
import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE;
import static java.awt.geom.AffineTransform.TYPE_TRANSLATION;
import java.awt.geom.Rectangle2D;
import java.awt.print.PrinterGraphics;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import javax.swing.*;
import javax.swing.event.TreeModelEvent;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.DefaultCaret;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import sun.java2d.pipe.Region;
import sun.print.ProxyPrintGraphics;
import sun.awt.*;
import java.io.*;
import java.beans.PropertyChangeEvent;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import sun.font.FontDesignMetrics;
import sun.font.FontUtilities;
import sun.java2d.SunGraphicsEnvironment;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import java.text.BreakIterator;
import java.text.CharacterIterator;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.TreeModelEvent;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import javax.swing.text.DefaultCaret;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import sun.awt.AWTAccessor;
import sun.awt.AWTPermissions;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
import sun.font.FontDesignMetrics;
import sun.font.FontUtilities;
import sun.java2d.SunGraphicsEnvironment;
import sun.print.ProxyPrintGraphics;
import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING;
import static java.awt.RenderingHints.KEY_TEXT_LCD_CONTRAST;
import static java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
import static java.awt.geom.AffineTransform.TYPE_FLIP;
import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE;
import static java.awt.geom.AffineTransform.TYPE_TRANSLATION;
/**
* A collection of utility methods for Swing.
* <p>
@ -2256,4 +2303,40 @@ public class SwingUtilities2 {
public interface RepaintListener {
void repaintPerformed(JComponent c, int x, int y, int w, int h);
}
/**
* Returns whether or not the scale used by {@code GraphicsConfiguration}
* was changed.
*
* @param ev a {@code PropertyChangeEvent}
* @return whether or not the scale was changed
* @since 11
*/
public static boolean isScaleChanged(final PropertyChangeEvent ev) {
return isScaleChanged(ev.getPropertyName(), ev.getOldValue(),
ev.getNewValue());
}
/**
* Returns whether or not the scale used by {@code GraphicsConfiguration}
* was changed.
*
* @param name the name of the property
* @param oldValue the old value of the property
* @param newValue the new value of the property
* @return whether or not the scale was changed
* @since 11
*/
public static boolean isScaleChanged(final String name,
final Object oldValue,
final Object newValue) {
if (oldValue == newValue || !"graphicsConfiguration".equals(name)) {
return false;
}
var newGC = (GraphicsConfiguration) oldValue;
var oldGC = (GraphicsConfiguration) newValue;
var newTx = newGC != null ? newGC.getDefaultTransform() : null;
var oldTx = oldGC != null ? oldGC.getDefaultTransform() : null;
return !Objects.equals(newTx, oldTx);
}
}

View File

@ -117,8 +117,8 @@ public class CSVUtilTest {
CSVUtil.Escape.println(new PrintStream(outputStream), format, toObjectArray(args));
// get the actual string
String printedStream = new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
// remove newline
assertEquals(expected, printedStream.substring(0, printedStream.length() - 1));
// add newline to the expected string
assertEquals(expected + System.lineSeparator(), printedStream);
}
private static Object[] toObjectArray(String args) {

View File

@ -27,6 +27,8 @@ package org.graalvm.compiler.debug.test;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
@ -80,15 +82,15 @@ public class VersionsTest {
}
@Test
public void emptyProperties() {
Path root = Paths.get("file:/");
public void emptyProperties() throws URISyntaxException {
Path root = Paths.get(new URI("file:/"));
Versions v = new Versions(root);
assertEmpty(v.withVersions(null));
}
@Test
public void emptyWithNullProperties() {
Path root = Paths.get("file:/");
public void emptyWithNullProperties() throws URISyntaxException {
Path root = Paths.get(new URI("file:/"));
Versions v = new Versions(root);
assertEmpty(v.withVersions(null));
}

View File

@ -448,6 +448,9 @@ JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA}
ifneq ($(VS120COMNTOOLS), )
JTREG_BASIC_OPTIONS += -e:VS120COMNTOOLS="$(shell $(GETMIXEDPATH) "$(patsubst %\,%,$(VS120COMNTOOLS))")"
endif
JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
# Set other vm and test options
JTREG_TEST_OPTIONS += $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
ifneq ($(JIB_JAR), )

View File

@ -149,8 +149,6 @@ vmTestbase/nsk/jvmti/PopFrame/popframe009/TestDescription.java
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java 8195674 generic-all
vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java 8195674 generic-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java 8195630 generic-all
vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/TestDescription.java 8202342 generic-all
vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java 8204506 macosx-all
@ -167,3 +165,19 @@ compiler/stable/TestStableObject.java 8204347 gener
compiler/stable/TestStableShort.java 8204347 generic-all
compiler/stable/TestStableUByte.java 8204347 generic-all
compiler/stable/TestStableUShort.java 8204347 generic-all
# Graal unit tests
org.graalvm.compiler.core.test.CheckGraalInvariants 8205081
org.graalvm.compiler.core.test.inlining.PolymorphicInliningTest 8205081
org.graalvm.compiler.core.test.OptionsVerifierTest 8205081
org.graalvm.compiler.core.test.ProfilingInfoTest 8205081
org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081
org.graalvm.compiler.hotspot.test.HsErrLogTest 8205081
org.graalvm.compiler.hotspot.test.OptionsInFileTest 8205081
org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081
org.graalvm.compiler.replacements.test.classfile.RedefineIntrinsicTest 8205081
org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955
org.graalvm.compiler.core.test.CountedLoopTest 8199885
org.graalvm.compiler.debug.test.DebugContextTest 8203504
org.graalvm.compiler.core.test.VerifyDebugUsageTest 8205078

View File

@ -76,7 +76,8 @@ tier1_compiler = \
hotspot_not_fast_compiler = \
:hotspot_compiler \
-:tier1_compiler \
-:hotspot_slow_compiler
-:hotspot_slow_compiler \
-compiler/graalunit
hotspot_slow_compiler = \
compiler/codegen/aes \

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.api.directives.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.api.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.aarch64.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.amd64.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.sparc.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix jdk.internal.vm.compiler.collections.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.amd64.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
* @requires vm.simpleArch == "sparcv9"
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.sparc.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.debug.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
* @requires vm.graal.enabled
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.graph.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.amd64.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.lir.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.micro -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.backend -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.bytecode -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.except -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.hotpath -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.hotspot -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.jdk -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.[a-lA-L] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.[mM] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.[n-zN-Z] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.loop -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.optimize -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.[a-eA-E] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.[fF] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.[g-zG-Z] -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.threads -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.lir.jtt -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.loop.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
* @requires vm.graal.enabled
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.nodes.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.options.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.phases.common.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,36 @@
This directory contains jtreg tests which are wrapper tests to execute Graal unit tests similar way they are run in Graal project.
The tests use compiler.graalunit.common.GraalUnitTestLauncher helper class to run Graal unit tests where the set of tests to execute
is specified by '-prefix' argument. GraalUnitTestLauncher launches ported com.oracle.mxtool.junit.MxJUnitWrapper to run Graal unit
tests as it is done by "mx unittest" command from Graal project.
All compiler/graalunit/*.java tests were automatically generated by generateTests.sh script which reads
"testName -> testPrefix [requiresStatement]" mapping from TestPackages.txt file and generates corresponding <testName>Test.java
tests. The mapping takes into account tests execution time to avoid very long test runs.
Graal unit tests depends on following external jar files:
asm-5.0.4.jar:
https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar
asm-tree-5.0.4.jar:
https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar
junit-4.12.jar:
https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/junit-4.12.jar
hamcrest-core-1.3.jar:
https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3.jar
java-allocation-instrumenter.jar:
https://lafo.ssw.uni-linz.ac.at/pub/java-allocation-instrumenter/java-allocation-instrumenter-8f0db117e64e.jar
Before running the tests you need to download these jars from above locations in build/<platform>/images/test/hotspot/jtreg/graal/
directory. Then you can pass it to jtreg as java option by using "-vmoptions:-Dgraalunit.libs=" or as environment variable
by using "-e:TEST_IMAGE_GRAAL_DIR=..."
Example:
> jtreg -vt -jdk:<TESTED_JDK> -vmoptions:"-vmoptions:-Dgraalunit.libs=build/<platform>/images/test/hotspot/jtreg/graal"
compiler/graalunit/UtilTest.java
To run Graal unit tests in Graal as JIT mode pass additional -vmoptions to jtreg:
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+TieredCompilation -XX:+UseJVMCICompiler -Djvmci.Compiler=graal

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.replacements.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,38 @@
Collections jdk.internal.vm.compiler.collections.test
ApiDirectives org.graalvm.compiler.api.directives.test
Api org.graalvm.compiler.api.test
AsmAarch64 org.graalvm.compiler.asm.aarch64.test
AsmAmd64 org.graalvm.compiler.asm.amd64.test
AsmSparc org.graalvm.compiler.asm.sparc.test
CoreAmd64 org.graalvm.compiler.core.amd64.test
CoreSparc org.graalvm.compiler.core.sparc.test @requires vm.simpleArch == "sparcv9"
Core org.graalvm.compiler.core.test
Debug org.graalvm.compiler.debug.test
Graph org.graalvm.compiler.graph.test @requires vm.graal.enabled
HotspotAmd64 org.graalvm.compiler.hotspot.amd64.test
HotspotLir org.graalvm.compiler.hotspot.lir.test
Hotspot org.graalvm.compiler.hotspot.test
Loop org.graalvm.compiler.loop.test
Nodes org.graalvm.compiler.nodes.test @requires vm.graal.enabled
Options org.graalvm.compiler.options.test
PhasesCommon org.graalvm.compiler.phases.common.test
Replacements org.graalvm.compiler.replacements.test
Util org.graalvm.util.test
JttBackend org.graalvm.compiler.jtt.backend
JttBytecode org.graalvm.compiler.jtt.bytecode
JttExcept org.graalvm.compiler.jtt.except
JttHotpath org.graalvm.compiler.jtt.hotpath
JttHotspot org.graalvm.compiler.jtt.hotspot
JttJdk org.graalvm.compiler.jtt.jdk
JttLangAL org.graalvm.compiler.jtt.lang.[a-lA-L]
JttLangM org.graalvm.compiler.jtt.lang.[mM]
JttLangNZ org.graalvm.compiler.jtt.lang.[n-zN-Z]
JttLoop org.graalvm.compiler.jtt.loop
Jtt.Micro org.graalvm.compiler.jtt.micro
JttOptimize org.graalvm.compiler.jtt.optimize
JttReflectAE org.graalvm.compiler.jtt.reflect.[a-eA-E]
JttReflectF org.graalvm.compiler.jtt.reflect.[fF]
JttReflectGZ org.graalvm.compiler.jtt.reflect.[g-zG-Z]
JttThreads org.graalvm.compiler.jtt.threads
LirJtt org.graalvm.compiler.lir.jtt
Lir org.graalvm.compiler.lir.test

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018, 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
* @requires vm.opt.final.EnableJVMCI == true
*
* @modules jdk.internal.vm.compiler
*
* @library /test/lib /compiler/graalunit /
*
* @build compiler.graalunit.common.GraalUnitTestLauncher
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
* @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.util.test -exclude ExcludeList.txt
*/

View File

@ -0,0 +1,120 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import org.junit.runner.*;
import org.junit.runner.notification.*;
/**
* Color support for JUnit test output using ANSI escapes codes.
*/
class AnsiTerminalDecorator extends MxRunListenerDecorator {
/** Foreground black. */
public static final String BLACK = "\u001b[30m";
/** Foreground red. */
public static final String RED = "\u001b[31m";
/** Foreground green. */
public static final String GREEN = "\u001b[32m";
/** Foreground yellow. */
public static final String YELLOW = "\u001b[33m";
/** Foreground blue. */
public static final String BLUE = "\u001b[34m";
/** Foreground magenta. */
public static final String MAGENTA = "\u001b[35m";
/** Foreground cyan. */
public static final String CYAN = "\u001b[36m";
/** Foreground white. */
public static final String WHITE = "\u001b[37m";
/** Foreground bold black. */
public static final String BOLD_BLACK = "\u001b[30;1m";
/** Foreground bold red. */
public static final String BOLD_RED = "\u001b[31;1m";
/** Foreground bold green. */
public static final String BOLD_GREEN = "\u001b[32;1m";
/** Foreground bold yellow. */
public static final String BOLD_YELLOW = "\u001b[33;1m";
/** Foreground bold blue. */
public static final String BOLD_BLUE = "\u001b[34;1m";
/** Foreground bold magenta. */
public static final String BOLD_MAGENTA = "\u001b[35;1m";
/** Foreground bold cyan. */
public static final String BOLD_CYAN = "\u001b[36;1m";
/** Foreground bold white. */
public static final String BOLD_WHITE = "\u001b[37;1m";
/** Background black. */
public static final String BG_BLACK = "\u001b[40m";
/** Background red. */
public static final String BG_RED = "\u001b[41m";
/** Background green. */
public static final String BG_GREEN = "\u001b[42m";
/** Background yellow. */
public static final String BG_YELLOW = "\u001b[43m";
/** Background blue. */
public static final String BG_BLUE = "\u001b[44m";
/** Background magenta. */
public static final String BG_MAGENTA = "\u001b[45m";
/** Background cyan. */
public static final String BG_CYAN = "\u001b[46m";
/** Background white. */
public static final String BG_WHITE = "\u001b[47m";
/** Reset. */
public static final String RESET = "\u001b[0m";
/** Underline. */
public static final String UNDERLINED = "\u001b[4m";
AnsiTerminalDecorator(MxRunListener l) {
super(l);
}
@Override
public void testSucceeded(Description description) {
getWriter().print(GREEN);
super.testSucceeded(description);
getWriter().print(RESET);
}
@Override
public void testAssumptionFailure(Failure failure) {
getWriter().print(BLUE);
super.testAssumptionFailure(failure);
getWriter().print(RESET);
}
@Override
public void testFailed(Failure failure) {
getWriter().print(RED);
super.testFailed(failure);
getWriter().print(RESET);
}
@Override
public void testIgnored(Description description) {
getWriter().print(MAGENTA);
super.testIgnored(description);
getWriter().print(RESET);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2014, 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
@ -20,22 +20,22 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.util;
package com.oracle.mxtool.junit;
import nsk.jvmti.AttachOnDemand.attach024.*;
import org.junit.runner.notification.*;
public class ServiceConfigurationError extends Error {
private static final long serialVersionUID = 74132770414881L;
class EagerStackTraceDecorator extends MxRunListenerDecorator {
public ServiceConfigurationError(String msg) {
super(msg);
EagerStackTraceDecorator(MxRunListener l) {
super(l);
}
public ServiceConfigurationError(String msg, Throwable cause) {
super(msg, cause);
@Override
public void testFailed(Failure failure) {
super.testFailed(failure);
getWriter().println();
getWriter().println(failure.getTestHeader());
getWriter().print(failure.getTrace());
}
public String toString() {
return attach024Agent00.MODIFIED_TO_STRING;
}
}

View File

@ -0,0 +1,341 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
/**
* Finds classes in given jar files that contain methods annotated by a given set of annotations.
*/
public class FindClassesByAnnotatedMethods {
/**
* Finds classes in a given set of jar files that contain at least one method with an annotation
* from a given set of annotations. The qualified name and containing jar file (separated by a
* space) is written to {@link System#out} for each matching class.
*
* @param args jar file names, annotations and snippets patterns. Annotations are those starting
* with "@" and can be either qualified or unqualified annotation class names,
* snippets patterns are those starting with {@code "snippetsPattern:"} and the rest
* are jar file names
*/
public static void main(String... args) throws Throwable {
Set<String> qualifiedAnnotations = new HashSet<>();
Set<String> unqualifiedAnnotations = new HashSet<>();
for (String arg : args) {
if (isAnnotationArg(arg)) {
String annotation = arg.substring(1);
int lastDot = annotation.lastIndexOf('.');
if (lastDot != -1) {
qualifiedAnnotations.add(annotation);
} else {
String unqualifed = annotation.substring(lastDot + 1);
unqualifiedAnnotations.add(unqualifed);
}
}
}
for (String jarFilePath : args) {
if (isSnippetArg(jarFilePath) || isAnnotationArg(jarFilePath)) {
continue;
}
JarFile jarFile = new JarFile(jarFilePath);
Enumeration<JarEntry> e = jarFile.entries();
int unsupportedClasses = 0;
System.out.print(jarFilePath);
while (e.hasMoreElements()) {
JarEntry je = e.nextElement();
if (je.isDirectory() || !je.getName().endsWith(".class")) {
continue;
}
Set<String> methodAnnotationTypes = new HashSet<>();
DataInputStream stream = new DataInputStream(new BufferedInputStream(jarFile.getInputStream(je), (int) je.getSize()));
boolean isSupported = true;
try {
readClassfile(stream, methodAnnotationTypes);
} catch (UnsupportedClassVersionError ucve) {
isSupported = false;
unsupportedClasses++;
}
String className = je.getName().substring(0, je.getName().length() - ".class".length()).replaceAll("/", ".");
if (!isSupported) {
System.out.print(" !" + className);
}
for (String annotationType : methodAnnotationTypes) {
if (!qualifiedAnnotations.isEmpty()) {
if (qualifiedAnnotations.contains(annotationType)) {
System.out.print(" " + className);
}
}
if (!unqualifiedAnnotations.isEmpty()) {
final int lastDot = annotationType.lastIndexOf('.');
if (lastDot != -1) {
String simpleName = annotationType.substring(lastDot + 1);
int lastDollar = simpleName.lastIndexOf('$');
if (lastDollar != -1) {
simpleName = simpleName.substring(lastDollar + 1);
}
if (unqualifiedAnnotations.contains(simpleName)) {
System.out.print(" " + className);
}
}
}
}
}
if (unsupportedClasses != 0) {
System.err.printf("Warning: %d classes in %s skipped as their class file version is not supported by %s%n", unsupportedClasses, jarFilePath,
FindClassesByAnnotatedMethods.class.getSimpleName());
}
System.out.println();
}
}
private static boolean isAnnotationArg(String arg) {
return arg.charAt(0) == '@';
}
private static boolean isSnippetArg(String arg) {
return arg.startsWith("snippetsPattern:");
}
/*
* Small bytecode parser that extract annotations.
*/
private static final int MAJOR_VERSION_JAVA7 = 51;
private static final int MAJOR_VERSION_OFFSET = 44;
private static final byte CONSTANT_Utf8 = 1;
private static final byte CONSTANT_Integer = 3;
private static final byte CONSTANT_Float = 4;
private static final byte CONSTANT_Long = 5;
private static final byte CONSTANT_Double = 6;
private static final byte CONSTANT_Class = 7;
private static final byte CONSTANT_Fieldref = 9;
private static final byte CONSTANT_String = 8;
private static final byte CONSTANT_Methodref = 10;
private static final byte CONSTANT_InterfaceMethodref = 11;
private static final byte CONSTANT_NameAndType = 12;
private static final byte CONSTANT_MethodHandle = 15;
private static final byte CONSTANT_MethodType = 16;
private static final byte CONSTANT_Dynamic = 17;
private static final byte CONSTANT_InvokeDynamic = 18;
private static void readClassfile(DataInputStream stream, Collection<String> methodAnnotationTypes) throws IOException {
// magic
int magic = stream.readInt();
assert magic == 0xCAFEBABE;
int minor = stream.readUnsignedShort();
int major = stream.readUnsignedShort();
if (major < MAJOR_VERSION_JAVA7) {
throw new UnsupportedClassVersionError("Unsupported class file version: " + major + "." + minor);
}
// Starting with JDK8, ignore a classfile that has a newer format than the current JDK.
String javaVersion = System.getProperties().get("java.specification.version").toString();
int majorJavaVersion;
if (javaVersion.startsWith("1.")) {
javaVersion = javaVersion.substring(2);
majorJavaVersion = Integer.parseInt(javaVersion);
} else {
majorJavaVersion = Integer.parseInt(javaVersion);
}
if (major > MAJOR_VERSION_OFFSET + majorJavaVersion) {
throw new UnsupportedClassVersionError("Unsupported class file version: " + major + "." + minor);
}
String[] cp = readConstantPool(stream, major, minor);
// access_flags, this_class, super_class
stream.skipBytes(6);
// interfaces
stream.skipBytes(stream.readUnsignedShort() * 2);
// fields
skipFields(stream);
// methods
readMethods(stream, cp, methodAnnotationTypes);
}
private static void skipFully(DataInputStream stream, int n) throws IOException {
long skipped = 0;
do {
long s = stream.skip(n - skipped);
skipped += s;
if (s == 0 && skipped != n) {
// Check for EOF (i.e., truncated class file)
if (stream.read() == -1) {
throw new IOException("truncated stream");
}
skipped++;
}
} while (skipped != n);
}
private static String[] readConstantPool(DataInputStream stream, int major, int minor) throws IOException {
int count = stream.readUnsignedShort();
String[] cp = new String[count];
int i = 1;
while (i < count) {
byte tag = stream.readByte();
switch (tag) {
case CONSTANT_Class:
case CONSTANT_String:
case CONSTANT_MethodType: {
skipFully(stream, 2);
break;
}
case CONSTANT_InterfaceMethodref:
case CONSTANT_Methodref:
case CONSTANT_Fieldref:
case CONSTANT_NameAndType:
case CONSTANT_Float:
case CONSTANT_Integer:
case CONSTANT_Dynamic:
case CONSTANT_InvokeDynamic: {
skipFully(stream, 4);
break;
}
case CONSTANT_Long:
case CONSTANT_Double: {
skipFully(stream, 8);
break;
}
case CONSTANT_Utf8: {
cp[i] = stream.readUTF();
break;
}
case CONSTANT_MethodHandle: {
skipFully(stream, 3);
break;
}
default: {
throw new InternalError(String.format("Invalid constant pool tag: " + tag + ". Maybe %s needs updating for changes introduced by class file version %d.%d?",
FindClassesByAnnotatedMethods.class, major, minor));
}
}
if ((tag == CONSTANT_Double) || (tag == CONSTANT_Long)) {
i += 2;
} else {
i += 1;
}
}
return cp;
}
private static void skipAttributes(DataInputStream stream) throws IOException {
int attributesCount;
attributesCount = stream.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
stream.skipBytes(2); // name_index
int attributeLength = stream.readInt();
skipFully(stream, attributeLength);
}
}
private static void readMethodAttributes(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException {
int attributesCount;
attributesCount = stream.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
String attributeName = cp[stream.readUnsignedShort()];
int attributeLength = stream.readInt();
if (attributeName.equals("RuntimeVisibleAnnotations")) {
int numAnnotations = stream.readUnsignedShort();
for (int a = 0; a != numAnnotations; a++) {
readAnnotation(stream, cp, methodAnnotationTypes);
}
} else {
skipFully(stream, attributeLength);
}
}
}
private static void readAnnotation(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException {
int typeIndex = stream.readUnsignedShort();
int pairs = stream.readUnsignedShort();
String type = cp[typeIndex];
String className = type.substring(1, type.length() - 1).replace('/', '.');
methodAnnotationTypes.add(className);
readAnnotationElements(stream, cp, pairs, true, methodAnnotationTypes);
}
private static void readAnnotationElements(DataInputStream stream, String[] cp, int pairs, boolean withElementName, Collection<String> methodAnnotationTypes) throws IOException {
for (int p = 0; p < pairs; p++) {
if (withElementName) {
skipFully(stream, 2);
}
int tag = stream.readByte();
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'Z':
case 's':
case 'c':
skipFully(stream, 2);
break;
case 'e':
skipFully(stream, 4);
break;
case '@':
readAnnotation(stream, cp, methodAnnotationTypes);
break;
case '[': {
int numValues = stream.readUnsignedShort();
readAnnotationElements(stream, cp, numValues, false, methodAnnotationTypes);
break;
}
}
}
}
private static void skipFields(DataInputStream stream) throws IOException {
int count = stream.readUnsignedShort();
for (int i = 0; i < count; i++) {
stream.skipBytes(6); // access_flags, name_index, descriptor_index
skipAttributes(stream);
}
}
private static void readMethods(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException {
int count = stream.readUnsignedShort();
for (int i = 0; i < count; i++) {
skipFully(stream, 6); // access_flags, name_index, descriptor_index
readMethodAttributes(stream, cp, methodAnnotationTypes);
}
}
}

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import org.junit.runner.*;
class GCAfterTestDecorator extends MxRunListenerDecorator {
GCAfterTestDecorator(MxRunListener l) {
super(l);
}
@Override
public void testFinished(Description description) {
System.gc();
super.testFinished(description);
}
}

View File

@ -0,0 +1,211 @@
/*
* 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 com.oracle.mxtool.junit;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Set;
/**
* Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be
* developed against JDK8 but use module logic if deployed on JDK9.
*/
class JLModule {
private final Object realModule;
JLModule(Object module) {
this.realModule = module;
}
private static final Class<?> moduleClass;
private static final Class<?> layerClass;
private static final Method bootMethod;
private static final Method modulesMethod;
private static final Method getModuleMethod;
private static final Method getUnnamedModuleMethod;
private static final Method getNameMethod;
private static final Method getPackagesMethod;
private static final Method isExportedMethod;
private static final Method isExported2Method;
private static final Method addExportsMethod;
private static final Method addOpensMethod;
static {
try {
moduleClass = findModuleClass();
Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
layerClass = findModuleLayerClass();
bootMethod = layerClass.getMethod("boot");
modulesMethod = layerClass.getMethod("modules");
getModuleMethod = Class.class.getMethod("getModule");
getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
getNameMethod = moduleClass.getMethod("getName");
getPackagesMethod = moduleClass.getMethod("getPackages");
isExportedMethod = moduleClass.getMethod("isExported", String.class);
isExported2Method = moduleClass.getMethod("isExported", String.class, moduleClass);
addExportsMethod = modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass);
addOpensMethod = getDeclaredMethodOptional(modulesClass, "addOpens", moduleClass, String.class, moduleClass);
} catch (Exception e) {
throw new AssertionError(e);
}
}
// API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e.
protected static Class<?> findModuleClass() throws ClassNotFoundException {
try {
return Class.forName("java.lang.Module");
} catch (ClassNotFoundException e) {
return Class.forName("java.lang.reflect.Module");
}
}
// API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e.
protected static Class<?> findModuleLayerClass() throws ClassNotFoundException {
try {
return Class.forName("java.lang.ModuleLayer");
} catch (ClassNotFoundException e) {
return Class.forName("java.lang.reflect.Layer");
}
}
private static Method getDeclaredMethodOptional(Class<?> declaringClass, String name, Class<?>... parameterTypes) {
try {
return declaringClass.getDeclaredMethod(name, parameterTypes);
} catch (NoSuchMethodException e) {
return null;
}
}
public static JLModule fromClass(Class<?> cls) {
try {
return new JLModule(getModuleMethod.invoke(cls));
} catch (Exception e) {
throw new AssertionError(e);
}
}
@SuppressWarnings("unchecked")
public static JLModule find(String name) {
try {
Object bootLayer = bootMethod.invoke(null);
Set<Object> modules = (Set<Object>) modulesMethod.invoke(bootLayer);
for (Object m : modules) {
JLModule module = new JLModule(m);
String mname = module.getName();
if (mname.equals(name)) {
return module;
}
}
} catch (Exception e) {
throw new InternalError(e);
}
return null;
}
public static JLModule getUnnamedModuleFor(ClassLoader cl) {
try {
return new JLModule(getUnnamedModuleMethod.invoke(cl));
} catch (Exception e) {
throw new AssertionError(e);
}
}
public String getName() {
try {
return (String) getNameMethod.invoke(realModule);
} catch (Exception e) {
throw new AssertionError(e);
}
}
/**
* Exports all packages in this module to a given module.
*/
public void exportAllPackagesTo(JLModule module) {
if (this != module) {
for (String pkg : getPackages()) {
// Export all JVMCI packages dynamically instead
// of requiring a long list of -XaddExports
// options on the JVM command line.
if (!isExported(pkg, module)) {
addExports(pkg, module);
addOpens(pkg, module);
}
}
}
}
@SuppressWarnings("unchecked")
public Iterable<String> getPackages() {
try {
// API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e#l1.15
Object res = getPackagesMethod.invoke(realModule);
if (res instanceof String[]) {
return Arrays.asList((String[]) res);
}
return (Set<String>) res;
} catch (Exception e) {
throw new AssertionError(e);
}
}
public boolean isExported(String pn) {
try {
return (Boolean) isExportedMethod.invoke(realModule, pn);
} catch (Exception e) {
throw new AssertionError(e);
}
}
public boolean isExported(String pn, JLModule other) {
try {
return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule);
} catch (Exception e) {
throw new AssertionError(e);
}
}
public void addExports(String pn, JLModule other) {
try {
addExportsMethod.invoke(null, realModule, pn, other.realModule);
} catch (Exception e) {
throw new AssertionError(e);
}
}
public void addOpens(String pn, JLModule other) {
if (addOpensMethod != null) {
try {
addOpensMethod.invoke(null, realModule, pn, other.realModule);
} catch (Exception e) {
throw new AssertionError(e);
}
}
}
@Override
public String toString() {
return realModule.toString();
}
}

View File

@ -0,0 +1,116 @@
/*
* Copyright (c) 2014, 2017, 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 com.oracle.mxtool.junit;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.junit.runner.Description;
import org.junit.runner.Request;
import org.junit.runner.notification.Failure;
public final class MxJUnitRequest {
private final Request request;
final Set<Class<?>> classes;
final String methodName;
final List<Failure> missingClasses;
private MxJUnitRequest(Request request, Set<Class<?>> classes, String methodName, List<Failure> missingClasses) {
this.request = request;
this.classes = classes;
this.methodName = methodName;
this.missingClasses = missingClasses;
}
public Request getRequest() {
return request;
}
public static final class BuilderException extends Exception {
private static final long serialVersionUID = 1L;
private BuilderException(String msg) {
super(msg);
}
}
public static class Builder {
private final Set<Class<?>> classes = new LinkedHashSet<>();
private String methodName = null;
private final List<Failure> missingClasses = new ArrayList<>();
protected Class<?> resolveClass(String name) throws ClassNotFoundException {
return Class.forName(name, false, Builder.class.getClassLoader());
}
public void addTestSpec(String arg) throws BuilderException {
String className;
/*
* Entries of the form class#method are handled specially. Only one can be specified on
* the command line as there's no obvious way to build a runner for multiple ones.
*/
if (methodName != null) {
throw new BuilderException("Only a single class and method can be specified: " + arg);
} else if (arg.contains("#")) {
String[] pair = arg.split("#");
if (pair.length != 2) {
throw new BuilderException("Malformed class and method request: " + arg);
} else if (!classes.isEmpty()) {
throw new BuilderException("Only a single class and method can be specified: " + arg);
} else {
methodName = pair[1];
className = pair[0];
}
} else {
className = arg;
}
try {
Class<?> cls = resolveClass(className);
if ((cls.getModifiers() & Modifier.ABSTRACT) == 0) {
classes.add(cls);
}
} catch (ClassNotFoundException e) {
Description description = Description.createSuiteDescription(className);
Failure failure = new Failure(description, e);
missingClasses.add(failure);
}
}
public MxJUnitRequest build() {
Request request;
if (methodName == null) {
request = Request.classes(classes.toArray(new Class<?>[0]));
} else {
request = Request.method(classes.iterator().next(), methodName);
}
return new MxJUnitRequest(request, classes, methodName, missingClasses);
}
}
}

View File

@ -0,0 +1,484 @@
/*
* Copyright (c) 2014, 2017, 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 com.oracle.mxtool.junit;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.internal.JUnitSystem;
import org.junit.internal.RealSystem;
import org.junit.runner.Description;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
import org.junit.runner.Runner;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.ParentRunner;
import org.junit.runners.model.RunnerScheduler;
import junit.runner.Version;
public class MxJUnitWrapper {
public static class MxJUnitConfig {
public boolean verbose = false;
public boolean veryVerbose = false;
public boolean enableTiming = false;
public boolean failFast = false;
public boolean color = false;
public boolean eagerStackTrace = false;
public boolean gcAfterTest = false;
public boolean recordResults = false;
public int repeatCount = 1;
}
private static class RepeatingRunner extends Runner {
private final Runner parent;
private int repeat;
RepeatingRunner(Runner parent, int repeat) {
this.parent = parent;
this.repeat = repeat;
}
@Override
public Description getDescription() {
return parent.getDescription();
}
@Override
public void run(RunNotifier notifier) {
for (int i = 0; i < repeat; i++) {
parent.run(notifier);
}
}
@Override
public int testCount() {
return super.testCount() * repeat;
}
}
private static class RepeatingRequest extends Request {
private final Request request;
private final int repeat;
RepeatingRequest(Request request, int repeat) {
this.request = request;
this.repeat = repeat;
}
@Override
public Runner getRunner() {
return new RepeatingRunner(request.getRunner(), repeat);
}
}
/**
* Run the tests contained in the classes named in the <code>args</code>. A single test method
* can be specified by adding #method after the class name. Only a single test can be run in
* this way. If all tests run successfully, exit with a status of 0. Otherwise exit with a
* status of 1. Write feedback while tests are running and write stack traces for all failed
* tests after the tests all complete.
*
* @param args names of classes in which to find tests to run
*/
public static void main(String... args) {
JUnitSystem system = new RealSystem();
JUnitCore junitCore = new JUnitCore();
system.out().println("MxJUnitCore");
system.out().println("JUnit version " + Version.id());
MxJUnitRequest.Builder builder = new MxJUnitRequest.Builder();
MxJUnitConfig config = new MxJUnitConfig();
String[] expandedArgs = expandArgs(args);
int i = 0;
while (i < expandedArgs.length) {
String each = expandedArgs[i];
if (each.charAt(0) == '-') {
// command line arguments
if (each.contentEquals("-JUnitVerbose")) {
config.verbose = true;
} else if (each.contentEquals("-JUnitVeryVerbose")) {
config.veryVerbose = true;
} else if (each.contentEquals("-JUnitFailFast")) {
config.failFast = true;
} else if (each.contentEquals("-JUnitEnableTiming")) {
config.enableTiming = true;
} else if (each.contentEquals("-JUnitColor")) {
config.color = true;
} else if (each.contentEquals("-JUnitEagerStackTrace")) {
config.eagerStackTrace = true;
} else if (each.contentEquals("-JUnitGCAfterTest")) {
config.gcAfterTest = true;
} else if (each.contentEquals("-JUnitRecordResults")) {
config.recordResults = true;
} else if (each.contentEquals("-JUnitRepeat")) {
if (i + 1 >= expandedArgs.length) {
system.out().println("Must include argument for -JUnitRepeat");
System.exit(1);
}
try {
config.repeatCount = Integer.parseInt(expandedArgs[++i]);
} catch (NumberFormatException e) {
system.out().println("Expected integer argument for -JUnitRepeat. Found: " + expandedArgs[i]);
System.exit(1);
}
} else {
system.out().println("Unknown command line argument: " + each);
}
} else {
try {
builder.addTestSpec(each);
} catch (MxJUnitRequest.BuilderException ex) {
system.out().println(ex.getMessage());
System.exit(1);
}
}
i++;
}
MxJUnitRequest request = builder.build();
if (System.getProperty("java.specification.version").compareTo("1.9") >= 0) {
addExports(request.classes, system.out());
}
for (RunListener p : ServiceLoader.load(RunListener.class)) {
junitCore.addListener(p);
}
Result result = runRequest(junitCore, system, config, request);
System.exit(result.wasSuccessful() ? 0 : 1);
}
private static PrintStream openFile(JUnitSystem system, String name) {
File file = new File(name).getAbsoluteFile();
try {
FileOutputStream fos = new FileOutputStream(file);
return new PrintStream(fos, true);
} catch (FileNotFoundException e) {
system.out().println("Could not open " + file + " for writing: " + e);
System.exit(1);
return null;
}
}
public static Result runRequest(JUnitCore junitCore, JUnitSystem system, MxJUnitConfig config, MxJUnitRequest mxRequest) {
final TextRunListener textListener;
if (config.veryVerbose) {
textListener = new VerboseTextListener(system, mxRequest.classes.size(), VerboseTextListener.SHOW_ALL_TESTS);
} else if (config.verbose) {
textListener = new VerboseTextListener(system, mxRequest.classes.size());
} else {
textListener = new TextRunListener(system);
}
TimingDecorator timings = config.enableTiming ? new TimingDecorator(textListener) : null;
MxRunListener mxListener = config.enableTiming ? timings : textListener;
if (config.color) {
mxListener = new AnsiTerminalDecorator(mxListener);
}
if (config.eagerStackTrace) {
mxListener = new EagerStackTraceDecorator(mxListener);
}
if (config.gcAfterTest) {
mxListener = new GCAfterTestDecorator(mxListener);
}
if (config.recordResults) {
PrintStream passed = openFile(system, "passed.txt");
PrintStream failed = openFile(system, "failed.txt");
mxListener = new TestResultLoggerDecorator(passed, failed, mxListener);
}
junitCore.addListener(TextRunListener.createRunListener(mxListener));
Request request = mxRequest.getRequest();
if (mxRequest.methodName == null) {
if (config.failFast) {
Runner runner = request.getRunner();
if (runner instanceof ParentRunner) {
ParentRunner<?> parentRunner = (ParentRunner<?>) runner;
parentRunner.setScheduler(new RunnerScheduler() {
public void schedule(Runnable childStatement) {
if (textListener.getLastFailure() == null) {
childStatement.run();
}
}
public void finished() {
}
});
} else {
system.out().println("Unexpected Runner subclass " + runner.getClass().getName() + " - fail fast not supported");
}
}
} else {
if (config.failFast) {
system.out().println("Single method selected - fail fast not supported");
}
}
if (config.repeatCount != 1) {
request = new RepeatingRequest(request, config.repeatCount);
}
if (config.enableTiming) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
printTimings(timings);
}
});
}
Result result = junitCore.run(request);
for (Failure each : mxRequest.missingClasses) {
result.getFailures().add(each);
}
return result;
}
private static final Pattern MODULE_PACKAGE_RE = Pattern.compile("([^/]+)/(.+)");
private static class Timing<T> implements Comparable<Timing<T>> {
final T subject;
final long value;
Timing(T subject, long value) {
this.subject = subject;
this.value = value;
}
public int compareTo(Timing<T> o) {
if (this.value < o.value) {
return -1;
}
if (this.value > o.value) {
return 1;
}
return 0;
}
}
// Should never need to customize so using a system property instead
// of a command line option for customization is fine.
private static final int TIMINGS_TO_PRINT = Integer.getInteger("mx.junit.timings_to_print", 10);
private static void printTimings(TimingDecorator timings) {
if (TIMINGS_TO_PRINT != 0) {
List<Timing<Class<?>>> classTimes = new ArrayList<>(timings.classTimes.size());
List<Timing<Description>> testTimes = new ArrayList<>(timings.testTimes.size());
for (Map.Entry<Class<?>, Long> e : timings.classTimes.entrySet()) {
classTimes.add(new Timing<>(e.getKey(), e.getValue()));
}
for (Map.Entry<Description, Long> e : timings.testTimes.entrySet()) {
testTimes.add(new Timing<>(e.getKey(), e.getValue()));
}
classTimes.sort(Collections.reverseOrder());
testTimes.sort(Collections.reverseOrder());
System.out.println();
System.out.printf("%d longest running test classes:%n", TIMINGS_TO_PRINT);
for (int i = 0; i < TIMINGS_TO_PRINT && i < classTimes.size(); i++) {
Timing<Class<?>> timing = classTimes.get(i);
System.out.printf(" %,10d ms %s%n", timing.value, timing.subject.getName());
}
System.out.printf("%d longest running tests:%n", TIMINGS_TO_PRINT);
for (int i = 0; i < TIMINGS_TO_PRINT && i < testTimes.size(); i++) {
Timing<Description> timing = testTimes.get(i);
System.out.printf(" %,10d ms %s%n", timing.value, timing.subject);
}
Object[] current = timings.getCurrentTestDuration();
if (current != null) {
System.out.printf("Test %s not finished after %d ms%n", current[0], current[1]);
}
}
}
/**
* Adds the super types of {@code cls} to {@code supertypes}.
*/
private static void gatherSupertypes(Class<?> cls, Set<Class<?>> supertypes) {
if (!supertypes.contains(cls)) {
supertypes.add(cls);
Class<?> superclass = cls.getSuperclass();
if (superclass != null) {
gatherSupertypes(superclass, supertypes);
}
for (Class<?> iface : cls.getInterfaces()) {
gatherSupertypes(iface, supertypes);
}
}
}
/**
* Updates modules specified in {@code AddExport} annotations on {@code classes} to export
* concealed packages to the annotation classes' declaring modules.
*/
private static void addExports(Set<Class<?>> classes, PrintStream out) {
Set<Class<?>> types = new HashSet<>();
for (Class<?> cls : classes) {
gatherSupertypes(cls, types);
}
for (Class<?> cls : types) {
Annotation[] annos = cls.getAnnotations();
for (Annotation a : annos) {
Class<? extends Annotation> annotationType = a.annotationType();
if (annotationType.getSimpleName().equals("AddExports")) {
Optional<String[]> value = getElement("value", String[].class, a);
if (value.isPresent()) {
for (String export : value.get()) {
Matcher m = MODULE_PACKAGE_RE.matcher(export);
if (m.matches()) {
String moduleName = m.group(1);
String packageName = m.group(2);
JLModule module = JLModule.find(moduleName);
if (module == null) {
out.printf("%s: Cannot find module named %s specified in \"AddExports\" annotation: %s%n", cls.getName(), moduleName, a);
} else {
if (packageName.equals("*")) {
module.exportAllPackagesTo(JLModule.fromClass(cls));
} else {
module.addExports(packageName, JLModule.fromClass(cls));
module.addOpens(packageName, JLModule.fromClass(cls));
}
}
} else {
out.printf("%s: Ignoring \"AddExports\" annotation with value not matching <module>/<package> pattern: %s%n", cls.getName(), a);
}
}
} else {
out.printf("%s: Ignoring \"AddExports\" annotation without `String value` element: %s%n", cls.getName(), a);
}
}
}
}
}
/**
* Gets the value of the element named {@code name} of type {@code type} from {@code annotation}
* if present.
*
* @return the requested element value wrapped in an {@link Optional} or
* {@link Optional#empty()} if {@code annotation} has no element named {@code name}
* @throws AssertionError if {@code annotation} has an element of the given name but whose type
* is not {@code type} or if there's some problem reading the value via reflection
*/
private static <T> Optional<T> getElement(String name, Class<T> type, Annotation annotation) {
Class<? extends Annotation> annotationType = annotation.annotationType();
Method valueAccessor;
try {
valueAccessor = annotationType.getMethod(name);
if (!valueAccessor.getReturnType().equals(type)) {
throw new AssertionError(String.format("Element %s of %s is of type %s, not %s ", name, annotationType.getName(), valueAccessor.getReturnType().getName(), type.getName()));
}
} catch (NoSuchMethodException e) {
return Optional.empty();
}
try {
return Optional.of(type.cast(valueAccessor.invoke(annotation)));
} catch (Exception e) {
throw new AssertionError(String.format("Could not read %s element from %s", name, annotation), e);
}
}
/**
* Expand any arguments starting with @ and return the resulting argument array.
*
* @return the expanded argument array
*/
private static String[] expandArgs(String[] args) {
List<String> result = null;
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.length() > 0 && arg.charAt(0) == '@') {
if (result == null) {
result = new ArrayList<>();
for (int j = 0; j < i; j++) {
result.add(args[j]);
}
expandArg(arg.substring(1), result);
}
} else if (result != null) {
result.add(arg);
}
}
return result != null ? result.toArray(new String[0]) : args;
}
/**
* Add each line from {@code filename} to the list {@code args}.
*/
private static void expandArg(String filename, List<String> args) {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(filename));
String buf;
while ((buf = br.readLine()) != null) {
args.add(buf);
}
br.close();
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(2);
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(3);
}
}
}
}

View File

@ -0,0 +1,147 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import java.io.*;
import org.junit.internal.*;
import org.junit.runner.*;
import org.junit.runner.notification.*;
interface MxRunListener {
/**
* Called before any tests have been run.
*
* @param description describes the tests to be run
*/
default void testRunStarted(Description description) {
}
/**
* Called when all tests have finished.
*
* @param result the summary of the test run, including all the tests that failed
*/
default void testRunFinished(Result result) {
}
/**
* Called when a test class is about to be started.
*
* @param clazz the test class
*/
default void testClassStarted(Class<?> clazz) {
}
/**
* Called when all tests of a test class have finished.
*
* @param clazz the test class
* @param numPassed number of tests in {@code clazz} that passed
* @param numFailed number of tests in {@code clazz} that failed
*/
default void testClassFinished(Class<?> clazz, int numPassed, int numFailed) {
}
/**
* Called when an atomic test is about to be started. This is also called for ignored tests.
*
* @param description the description of the test that is about to be run (generally a class and
* method name)
*/
default void testStarted(Description description) {
}
/**
* Called when an atomic test has finished, whether the test succeeds, fails or is ignored.
*
* @param description the description of the test that just ran
*/
default void testFinished(Description description) {
}
/**
* Called when an atomic test fails.
*
* @param failure describes the test that failed and the exception that was thrown
*/
default void testFailed(Failure failure) {
}
/**
* Called when a test will not be run, generally because a test method is annotated with
* {@link org.junit.Ignore}.
*
* @param description describes the test that will not be run
*/
default void testIgnored(Description description) {
}
/**
* Called when an atomic test succeeds.
*
* @param description describes the test that will not be run
*/
default void testSucceeded(Description description) {
}
/**
* Called when an atomic test flags that it assumes a condition that is false.
*
* @param failure describes the test that failed and the {@link AssumptionViolatedException}
* that was thrown
*/
default void testAssumptionFailure(Failure failure) {
}
/**
* Called after {@link #testClassFinished(Class, int, int)}.
*/
default void testClassFinishedDelimiter() {
}
/**
* Called after {@link #testClassStarted(Class)}.
*/
default void testClassStartedDelimiter() {
}
/**
* Called after {@link #testStarted(Description)}.
*/
default void testStartedDelimiter() {
}
/**
* Called after {@link #testFailed(Failure)}.
*/
default void testFinishedDelimiter() {
}
default boolean beVerbose() {
return false;
}
PrintStream getWriter();
}

View File

@ -0,0 +1,113 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import java.io.*;
import org.junit.runner.*;
import org.junit.runner.notification.*;
abstract class MxRunListenerDecorator implements MxRunListener {
private final MxRunListener l;
MxRunListenerDecorator(MxRunListener l) {
this.l = l;
}
@Override
public void testRunStarted(Description description) {
l.testRunStarted(description);
}
@Override
public void testRunFinished(Result result) {
l.testRunFinished(result);
}
@Override
public void testAssumptionFailure(Failure failure) {
l.testAssumptionFailure(failure);
}
@Override
public void testIgnored(Description description) {
l.testIgnored(description);
}
@Override
public void testClassStarted(Class<?> clazz) {
l.testClassStarted(clazz);
}
@Override
public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) {
l.testClassFinished(clazz, numPassed, numFailed);
}
@Override
public void testStarted(Description description) {
l.testStarted(description);
}
@Override
public void testFinished(Description description) {
l.testFinished(description);
}
@Override
public void testFailed(Failure failure) {
l.testFailed(failure);
}
@Override
public void testSucceeded(Description description) {
l.testSucceeded(description);
}
@Override
public PrintStream getWriter() {
return l.getWriter();
}
public void testClassFinishedDelimiter() {
l.testClassFinishedDelimiter();
}
public void testClassStartedDelimiter() {
l.testClassStartedDelimiter();
}
public void testStartedDelimiter() {
l.testStartedDelimiter();
}
public void testFinishedDelimiter() {
l.testFinishedDelimiter();
}
public boolean beVerbose() {
return l.beVerbose();
}
}

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2014, 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 com.oracle.mxtool.junit;
import java.io.PrintStream;
import org.junit.runner.Result;
class TestResultLoggerDecorator extends MxRunListenerDecorator {
private final PrintStream passed;
private final PrintStream failed;
TestResultLoggerDecorator(PrintStream passed, PrintStream failed, MxRunListener l) {
super(l);
this.passed = passed;
this.failed = failed;
}
@Override
public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) {
super.testClassFinished(clazz, numPassed, numFailed);
if (numFailed != 0) {
failed.println(clazz.getName());
} else {
passed.println(clazz.getName());
}
}
@Override
public void testRunFinished(Result result) {
super.testRunFinished(result);
passed.close();
failed.close();
}
}

View File

@ -0,0 +1,148 @@
/*
* Copyright (c) 2014, 2014, 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 com.oracle.mxtool.junit;
import java.io.PrintStream;
import org.junit.internal.JUnitSystem;
import org.junit.internal.TextListener;
import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
class TextRunListener implements MxRunListener {
private final PrintStream fWriter;
protected Failure lastFailure;
TextRunListener(JUnitSystem system) {
this(system.out());
}
TextRunListener(PrintStream writer) {
fWriter = writer;
}
public boolean beVerbose() {
return false;
}
@Override
public PrintStream getWriter() {
return fWriter;
}
public Failure getLastFailure() {
return lastFailure;
}
@Override
public void testStarted(Description description) {
getWriter().print('.');
}
@Override
public void testFailed(Failure failure) {
getWriter().print('E');
lastFailure = failure;
}
@Override
public void testIgnored(Description description) {
getWriter().print('I');
}
public static RunListener createRunListener(MxRunListener l) {
return new TextListener(l.getWriter()) {
private Class<?> lastClass;
private int passedInLastClass;
private int failedInLastClass;
private boolean failed;
@Override
public void testStarted(Description description) {
Class<?> currentClass = description.getTestClass();
if (currentClass != lastClass) {
if (lastClass != null) {
l.testClassFinished(lastClass, passedInLastClass, failedInLastClass);
l.testClassFinishedDelimiter();
}
lastClass = currentClass;
passedInLastClass = 0;
failedInLastClass = 0;
l.testClassStarted(currentClass);
l.testClassStartedDelimiter();
}
failed = false;
l.testStarted(description);
l.testStartedDelimiter();
}
@Override
public void testFailure(Failure failure) {
failed = true;
failedInLastClass++;
l.testFailed(failure);
}
@Override
public void testFinished(Description description) {
// we have to do this because there is no callback for successful tests
if (!failed) {
l.testSucceeded(description);
passedInLastClass++;
}
l.testFinished(description);
l.testFinishedDelimiter();
}
@Override
public void testIgnored(Description description) {
testStarted(description);
l.testIgnored(description);
l.testFinished(description);
l.testFinishedDelimiter();
}
@Override
public void testRunStarted(Description description) {
l.testRunStarted(description);
}
@Override
public void testRunFinished(Result result) {
if (lastClass != null) {
l.testClassFinished(lastClass, passedInLastClass, failedInLastClass);
}
l.testRunFinished(result);
super.testRunFinished(result);
}
@Override
public void testAssumptionFailure(Failure failure) {
l.testAssumptionFailure(failure);
}
};
}
}

Some files were not shown because too many files have changed in this diff Show More