From 11852cb5fad399851cfbb9cbae93e92895f20ae8 Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Thu, 14 Jul 2016 09:52:03 +0200 Subject: [PATCH 01/99] 8061219: Implement unit-tests for UL Reviewed-by: coleenp, mockner, rprotacio --- .../src/share/vm/logging/logDecorations.hpp | 4 - .../src/share/vm/logging/logOutputList.hpp | 10 +- .../test/native/logging/logTestFixture.cpp | 66 ++++ .../test/native/logging/logTestFixture.hpp | 50 +++ .../native/logging/logTestUtils.inline.hpp | 45 +++ .../native/logging/test_logConfiguration.cpp | 291 ++++++++++++++++++ .../native/logging/test_logDecorations.cpp | 186 +++++++++++ .../native/logging/test_logDecorators.cpp | 216 +++++++++++++ .../native/logging/test_logFileOutput.cpp | 103 +++++++ hotspot/test/native/logging/test_logLevel.cpp | 54 ++++ .../native/logging/test_logOutputList.cpp | 255 +++++++++++++++ hotspot/test/native/logging/test_logTag.cpp | 53 ++++ .../logging/test_logTagLevelExpression.cpp | 183 +++++++++++ .../test/native/logging/test_logTagSet.cpp | 130 ++++++++ 14 files changed, 1637 insertions(+), 9 deletions(-) create mode 100644 hotspot/test/native/logging/logTestFixture.cpp create mode 100644 hotspot/test/native/logging/logTestFixture.hpp create mode 100644 hotspot/test/native/logging/logTestUtils.inline.hpp create mode 100644 hotspot/test/native/logging/test_logConfiguration.cpp create mode 100644 hotspot/test/native/logging/test_logDecorations.cpp create mode 100644 hotspot/test/native/logging/test_logDecorators.cpp create mode 100644 hotspot/test/native/logging/test_logFileOutput.cpp create mode 100644 hotspot/test/native/logging/test_logLevel.cpp create mode 100644 hotspot/test/native/logging/test_logOutputList.cpp create mode 100644 hotspot/test/native/logging/test_logTag.cpp create mode 100644 hotspot/test/native/logging/test_logTagLevelExpression.cpp create mode 100644 hotspot/test/native/logging/test_logTagSet.cpp diff --git a/hotspot/src/share/vm/logging/logDecorations.hpp b/hotspot/src/share/vm/logging/logDecorations.hpp index 3988bac83b3..38dcb40e99c 100644 --- a/hotspot/src/share/vm/logging/logDecorations.hpp +++ b/hotspot/src/share/vm/logging/logDecorations.hpp @@ -53,10 +53,6 @@ class LogDecorations VALUE_OBJ_CLASS_SPEC { LogDecorations(LogLevelType level, const LogTagSet& tagset, const LogDecorators& decorators); - LogLevelType level() const { - return _level; - } - void set_level(LogLevelType level) { _level = level; } diff --git a/hotspot/src/share/vm/logging/logOutputList.hpp b/hotspot/src/share/vm/logging/logOutputList.hpp index 37b122bee5f..851f4192bb3 100644 --- a/hotspot/src/share/vm/logging/logOutputList.hpp +++ b/hotspot/src/share/vm/logging/logOutputList.hpp @@ -60,6 +60,11 @@ class LogOutputList VALUE_OBJ_CLASS_SPEC { void add_output(LogOutput* output, LogLevelType level); void update_output_level(LogOutputNode* node, LogLevelType level); + // Bookkeeping functions to keep track of number of active readers/iterators for the list. + jint increase_readers(); + jint decrease_readers(); + void wait_until_no_readers() const; + public: LogOutputList() : _active_readers(0) { for (size_t i = 0; i < LogLevel::Count; i++) { @@ -83,11 +88,6 @@ class LogOutputList VALUE_OBJ_CLASS_SPEC { // Set (add/update/remove) the output to the specified level. void set_output_level(LogOutput* output, LogLevelType level); - // Bookkeeping functions to keep track of number of active readers/iterators for the list. - jint increase_readers(); - jint decrease_readers(); - void wait_until_no_readers() const; - class Iterator VALUE_OBJ_CLASS_SPEC { friend class LogOutputList; private: diff --git a/hotspot/test/native/logging/logTestFixture.cpp b/hotspot/test/native/logging/logTestFixture.cpp new file mode 100644 index 00000000000..d22a6f74d92 --- /dev/null +++ b/hotspot/test/native/logging/logTestFixture.cpp @@ -0,0 +1,66 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logTestFixture.hpp" +#include "logTestUtils.inline.hpp" +#include "logging/logConfiguration.hpp" +#include "memory/resourceArea.hpp" +#include "unittest.hpp" +#include "utilities/ostream.hpp" + +LogTestFixture::LogTestFixture() { + // Set up TestLogFileName to include PID, testcase name and test name + int ret = jio_snprintf(_filename, sizeof(_filename), "testlog.pid%d.%s.%s.log", + os::current_process_id(), + ::testing::UnitTest::GetInstance()->current_test_info()->test_case_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); + EXPECT_GT(ret, 0) << "_filename buffer issue"; + TestLogFileName = _filename; +} + +LogTestFixture::~LogTestFixture() { + restore_default_log_config(); + delete_file(TestLogFileName); +} + +bool LogTestFixture::set_log_config(const char* output, + const char* what, + const char* decorators, + const char* options, + bool allow_failure) { + ResourceMark rm; + stringStream stream; + bool success = LogConfiguration::parse_log_arguments(output, what, decorators, options, &stream); + if (!allow_failure) { + const char* errmsg = stream.as_string(); + EXPECT_STREQ("", errmsg) << "Unexpected error reported"; + EXPECT_TRUE(success) << "Shouldn't cause errors"; + } + return success; +} + +void LogTestFixture::restore_default_log_config() { + LogConfiguration::disable_logging(); + set_log_config("stdout", "all=warning"); +} diff --git a/hotspot/test/native/logging/logTestFixture.hpp b/hotspot/test/native/logging/logTestFixture.hpp new file mode 100644 index 00000000000..d9c1c8b02df --- /dev/null +++ b/hotspot/test/native/logging/logTestFixture.hpp @@ -0,0 +1,50 @@ +/* + * 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. + * + */ +#include "unittest.hpp" +#include "utilities/globalDefinitions.hpp" + +// A fixture base class for tests that need to change the log configuration, +// or use a log file. After each test, the fixture will automatically restore +// the log configuration and remove the test file (if used). +// Provides TestLogFileName which is unique for each test, and is automatically +// deleted after the test completes. +class LogTestFixture : public testing::Test { + private: + char _filename[2 * K]; + + protected: + const char* TestLogFileName; + + LogTestFixture(); + ~LogTestFixture(); + + static bool set_log_config(const char* output, + const char* what, + const char* decorators = "", + const char* options = "", + bool allow_failure = false); + + static void restore_default_log_config(); +}; + diff --git a/hotspot/test/native/logging/logTestUtils.inline.hpp b/hotspot/test/native/logging/logTestUtils.inline.hpp new file mode 100644 index 00000000000..bf39dfdbd9e --- /dev/null +++ b/hotspot/test/native/logging/logTestUtils.inline.hpp @@ -0,0 +1,45 @@ +/* + * 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. + * + */ +#include "runtime/os.hpp" +#include "unittest.hpp" + +#define LOG_TEST_STRING_LITERAL "a (hopefully) unique log message for testing" + +static inline bool string_contains_substring(const char* haystack, const char* needle) { + return strstr(haystack, needle) != NULL; +} + +static inline bool file_exists(const char* filename) { + struct stat st; + return os::stat(filename, &st) == 0; +} + +static inline void delete_file(const char* filename) { + if (!file_exists(filename)) { + return; + } + int ret = remove(filename); + EXPECT_TRUE(ret == 0 || errno == ENOENT) << "failed to remove file '" << filename << "': " + << os::strerror(errno) << " (" << errno << ")"; +} diff --git a/hotspot/test/native/logging/test_logConfiguration.cpp b/hotspot/test/native/logging/test_logConfiguration.cpp new file mode 100644 index 00000000000..528111ef31b --- /dev/null +++ b/hotspot/test/native/logging/test_logConfiguration.cpp @@ -0,0 +1,291 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logTestFixture.hpp" +#include "logTestUtils.inline.hpp" +#include "logging/logConfiguration.hpp" +#include "logging/logLevel.hpp" +#include "logging/logOutput.hpp" +#include "logging/logTag.hpp" +#include "logging/logTagSet.hpp" +#include "memory/resourceArea.hpp" +#include "unittest.hpp" +#include "utilities/ostream.hpp" + +class LogConfigurationTest : public LogTestFixture { + protected: + static char _all_decorators[256]; + + public: + static void SetUpTestCase(); +}; + +char LogConfigurationTest::_all_decorators[256]; + +// Prepare _all_decorators to contain the full list of decorators (comma separated) +void LogConfigurationTest::SetUpTestCase() { + char *pos = _all_decorators; + for (size_t i = 0; i < LogDecorators::Count; i++) { + pos += jio_snprintf(pos, sizeof(_all_decorators) - (pos - _all_decorators), "%s%s", + (i == 0 ? "" : ","), + LogDecorators::name(static_cast(i))); + } +} + +// Check if the given text is included by LogConfiguration::describe() +static bool is_described(const char* text) { + ResourceMark rm; + stringStream ss; + LogConfiguration::describe(&ss); + return string_contains_substring(ss.as_string(), text); +} + +TEST_F(LogConfigurationTest, describe) { + ResourceMark rm; + stringStream ss; + LogConfiguration::describe(&ss); + const char* description = ss.as_string(); + + // Verify that stdout and stderr are listed by default + EXPECT_PRED2(string_contains_substring, description, LogOutput::Stdout->name()); + EXPECT_PRED2(string_contains_substring, description, LogOutput::Stderr->name()); + + // Verify that each tag, level and decorator is listed + for (size_t i = 0; i < LogTag::Count; i++) { + EXPECT_PRED2(string_contains_substring, description, LogTag::name(static_cast(i))); + } + for (size_t i = 0; i < LogLevel::Count; i++) { + EXPECT_PRED2(string_contains_substring, description, LogLevel::name(static_cast(i))); + } + for (size_t i = 0; i < LogDecorators::Count; i++) { + EXPECT_PRED2(string_contains_substring, description, LogDecorators::name(static_cast(i))); + } + + // Verify that the default configuration is printed + char expected_buf[256]; + int ret = jio_snprintf(expected_buf, sizeof(expected_buf), "=%s", LogLevel::name(LogLevel::Default)); + ASSERT_NE(-1, ret); + EXPECT_PRED2(string_contains_substring, description, expected_buf); + EXPECT_PRED2(string_contains_substring, description, "#1: stderr all=off"); + + // Verify default decorators are listed + LogDecorators default_decorators; + expected_buf[0] = '\0'; + for (size_t i = 0; i < LogDecorators::Count; i++) { + LogDecorators::Decorator d = static_cast(i); + if (default_decorators.is_decorator(d)) { + ASSERT_LT(strlen(expected_buf), sizeof(expected_buf)); + ret = jio_snprintf(expected_buf + strlen(expected_buf), + sizeof(expected_buf) - strlen(expected_buf), + "%s%s", + strlen(expected_buf) > 0 ? "," : "", + LogDecorators::name(d)); + ASSERT_NE(-1, ret); + } + } + EXPECT_PRED2(string_contains_substring, description, expected_buf); + + // Add a new output and verify that it gets described after it has been added + const char* what = "all=trace"; + EXPECT_FALSE(is_described(TestLogFileName)) << "Test output already exists!"; + set_log_config(TestLogFileName, what); + EXPECT_TRUE(is_described(TestLogFileName)); + EXPECT_TRUE(is_described("logging=trace")); +} + +// Test updating an existing log output +TEST_F(LogConfigurationTest, update_output) { + // Update stdout twice, first using it's name, and the second time its index # + const char* test_outputs[] = { "stdout", "#0" }; + for (size_t i = 0; i < ARRAY_SIZE(test_outputs); i++) { + set_log_config(test_outputs[i], "all=info"); + + // Verify configuration using LogConfiguration::describe + EXPECT_TRUE(is_described("#0: stdout")); + EXPECT_TRUE(is_described("logging=info")); + + // Verify by iterating over tagsets + LogOutput* o = LogOutput::Stdout; + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_TRUE(ts->has_output(o)); + EXPECT_TRUE(ts->is_level(LogLevel::Info)); + EXPECT_FALSE(ts->is_level(LogLevel::Debug)); + } + + // Now change the level and verify the change propagated + set_log_config(test_outputs[i], "all=debug"); + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_TRUE(ts->has_output(o)); + EXPECT_TRUE(ts->is_level(LogLevel::Debug)); + EXPECT_FALSE(ts->is_level(LogLevel::Trace)); + } + } +} + +// Test adding a new output to the configuration +TEST_F(LogConfigurationTest, add_new_output) { + const char* what = "all=trace"; + + ASSERT_FALSE(is_described(TestLogFileName)); + set_log_config(TestLogFileName, what); + + // Verify new output using LogConfiguration::describe + EXPECT_TRUE(is_described(TestLogFileName)); + EXPECT_TRUE(is_described("logging=trace")); + + // Also verify by iterating over tagsets, checking levels on tagsets + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_TRUE(ts->is_level(LogLevel::Trace)); + } +} + +TEST_F(LogConfigurationTest, disable_logging) { + // Add TestLogFileName as an output + set_log_config(TestLogFileName, "logging=info"); + + LogConfiguration::disable_logging(); + + // Verify TestLogFileName was disabled + EXPECT_FALSE(is_described(TestLogFileName)); + + // Verify that no tagset has logging enabled + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_FALSE(ts->has_output(LogOutput::Stdout)); + EXPECT_FALSE(ts->has_output(LogOutput::Stderr)); + EXPECT_FALSE(ts->is_level(LogLevel::Error)); + } +} + +// Test disabling a particular output +TEST_F(LogConfigurationTest, disable_output) { + // Disable the default configuration for stdout + set_log_config("stdout", "all=off"); + + // Verify configuration using LogConfiguration::describe + EXPECT_TRUE(is_described("#0: stdout all=off")); + + // Verify by iterating over tagsets + LogOutput* o = LogOutput::Stdout; + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_FALSE(ts->has_output(o)); + EXPECT_FALSE(ts->is_level(LogLevel::Error)); + } + + // Add a new file output + const char* what = "all=debug"; + set_log_config(TestLogFileName, what); + EXPECT_TRUE(is_described(TestLogFileName)); + + // Now disable it, verifying it is removed completely + set_log_config(TestLogFileName, "all=off"); + EXPECT_FALSE(is_described(TestLogFileName)); + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_FALSE(ts->is_level(LogLevel::Error)); + } +} + +// Test reconfiguration of the selected decorators for an output +TEST_F(LogConfigurationTest, reconfigure_decorators) { + // Configure stderr with all decorators + set_log_config("stderr", "all=off", _all_decorators); + char buf[256]; + int ret = jio_snprintf(buf, sizeof(buf), "#1: stderr all=off %s", _all_decorators); + ASSERT_NE(-1, ret); + EXPECT_TRUE(is_described(buf)) << "'" << buf << "' not described after reconfiguration"; + + // Now reconfigure logging on stderr with no decorators + set_log_config("stderr", "all=off", "none"); + EXPECT_TRUE(is_described("#1: stderr all=off \n")) << "Expecting no decorators"; +} + +// Test that invalid options cause configuration errors +TEST_F(LogConfigurationTest, invalid_configure_options) { + LogConfiguration::disable_logging(); + const char* invalid_outputs[] = { "#2", "invalidtype=123", ":invalid/path}to*file?" }; + for (size_t i = 0; i < ARRAY_SIZE(invalid_outputs); i++) { + EXPECT_FALSE(set_log_config(invalid_outputs[i], "", "", "", true)) + << "Accepted invalid output '" << invalid_outputs[i] << "'"; + } + EXPECT_FALSE(LogConfiguration::parse_command_line_arguments("all=invalid_level")); + EXPECT_FALSE(LogConfiguration::parse_command_line_arguments("what=invalid")); + EXPECT_FALSE(LogConfiguration::parse_command_line_arguments("all::invalid_decorator")); +} + +// Test empty configuration options +TEST_F(LogConfigurationTest, parse_empty_command_line_arguments) { + const char* empty_variations[] = { "", ":", "::", ":::", "::::" }; + for (size_t i = 0; i < ARRAY_SIZE(empty_variations); i++) { + const char* cmdline = empty_variations[i]; + bool ret = LogConfiguration::parse_command_line_arguments(cmdline); + EXPECT_TRUE(ret) << "Error parsing command line arguments '" << cmdline << "'"; + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_EQ(LogLevel::Unspecified, ts->level_for(LogOutput::Stdout)); + } + } +} + +// Test basic command line parsing & configuration +TEST_F(LogConfigurationTest, parse_command_line_arguments) { + // Prepare a command line for logging*=debug on stderr with all decorators + int ret; + char buf[256]; + ret = jio_snprintf(buf, sizeof(buf), "logging*=debug:stderr:%s", _all_decorators); + ASSERT_NE(-1, ret); + + bool success = LogConfiguration::parse_command_line_arguments(buf); + EXPECT_TRUE(success) << "Error parsing valid command line arguments '" << buf << "'"; + // Ensure the new configuration applied + EXPECT_TRUE(is_described("logging=debug")); + EXPECT_TRUE(is_described(_all_decorators)); + + // Test the configuration of file outputs as well + ret = jio_snprintf(buf, sizeof(buf), ":%s", TestLogFileName); + ASSERT_NE(-1, ret); + EXPECT_TRUE(LogConfiguration::parse_command_line_arguments(buf)); +} + +// Test split up log configuration arguments +TEST_F(LogConfigurationTest, parse_log_arguments) { + ResourceMark rm; + stringStream ss; + // Verify that it's possible to configure each individual tag + for (size_t t = 1 /* Skip _NO_TAG */; t < LogTag::Count; t++) { + const LogTagType tag = static_cast(t); + EXPECT_TRUE(LogConfiguration::parse_log_arguments("stdout", LogTag::name(tag), "", "", &ss)); + } + // Same for each level + for (size_t l = 0; l < LogLevel::Count; l++) { + const LogLevelType level = static_cast(l); + char expected_buf[256]; + int ret = jio_snprintf(expected_buf, sizeof(expected_buf), "all=%s", LogLevel::name(level)); + ASSERT_NE(-1, ret); + EXPECT_TRUE(LogConfiguration::parse_log_arguments("stderr", expected_buf, "", "", &ss)); + } + // And for each decorator + for (size_t d = 0; d < LogDecorators::Count; d++) { + const LogDecorators::Decorator decorator = static_cast(d); + EXPECT_TRUE(LogConfiguration::parse_log_arguments("#0", "", LogDecorators::name(decorator), "", &ss)); + } + EXPECT_STREQ("", ss.as_string()) << "Error reported while parsing: " << ss.as_string(); +} diff --git a/hotspot/test/native/logging/test_logDecorations.cpp b/hotspot/test/native/logging/test_logDecorations.cpp new file mode 100644 index 00000000000..324792b24b8 --- /dev/null +++ b/hotspot/test/native/logging/test_logDecorations.cpp @@ -0,0 +1,186 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logDecorations.hpp" +#include "logging/logTagSet.hpp" +#include "runtime/os.hpp" +#include "unittest.hpp" +#include "utilities/globalDefinitions.hpp" + +static const LogTagSet& tagset = LogTagSetMapping::tagset(); +static const LogDecorators default_decorators; + +TEST(LogDecorations, level) { + for (uint l = LogLevel::First; l <= LogLevel::Last; l++) { + LogLevelType level = static_cast(l); + // Create a decorations object for the current level + LogDecorations decorations(level, tagset, default_decorators); + // Verify that the level decoration matches the specified level + EXPECT_STREQ(LogLevel::name(level), decorations.decoration(LogDecorators::level_decorator)); + + // Test changing level after object creation time + LogLevelType other_level; + if (l != LogLevel::Last) { + other_level = static_cast(l + 1); + } else { + other_level = static_cast(LogLevel::First); + } + decorations.set_level(other_level); + EXPECT_STREQ(LogLevel::name(other_level), decorations.decoration(LogDecorators::level_decorator)) + << "Decoration reports incorrect value after changing the level"; + } +} + +TEST(LogDecorations, uptime) { + // Verify the format of the decoration + int a, b; + char decimal_point; + LogDecorations decorations(LogLevel::Info, tagset, default_decorators); + const char* uptime = decorations.decoration(LogDecorators::uptime_decorator); + int read = sscanf(uptime, "%d%c%ds", &a, &decimal_point, &b); + EXPECT_EQ(3, read) << "Invalid uptime decoration: " << uptime; + EXPECT_TRUE(decimal_point == '.' || decimal_point == ',') << "Invalid uptime decoration: " << uptime; + + // Verify that uptime increases + double prev = 0; + for (int i = 0; i < 3; i++) { + os::naked_short_sleep(10); + LogDecorations d(LogLevel::Info, tagset, default_decorators); + double cur = strtod(d.decoration(LogDecorators::uptime_decorator), NULL); + ASSERT_LT(prev, cur); + prev = cur; + } +} + +TEST(LogDecorations, tags) { + char expected_tags[1 * K]; + tagset.label(expected_tags, sizeof(expected_tags)); + // Verify that the expected tags are included in the tags decoration + LogDecorations decorations(LogLevel::Info, tagset, default_decorators); + EXPECT_STREQ(expected_tags, decorations.decoration(LogDecorators::tags_decorator)); +} + +// Test each variation of the different timestamp decorations (ms, ns, uptime ms, uptime ns) +TEST(LogDecorations, timestamps) { + struct { + const LogDecorators::Decorator decorator; + const char* suffix; + } test_decorator[] = { + { LogDecorators::timemillis_decorator, "ms" }, + { LogDecorators::uptimemillis_decorator, "ms" }, + { LogDecorators::timenanos_decorator, "ns" }, + { LogDecorators::uptimenanos_decorator, "ns" } + }; + + for (uint i = 0; i < ARRAY_SIZE(test_decorator); i++) { + LogDecorators::Decorator decorator = test_decorator[i].decorator; + LogDecorators decorator_selection; + ASSERT_TRUE(decorator_selection.parse(LogDecorators::name(decorator))); + + // Create decorations with the decorator we want to test included + LogDecorations decorations(LogLevel::Info, tagset, decorator_selection); + const char* decoration = decorations.decoration(decorator); + + // Verify format of timestamp + const char* suffix; + for (suffix = decoration; isdigit(*suffix); suffix++) { + // Skip over digits + } + EXPECT_STREQ(test_decorator[i].suffix, suffix); + + // Verify timestamp values + julong prev = 0; + for (int i = 0; i < 3; i++) { + os::naked_short_sleep(5); + LogDecorations d(LogLevel::Info, tagset, decorator_selection); + julong val = strtoull(d.decoration(decorator), NULL, 10); + ASSERT_LT(prev, val); + prev = val; + } + } +} + +// Test the time decoration +TEST(LogDecorations, iso8601_time) { + LogDecorators decorator_selection; + ASSERT_TRUE(decorator_selection.parse("time")); + LogDecorations decorations(LogLevel::Info, tagset, decorator_selection); + + const char *timestr = decorations.decoration(LogDecorators::time_decorator); + time_t expected_ts = time(NULL); + + // Verify format + int y, M, d, h, m; + double s; + int read = sscanf(timestr, "%d-%d-%dT%d:%d:%lfZ", &y, &M, &d, &h, &m, &s); + ASSERT_EQ(6, read); + + // Verify reported time & date + struct tm reported_time = {0}; + reported_time.tm_year = y - 1900; + reported_time.tm_mon = M - 1; + reported_time.tm_mday = d; + reported_time.tm_hour = h; + reported_time.tm_min = m; + reported_time.tm_sec = s; + reported_time.tm_isdst = daylight; + time_t reported_ts = mktime(&reported_time); + expected_ts = mktime(localtime(&expected_ts)); + time_t diff = reported_ts - expected_ts; + if (diff < 0) { + diff = -diff; + } + // Allow up to 10 seconds in difference + ASSERT_LE(diff, 10) << "Reported time: " << reported_ts << " (" << timestr << ")" + << ", expected time: " << expected_ts; +} + +// Test the pid and tid decorations +TEST(LogDecorations, identifiers) { + LogDecorators decorator_selection; + ASSERT_TRUE(decorator_selection.parse("pid,tid")); + LogDecorations decorations(LogLevel::Info, tagset, decorator_selection); + + struct { + intx expected; + LogDecorators::Decorator decorator; + } ids[] = { + { os::current_process_id(), LogDecorators::pid_decorator }, + { os::current_thread_id(), LogDecorators::tid_decorator }, + }; + + for (uint i = 0; i < ARRAY_SIZE(ids); i++) { + const char* reported = decorations.decoration(ids[i].decorator); + + // Verify format + const char* str; + for (str = reported; isdigit(*str); str++) { + // Skip over digits + } + EXPECT_EQ('\0', *str) << "Should only contain digits"; + + // Verify value + EXPECT_EQ(ids[i].expected, strtol(reported, NULL, 10)); + } +} diff --git a/hotspot/test/native/logging/test_logDecorators.cpp b/hotspot/test/native/logging/test_logDecorators.cpp new file mode 100644 index 00000000000..beaa925e320 --- /dev/null +++ b/hotspot/test/native/logging/test_logDecorators.cpp @@ -0,0 +1,216 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logDecorators.hpp" +#include "unittest.hpp" + +static LogDecorators::Decorator decorator_array[] = { +#define DECORATOR(name, abbr) LogDecorators::name##_decorator, + DECORATOR_LIST +#undef DECORATOR +}; + +static const char* decorator_name_array[] = { +#define DECORATOR(name, abbr) #name, + DECORATOR_LIST +#undef DECORATOR +}; + +static const char* decorator_abbr_array[] = { +#define DECORATOR(name, abbr) #abbr, + DECORATOR_LIST +#undef DECORATOR +}; + +// Assert that the given decorators object has the default decorators (uptime, level, tags) +// If exclusive = true, also assert that no other decorators are selected +static void assert_default_decorators(LogDecorators* decorators, bool exclusive = true) { + for (int i = 0; i < LogDecorators::Count; i++) { + LogDecorators::Decorator decorator = decorator_array[i]; + if (decorator == LogDecorators::uptime_decorator || + decorator == LogDecorators::level_decorator || + decorator == LogDecorators::tags_decorator) { + EXPECT_TRUE(decorators->is_decorator(decorator)); + } else if (exclusive) { + EXPECT_FALSE(decorators->is_decorator(decorator)); + } + } +} + +TEST(LogDecorators, defaults) { + LogDecorators decorators; + assert_default_decorators(&decorators); +} + +// Test converting between name and decorator (string and enum) +TEST(LogDecorators, from_and_to_name) { + EXPECT_EQ(LogDecorators::Invalid, LogDecorators::from_string("unknown")); + EXPECT_EQ(LogDecorators::Invalid, LogDecorators::from_string("")); + + for (int i = 0; i < LogDecorators::Count; i++) { + LogDecorators::Decorator decorator = decorator_array[i]; + + const char* name = LogDecorators::name(decorator); + EXPECT_STREQ(decorator_name_array[i], name); + + LogDecorators::Decorator decorator2 = LogDecorators::from_string(name); + EXPECT_EQ(decorator, decorator2); + + // Test case insensitivity + char* name_cpy = strdup(name); + name_cpy[0] = toupper(name_cpy[0]); + decorator2 = LogDecorators::from_string(name_cpy); + free(name_cpy); + EXPECT_EQ(decorator, decorator2); + } +} + +// Test decorator abbreviations +TEST(LogDecorators, from_and_to_abbr) { + for (int i = 0; i < LogDecorators::Count; i++) { + LogDecorators::Decorator decorator = decorator_array[i]; + + const char* abbr = LogDecorators::abbreviation(decorator); + EXPECT_STREQ(decorator_abbr_array[i], abbr); + + LogDecorators::Decorator decorator2 = LogDecorators::from_string(abbr); + ASSERT_EQ(decorator, decorator2); + + // Test case insensitivity + char* abbr_cpy = strdup(abbr); + abbr_cpy[0] = toupper(abbr_cpy[0]); + decorator2 = LogDecorators::from_string(abbr_cpy); + free(abbr_cpy); + EXPECT_EQ(decorator, decorator2); + } +} + +TEST(LogDecorators, parse_default) { + LogDecorators decorators; + decorators.parse(""); // Empty string means we should use the default decorators + assert_default_decorators(&decorators); +} + +// Test that "none" gives no decorators at all +TEST(LogDecorators, parse_none) { + LogDecorators decorators; + decorators.parse("none"); + for (int i = 0; i < LogDecorators::Count; i++) { + EXPECT_FALSE(decorators.is_decorator(decorator_array[i])); + } +} + +// Test a few invalid decorator selections +TEST(LogDecorators, parse_invalid) { + LogDecorators decorators; + EXPECT_FALSE(decorators.parse("invalid")); + EXPECT_FALSE(decorators.parse(",invalid")); + EXPECT_FALSE(decorators.parse(",invalid,")); + assert_default_decorators(&decorators); +} + +// Assert that the given decorator has all decorators between first and last +static void assert_decorations_between(const LogDecorators* decorator, size_t first, size_t last) { + for (size_t i = 0; i < ARRAY_SIZE(decorator_array); i++) { + if (i >= first && i <= last) { + EXPECT_TRUE(decorator->is_decorator(decorator_array[i])); + } else { + EXPECT_FALSE(decorator->is_decorator(decorator_array[i])); + } + } +} + +TEST(LogDecorators, parse) { + LogDecorators decorators; + + // Verify a bunch of different decorator selections + char decstr[1 * K]; + decstr[0] = '\0'; + size_t written = 0; + for (size_t i = 0; i < ARRAY_SIZE(decorator_array); i++) { + for (size_t j = i; j < ARRAY_SIZE(decorator_array); j++) { + for (size_t k = i; k <= j; k++) { + ASSERT_LT(written, sizeof(decstr)) << "decstr overflow"; + int ret = jio_snprintf(decstr + written, sizeof(decstr) - written, "%s%s", + written == 0 ? "" : ",", + ((k + j) % 2 == 0) ? decorator_name_array[k] : decorator_abbr_array[k]); + ASSERT_NE(-1, ret); + written += ret; + } + EXPECT_TRUE(decorators.parse(decstr)) << "Valid decorator selection did not parse: " << decstr; + assert_decorations_between(&decorators, i, j); + written = 0; + decstr[0] = '\0'; + } + } +} + +TEST(LogDecorators, combine_with) { + LogDecorators dec1; + LogDecorators dec2; + + // Select first and third decorator for dec1 + char input[64]; + sprintf(input, "%s,%s", decorator_name_array[0], decorator_name_array[2]); + dec1.parse(input); + EXPECT_TRUE(dec1.is_decorator(decorator_array[0])); + EXPECT_TRUE(dec1.is_decorator(decorator_array[2])); + + // Select the default decorators for dec2 + EXPECT_FALSE(dec2.is_decorator(decorator_array[0])); + EXPECT_FALSE(dec2.is_decorator(decorator_array[2])); + assert_default_decorators(&dec2); + + // Combine and verify that the combination includes first, third and default decorators + dec2.combine_with(dec1); + EXPECT_TRUE(dec2.is_decorator(decorator_array[0])); + EXPECT_TRUE(dec2.is_decorator(decorator_array[2])); + assert_default_decorators(&dec2, false); +} + +TEST(LogDecorators, clear) { + // Start with default decorators and then clear it + LogDecorators dec; + EXPECT_FALSE(dec.is_empty()); + + dec.clear(); + EXPECT_TRUE(dec.is_empty()); + for (size_t i = 0; i < LogDecorators::Count; i++) { + EXPECT_FALSE(dec.is_decorator(decorator_array[i])); + } +} + +// Test the decorator constant None +TEST(LogDecorators, none) { + LogDecorators dec = LogDecorators::None; + for (size_t i = 0; i < LogDecorators::Count; i++) { + EXPECT_FALSE(dec.is_decorator(decorator_array[i])); + } +} + +TEST(LogDecorators, is_empty) { + LogDecorators def, none = LogDecorators::None; + EXPECT_FALSE(def.is_empty()); + EXPECT_TRUE(none.is_empty()); +} diff --git a/hotspot/test/native/logging/test_logFileOutput.cpp b/hotspot/test/native/logging/test_logFileOutput.cpp new file mode 100644 index 00000000000..da13e539412 --- /dev/null +++ b/hotspot/test/native/logging/test_logFileOutput.cpp @@ -0,0 +1,103 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logFileOutput.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/os.hpp" +#include "unittest.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/ostream.hpp" + +static const char* name = "testlog.pid%p.%t.log"; + +// Test parsing a bunch of valid file output options +TEST(LogFileOutput, parse_valid) { + const char* valid_options[] = { + "", "filecount=10", "filesize=512", + "filecount=11,filesize=256", + "filesize=256,filecount=11", + "filesize=0", "filecount=1", + "filesize=1m", "filesize=1M", + "filesize=1k", "filesize=1G" + }; + + // Override LogOutput's vm_start time to get predictable file name + LogFileOutput::set_file_name_parameters(0); + char expected_filename[1 * K]; + int ret = jio_snprintf(expected_filename, sizeof(expected_filename), + "testlog.pid%d.1970-01-01_01-00-00.log", + os::current_process_id()); + ASSERT_GT(ret, 0) << "Buffer too small"; + + for (size_t i = 0; i < ARRAY_SIZE(valid_options); i++) { + ResourceMark rm; + stringStream ss; + { + LogFileOutput fo(name); + EXPECT_STREQ(name, fo.name()); + EXPECT_TRUE(fo.initialize(valid_options[i], &ss)) + << "Did not accept valid option(s) '" << valid_options[i] << "': " << ss.as_string(); + } + remove(expected_filename); + } +} + +// Test parsing a bunch of invalid file output options +TEST(LogFileOutput, parse_invalid) { + const char* invalid_options[] = { + "invalidopt", "filecount=", + "filesize=,filecount=10", + "fileco=10", "ilesize=512", + "filecount=11,,filesize=256", + ",filesize=256,filecount=11", + "filesize=256,filecount=11,", + "filesize=-1", "filecount=0.1", + "filecount=-2", "filecount=2.0", + "filecount= 2", "filesize=2 ", + "filecount=ab", "filesize=0xz", + "filecount=1MB", "filesize=99bytes", + "filesize=9999999999999999999999999" + "filecount=9999999999999999999999999" + }; + + for (size_t i = 0; i < ARRAY_SIZE(invalid_options); i++) { + ResourceMark rm; + stringStream ss; + LogFileOutput fo(name); + EXPECT_FALSE(fo.initialize(invalid_options[i], &ss)) + << "Accepted invalid option(s) '" << invalid_options[i] << "': " << ss.as_string(); + } +} + +// Test for overflows with filesize +TEST(LogFileOutput, filesize_overflow) { + char buf[256]; + int ret = jio_snprintf(buf, sizeof(buf), "filesize=" SIZE_FORMAT "K", SIZE_MAX); + ASSERT_GT(ret, 0) << "Buffer too small"; + + ResourceMark rm; + stringStream ss; + LogFileOutput fo(name); + EXPECT_FALSE(fo.initialize(buf, &ss)) << "Accepted filesize that overflows"; +} diff --git a/hotspot/test/native/logging/test_logLevel.cpp b/hotspot/test/native/logging/test_logLevel.cpp new file mode 100644 index 00000000000..00004bb334d --- /dev/null +++ b/hotspot/test/native/logging/test_logLevel.cpp @@ -0,0 +1,54 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logLevel.hpp" +#include "unittest.hpp" + +TEST(LogLevel, from_string) { + LogLevelType level; + + // Verify each name defined in the LOG_LEVEL_LIST +#define LOG_LEVEL(lname, lstring) \ + level = LogLevel::from_string(#lstring); \ + EXPECT_EQ(level, LogLevel::lname); + LOG_LEVEL_LIST +#undef LOG_LEVEL + + // Verify a few invalid level strings + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("bad level")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("debugger")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("inf")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("info ")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string(" info")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("=info")); + EXPECT_EQ(LogLevel::Invalid, LogLevel::from_string("infodebugwarning")); +} + +TEST(LogLevel, name) { + // Use names from macro as reference +#define LOG_LEVEL(lname, lstring) \ + EXPECT_STREQ(LogLevel::name(LogLevel::lname), #lstring); + LOG_LEVEL_LIST +#undef LOG_LEVEL +} diff --git a/hotspot/test/native/logging/test_logOutputList.cpp b/hotspot/test/native/logging/test_logOutputList.cpp new file mode 100644 index 00000000000..d5853526d89 --- /dev/null +++ b/hotspot/test/native/logging/test_logOutputList.cpp @@ -0,0 +1,255 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logLevel.hpp" +#include "logging/logOutput.hpp" +#include "logging/logOutputList.hpp" +#include "runtime/os.hpp" +#include "unittest.hpp" + +// Count the outputs in the given list, starting from the specified level +static size_t output_count(LogOutputList* list, LogLevelType from = LogLevel::Error) { + size_t count = 0; + for (LogOutputList::Iterator it = list->iterator(from); it != list->end(); it++) { + count++; + } + return count; +} + +// Get the level for an output in the given list +static LogLevelType find_output_level(LogOutputList* list, LogOutput* o) { + for (size_t levelnum = 1; levelnum < LogLevel::Count; levelnum++) { + LogLevelType level = static_cast(levelnum); + for (LogOutputList::Iterator it = list->iterator(level); it != list->end(); it++) { + if (*it == o) { + return level; + } + } + } + return LogLevel::Off; +} + +// Create a dummy output pointer with the specified id. +// This dummy pointer should not be used for anything +// but pointer comparisons with other dummies. +static LogOutput* dummy_output(size_t id) { + return reinterpret_cast(id + 1); +} + +// Randomly update and verify some outputs some number of times +TEST(LogOutputList, set_output_level_update) { + const size_t TestOutputCount = 10; + const size_t TestIterations = 10000; + LogOutputList list; + size_t outputs_on_level[LogLevel::Count]; + LogLevelType expected_level_for_output[TestOutputCount]; + + os::init_random(0x4711); + for (size_t i = 0; i < LogLevel::Count; i++) { + outputs_on_level[i] = 0; + } + outputs_on_level[LogLevel::Off] = TestOutputCount; + for (size_t i = 0; i < TestOutputCount; i++) { + expected_level_for_output[i] = LogLevel::Off; + } + + for (size_t iteration = 0; iteration < TestIterations; iteration++) { + size_t output_idx = os::random() % TestOutputCount; + size_t levelnum = os::random() % LogLevel::Count; + LogLevelType level = static_cast(levelnum); + + // Update the expectations + outputs_on_level[expected_level_for_output[output_idx]]--; + outputs_on_level[levelnum]++; + expected_level_for_output[output_idx] = level; + + // Update the actual list + list.set_output_level(dummy_output(output_idx), level); + + // Verify expected levels + for (size_t i = 0; i < TestOutputCount; i++) { + ASSERT_EQ(expected_level_for_output[i], find_output_level(&list, dummy_output(i))); + } + // Verify output counts + size_t expected_count = 0; + for (size_t i = 1; i < LogLevel::Count; i++) { + expected_count += outputs_on_level[i]; + ASSERT_EQ(expected_count, output_count(&list, static_cast(i))); + } + ASSERT_EQ(TestOutputCount, expected_count + outputs_on_level[LogLevel::Off]); + } +} + +// Test removing outputs from a LogOutputList +TEST(LogOutputList, set_output_level_remove) { + LogOutputList list; + + // Add three dummy outputs per loglevel + for (size_t i = 1; i < LogLevel::Count; i++) { + list.set_output_level(dummy_output(i), static_cast(i)); + list.set_output_level(dummy_output(i*10), static_cast(i)); + list.set_output_level(dummy_output(i*100), static_cast(i)); + } + + // Verify that they have been added successfully + // (Count - 1 since we don't count LogLevel::Off) + EXPECT_EQ(3u * (LogLevel::Count - 1), output_count(&list)); + // Now remove the second output from each loglevel + for (size_t i = 1; i < LogLevel::Count; i++) { + list.set_output_level(dummy_output(i*10), LogLevel::Off); + } + // Make sure they have been successfully removed + EXPECT_EQ(2u * (LogLevel::Count - 1), output_count(&list)); + + // Now remove the remaining outputs + for (size_t i = 1; i < LogLevel::Count; i++) { + list.set_output_level(dummy_output(i), LogLevel::Off); + list.set_output_level(dummy_output(i*100), LogLevel::Off); + } + EXPECT_EQ(0u, output_count(&list)); +} + +// Test adding to a LogOutputList +TEST(LogOutputList, set_output_level_add) { + LogOutputList list; + + // First add 5 outputs to Info level + for (size_t i = 10; i < 15; i++) { + list.set_output_level(dummy_output(i), LogLevel::Info); + } + + // Verify that they have been added successfully + size_t count = 0; + for (LogOutputList::Iterator it = list.iterator(); it != list.end(); it++) { + ASSERT_EQ(dummy_output(10 + count++), *it); + } + ASSERT_EQ(5u, count); + + // Now add more outputs, but on all different levels + for (size_t i = 5; i < 10; i++) { + list.set_output_level(dummy_output(i), LogLevel::Warning); + } + for (size_t i = 0; i < 5; i++) { + list.set_output_level(dummy_output(i), LogLevel::Error); + } + for (size_t i = 15; i < 20; i++) { + list.set_output_level(dummy_output(i), LogLevel::Debug); + } + for (size_t i = 20; i < 25; i++) { + list.set_output_level(dummy_output(i), LogLevel::Trace); + } + + // Verify that that all outputs have been added, and that the order is Error, Warning, Info, Debug, Trace + count = 0; + for (LogOutputList::Iterator it = list.iterator(); it != list.end(); it++) { + ASSERT_EQ(dummy_output(count++), *it); + } + ASSERT_EQ(25u, count); +} + +// Test is_level() on lists with a single output on different levels +TEST(LogOutputList, is_level_single_output) { + for (size_t i = LogLevel::First; i < LogLevel::Count; i++) { + LogLevelType level = static_cast(i); + LogOutputList list; + list.set_output_level(LogOutput::Stdout, level); + for (size_t j = LogLevel::First; j < LogLevel::Count; j++) { + LogLevelType other = static_cast(j); + // Verify that levels finer than the current level for stdout are reported as disabled, + // and levels equal to or included in the current level are reported as enabled + if (other >= level) { + EXPECT_TRUE(list.is_level(other)) + << LogLevel::name(other) << " >= " << LogLevel::name(level) << " but is_level() returns false"; + } else { + EXPECT_FALSE(list.is_level(other)) + << LogLevel::name(other) << " < " << LogLevel::name(level) << " but is_level() returns true"; + } + } + } +} + +// Test is_level() with an empty list +TEST(LogOutputList, is_level_empty) { + LogOutputList emptylist; + for (size_t i = LogLevel::First; i < LogLevel::Count; i++) { + LogLevelType other = static_cast(i); + EXPECT_FALSE(emptylist.is_level(other)) << "is_level() returns true even though the list is empty"; + } +} + +// Test is_level() on lists with two outputs on different levels +TEST(LogOutputList, is_level_multiple_outputs) { + for (size_t i = LogLevel::First; i < LogLevel::Count - 1; i++) { + LogOutput* dummy1 = LogOutput::Stdout; + LogOutput* dummy2 = LogOutput::Stderr; + LogLevelType first = static_cast(i); + LogLevelType second = static_cast(i + 1); + LogOutputList list; + list.set_output_level(dummy1, first); + list.set_output_level(dummy2, second); + for (size_t j = LogLevel::First; j < LogLevel::Count; j++) { + LogLevelType other = static_cast(j); + // The first output's level will be the finest, expect it's level to be reported by the list + if (other >= first) { + EXPECT_TRUE(list.is_level(other)) + << LogLevel::name(other) << " >= " << LogLevel::name(first) << " but is_level() returns false"; + } else { + EXPECT_FALSE(list.is_level(other)) + << LogLevel::name(other) << " < " << LogLevel::name(first) << " but is_level() returns true"; + } + } + } +} + +TEST(LogOutputList, level_for) { + LogOutputList list; + + // Ask the empty list about stdout, stderr + EXPECT_EQ(LogLevel::Off, list.level_for(LogOutput::Stdout)); + EXPECT_EQ(LogLevel::Off, list.level_for(LogOutput::Stderr)); + + // Ask for level in a list with two outputs on different levels + list.set_output_level(LogOutput::Stdout, LogLevel::Info); + list.set_output_level(LogOutput::Stderr, LogLevel::Trace); + EXPECT_EQ(LogLevel::Info, list.level_for(LogOutput::Stdout)); + EXPECT_EQ(LogLevel::Trace, list.level_for(LogOutput::Stderr)); + + // Remove and ask again + list.set_output_level(LogOutput::Stdout, LogLevel::Off); + EXPECT_EQ(LogLevel::Off, list.level_for(LogOutput::Stdout)); + EXPECT_EQ(LogLevel::Trace, list.level_for(LogOutput::Stderr)); + + // Ask about an unknown output + LogOutput* dummy = dummy_output(4711); + EXPECT_EQ(LogLevel::Off, list.level_for(dummy)); + + for (size_t i = LogLevel::First; i <= LogLevel::Last; i++) { + LogLevelType level = static_cast(i); + list.set_output_level(dummy, level); + EXPECT_EQ(level, list.level_for(dummy)); + } + + // Make sure the stderr level is still the same + EXPECT_EQ(LogLevel::Trace, list.level_for(LogOutput::Stderr)); +} diff --git a/hotspot/test/native/logging/test_logTag.cpp b/hotspot/test/native/logging/test_logTag.cpp new file mode 100644 index 00000000000..3017a2da4fb --- /dev/null +++ b/hotspot/test/native/logging/test_logTag.cpp @@ -0,0 +1,53 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logTag.hpp" +#include "unittest.hpp" + +TEST(LogTag, from_string) { + // Verify for all tags defined in LOG_TAG_LIST +#define LOG_TAG(tag) \ + EXPECT_EQ(PREFIX_LOG_TAG(tag), LogTag::from_string(#tag)); + LOG_TAG_LIST +#undef LOG_TAG + + // Verify a couple of invalid strings parsing as invalid tags + const char* invalid_tag[] = { + "bad tag", ".^@", "**", "*", "gcc", "+gc", "gc+", "gc+safepoint", + "gc+safepoint=warning", "warning", "=info", "gcsafepointlogging", + "gc+safepointlogging", "gclogging", "+", " gc", "logging ", "," + }; + for (size_t i = 0; i < sizeof(invalid_tag) / sizeof(*invalid_tag); i++) { + EXPECT_EQ(LogTag::__NO_TAG, LogTag::from_string(invalid_tag[i])) + << "'" << invalid_tag[i] << "' did not parse as an invalid tag"; + } +} + +TEST(LogTag, name) { + // Verify for each tag from the macro +#define LOG_TAG(tag) \ + EXPECT_STREQ(#tag, LogTag::name(PREFIX_LOG_TAG(tag))); + LOG_TAG_LIST +#undef LOG_TAG +} diff --git a/hotspot/test/native/logging/test_logTagLevelExpression.cpp b/hotspot/test/native/logging/test_logTagLevelExpression.cpp new file mode 100644 index 00000000000..72bd244a5ca --- /dev/null +++ b/hotspot/test/native/logging/test_logTagLevelExpression.cpp @@ -0,0 +1,183 @@ +/* + * 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. + * + */ +#include "precompiled.hpp" +#include "logging/logLevel.hpp" +#include "logging/logTagLevelExpression.hpp" +#include "logging/logTagSet.hpp" +#include "unittest.hpp" +#include "utilities/globalDefinitions.hpp" + +TEST(LogTagLevelExpression, parse) { + char buf[256]; + const char* invalid_substr[] = { + "=", "+", " ", "+=", "+=*", "*+", " +", "**", "++", ".", ",", ",," ",+", + " *", "all+", "all*", "+all", "+all=Warning", "==Info", "=InfoWarning", + "BadTag+", "logging++", "logging*+", ",=", "gc+gc+gc+gc+gc+gc" + }; + const char* valid_expression[] = { + "all", "gc", "gc,logging", "gc+logging", "logging+gc", "logging+gc,gc", "logging+gc*", "gc=trace", + "gc=trace,logging=info", "logging+gc=trace", "logging+gc=trace,gc+logging=warning,logging", + "gc,all=info", "logging*", "logging*=info", "gc+logging*=error", "logging*,gc=info" + }; + + // Verify valid expressions parse without problems + for (size_t i = 0; i < ARRAY_SIZE(valid_expression); i++) { + LogTagLevelExpression expr; + EXPECT_TRUE(expr.parse(valid_expression[i])) << "Valid expression '" << valid_expression[i] << "' did not parse"; + } + + // Verify we can use 'all' with each available level + for (uint level = LogLevel::First; level <= LogLevel::Last; level++) { + char buf[32]; + int ret = jio_snprintf(buf, sizeof(buf), "all=%s", LogLevel::name(static_cast(level))); + ASSERT_NE(ret, -1); + + LogTagLevelExpression expr; + EXPECT_TRUE(expr.parse(buf)); + } + + // Verify invalid expressions do not parse + for (size_t i = 0; i < ARRAY_SIZE(valid_expression); i++) { + for (size_t j = 0; j < ARRAY_SIZE(invalid_substr); j++) { + // Prefix with invalid substr + LogTagLevelExpression expr; + jio_snprintf(buf, sizeof(buf), "%s%s", invalid_substr[j], valid_expression[i]); + EXPECT_FALSE(expr.parse(buf)) << "'" << buf << "'" << " considered legal"; + + // Suffix with invalid substr + LogTagLevelExpression expr1; + jio_snprintf(buf, sizeof(buf), "%s%s", valid_expression[i], invalid_substr[j]); + EXPECT_FALSE(expr1.parse(buf)) << "'" << buf << "'" << " considered legal"; + + // Use only the invalid substr + LogTagLevelExpression expr2; + EXPECT_FALSE(expr2.parse(invalid_substr[j])) << "'" << invalid_substr[j] << "'" << " considered legal"; + } + + // Suffix/prefix with some unique invalid prefixes/suffixes + LogTagLevelExpression expr; + jio_snprintf(buf, sizeof(buf), "*%s", valid_expression[i]); + EXPECT_FALSE(expr.parse(buf)) << "'" << buf << "'" << " considered legal"; + + LogTagLevelExpression expr1; + jio_snprintf(buf, sizeof(buf), "logging*%s", valid_expression[i]); + EXPECT_FALSE(expr1.parse(buf)) << "'" << buf << "'" << " considered legal"; + } +} + +// Test the level_for() function for an empty expression +TEST(LogTagLevelExpression, level_for_empty) { + LogTagLevelExpression emptyexpr; + ASSERT_TRUE(emptyexpr.parse("")); + // All tagsets should be unspecified since the expression doesn't involve any tagset + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_EQ(LogLevel::Unspecified, emptyexpr.level_for(*ts)); + } +} + +// Test level_for() with "all" without any specified level +TEST(LogTagLevelExpression, level_for_all) { + LogTagLevelExpression allexpr; + ASSERT_TRUE(allexpr.parse("all")); + // Level will be unspecified since no level was given + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_EQ(LogLevel::Unspecified, allexpr.level_for(*ts)); + } +} + +// Test level_for() with "all=debug" +TEST(LogTagLevelExpression, level_for_all_debug) { + LogTagLevelExpression alldebugexpr; + ASSERT_TRUE(alldebugexpr.parse("all=debug")); + // All tagsets should report debug level + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_EQ(LogLevel::Debug, alldebugexpr.level_for(*ts)); + } +} + +// Test level_for() with "all=off" +TEST(LogTagLevelExpression, level_for_all_off) { + LogTagLevelExpression alloffexpr; + ASSERT_TRUE(alloffexpr.parse("all=off")); + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + EXPECT_EQ(LogLevel::Off, alloffexpr.level_for(*ts)); + } +} + +// Test level_for() with an expression that has overlap (last subexpression should be used) +TEST(LogTagLevelExpression, level_for_overlap) { + LogTagLevelExpression overlapexpr; + // The all=warning will be overridden with gc=info and/or logging+safepoint*=trace + ASSERT_TRUE(overlapexpr.parse("all=warning,gc=info,logging+safepoint*=trace")); + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + if (ts->contains(PREFIX_LOG_TAG(gc)) && ts->ntags() == 1) { + EXPECT_EQ(LogLevel::Info, overlapexpr.level_for(*ts)); + } else if (ts->contains(PREFIX_LOG_TAG(logging)) && ts->contains(PREFIX_LOG_TAG(safepoint))) { + EXPECT_EQ(LogLevel::Trace, overlapexpr.level_for(*ts)); + } else { + EXPECT_EQ(LogLevel::Warning, overlapexpr.level_for(*ts)); + } + } + EXPECT_EQ(LogLevel::Warning, overlapexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Info, overlapexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Trace, overlapexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Trace, + overlapexpr.level_for(LogTagSetMapping::tagset())); +} + +// Test level_for() with an expression containing two independent subexpressions +TEST(LogTagLevelExpression, level_for_disjoint) { + LogTagLevelExpression reducedexpr; + ASSERT_TRUE(reducedexpr.parse("gc+logging=trace,class*=error")); + EXPECT_EQ(LogLevel::Error, reducedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Error, reducedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::NotMentioned, reducedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::NotMentioned, reducedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::NotMentioned, reducedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Trace, reducedexpr.level_for(LogTagSetMapping::tagset())); +} + +// Test level_for() with an expression that is completely overridden in the last part of the expression +TEST(LogTagLevelExpression, level_for_override) { + LogTagLevelExpression overrideexpr; + // No matter what, everything should be set to error level because of the last part + ASSERT_TRUE(overrideexpr.parse("logging,gc*=trace,all=error")); + EXPECT_EQ(LogLevel::Error, overrideexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Error, overrideexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Error, overrideexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Error, overrideexpr.level_for(LogTagSetMapping::tagset())); +} + +// Test level_for() with a mixed expression with a bit of everything +TEST(LogTagLevelExpression, level_for_mixed) { + LogTagLevelExpression mixedexpr; + ASSERT_TRUE(mixedexpr.parse("all=warning,gc*=debug,gc=trace,safepoint*=off")); + EXPECT_EQ(LogLevel::Warning, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Warning, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Debug, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Off, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Off, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Debug, mixedexpr.level_for(LogTagSetMapping::tagset())); + EXPECT_EQ(LogLevel::Trace, mixedexpr.level_for(LogTagSetMapping::tagset())); +} diff --git a/hotspot/test/native/logging/test_logTagSet.cpp b/hotspot/test/native/logging/test_logTagSet.cpp new file mode 100644 index 00000000000..327a0afc9b2 --- /dev/null +++ b/hotspot/test/native/logging/test_logTagSet.cpp @@ -0,0 +1,130 @@ +/* + * 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 + * ac_heapanied 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. + * + */ +#include "precompiled.hpp" +#include "logging/logLevel.hpp" +#include "logging/logOutput.hpp" +#include "logging/logTag.hpp" +#include "logging/logTagSet.hpp" +#include "unittest.hpp" + +// Test the default level for each tagset +TEST(LogTagSet, defaults) { + for (LogTagSet* ts = LogTagSet::first(); ts != NULL; ts = ts->next()) { + char buf[256]; + ts->label(buf, sizeof(buf)); + SCOPED_TRACE(buf); + EXPECT_TRUE(ts->is_level(LogLevel::Error)); + EXPECT_TRUE(ts->is_level(LogLevel::Warning)); + EXPECT_FALSE(ts->is_level(LogLevel::Info)); + EXPECT_TRUE(ts->has_output(LogOutput::Stdout)); + EXPECT_FALSE(ts->has_output(LogOutput::Stderr)); + } +} + +TEST(LogTagSet, has_output) { + LogTagSet& ts = LogTagSetMapping::tagset(); + ts.set_output_level(LogOutput::Stderr, LogLevel::Trace); + EXPECT_TRUE(ts.has_output(LogOutput::Stderr)); + EXPECT_FALSE(ts.has_output(NULL)); + ts.set_output_level(LogOutput::Stderr, LogLevel::Off); + EXPECT_FALSE(ts.has_output(LogOutput::Stderr)); +} + +TEST(LogTagSet, ntags) { + const LogTagSet& ts = LogTagSetMapping::tagset(); + EXPECT_EQ(1u, ts.ntags()); + const LogTagSet& ts2 = LogTagSetMapping::tagset(); + EXPECT_EQ(5u, ts2.ntags()); +} + +TEST(LogTagSet, is_level) { + LogTagSet& ts = LogTagSetMapping::tagset(); + // Set info level on stdout and verify that is_level() reports correctly + ts.set_output_level(LogOutput::Stdout, LogLevel::Info); + EXPECT_TRUE(ts.is_level(LogLevel::Error)); + EXPECT_TRUE(ts.is_level(LogLevel::Warning)); + EXPECT_TRUE(ts.is_level(LogLevel::Info)); + EXPECT_FALSE(ts.is_level(LogLevel::Debug)); + EXPECT_FALSE(ts.is_level(LogLevel::Trace)); + ts.set_output_level(LogOutput::Stdout, LogLevel::Default); + EXPECT_TRUE(ts.is_level(LogLevel::Default)); +} + +TEST(LogTagSet, level_for) { + LogOutput* output = LogOutput::Stdout; + LogTagSet& ts = LogTagSetMapping::tagset(); + for (uint i = 0; i < LogLevel::Count; i++) { + LogLevelType level = static_cast(i); + // Set the level and verify that level_for() reports it back + ts.set_output_level(output, level); + EXPECT_EQ(level, ts.level_for(output)); + } + ts.set_output_level(output, LogLevel::Default); +} + +TEST(LogTagSet, contains) { + // Verify that contains works as intended for a few predetermined tagsets + const LogTagSet& ts = LogTagSetMapping::tagset(); + EXPECT_TRUE(ts.contains(PREFIX_LOG_TAG(logging))); + EXPECT_FALSE(ts.contains(PREFIX_LOG_TAG(gc))); + EXPECT_FALSE(ts.contains(PREFIX_LOG_TAG(class))); + + const LogTagSet& ts2 = LogTagSetMapping::tagset(); + EXPECT_TRUE(ts2.contains(PREFIX_LOG_TAG(logging))); + EXPECT_TRUE(ts2.contains(PREFIX_LOG_TAG(gc))); + EXPECT_FALSE(ts2.contains(PREFIX_LOG_TAG(class))); + + const LogTagSet& ts3 = LogTagSetMapping::tagset(); + EXPECT_TRUE(ts3.contains(PREFIX_LOG_TAG(logging))); + EXPECT_TRUE(ts3.contains(PREFIX_LOG_TAG(gc))); + EXPECT_TRUE(ts3.contains(PREFIX_LOG_TAG(class))); + EXPECT_FALSE(ts3.contains(PREFIX_LOG_TAG(safepoint))); + + const LogTagSet& ts4 = LogTagSetMapping::tagset(); + EXPECT_TRUE(ts4.contains(PREFIX_LOG_TAG(logging))); + EXPECT_TRUE(ts4.contains(PREFIX_LOG_TAG(gc))); + EXPECT_TRUE(ts4.contains(PREFIX_LOG_TAG(class))); + EXPECT_TRUE(ts4.contains(PREFIX_LOG_TAG(safepoint))); + EXPECT_TRUE(ts4.contains(PREFIX_LOG_TAG(heap))); +} + +TEST(LogTagSet, label) { + char buf[256]; + const LogTagSet& ts = LogTagSetMapping::tagset(); + ASSERT_NE(-1, ts.label(buf, sizeof(buf))); + EXPECT_STREQ("logging,safepoint", buf); + // Verify using a custom separator + ASSERT_NE(-1, ts.label(buf, sizeof(buf), "++")); + EXPECT_STREQ("logging++safepoint", buf); + + // Verify with three tags + const LogTagSet& ts1 = LogTagSetMapping::tagset(); + ASSERT_NE(-1, ts1.label(buf, sizeof(buf))); + EXPECT_STREQ("logging,safepoint,jni", buf); + + // Verify with a single tag + const LogTagSet& ts2 = LogTagSetMapping::tagset(); + ASSERT_NE(-1, ts2.label(buf, sizeof(buf))); + EXPECT_STREQ("logging", buf); +} From ea503006ddf7b00d8fc4e465bf33dd779a0b7209 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Sun, 14 Aug 2016 21:19:42 -0400 Subject: [PATCH 02/99] 8155043: BitMap set operations assume clear bits beyond unaligned end Be more circumspect in handling of sets with unaligned sizes. Reviewed-by: stefank, jmasa --- hotspot/src/share/vm/utilities/bitMap.cpp | 191 +++++--- hotspot/src/share/vm/utilities/bitMap.hpp | 11 +- .../native/utilities/test_bitMap_setops.cpp | 417 ++++++++++++++++++ 3 files changed, 536 insertions(+), 83 deletions(-) create mode 100644 hotspot/test/native/utilities/test_bitMap_setops.cpp diff --git a/hotspot/src/share/vm/utilities/bitMap.cpp b/hotspot/src/share/vm/utilities/bitMap.cpp index 12758ab02e4..c9c8c73a92c 100644 --- a/hotspot/src/share/vm/utilities/bitMap.cpp +++ b/hotspot/src/share/vm/utilities/bitMap.cpp @@ -376,77 +376,99 @@ void BitMap::par_at_put_large_range(idx_t beg, idx_t end, bool value) { par_put_range_within_word(bit_index(end_full_word), end, value); } +inline bm_word_t tail_mask(idx_t tail_bits) { + assert(tail_bits != 0, "precondition"); // Works, but shouldn't be called. + assert(tail_bits < (idx_t)BitsPerWord, "precondition"); + return (bm_word_t(1) << tail_bits) - 1; +} + +// Get the low tail_bits of value, which is the last partial word of a map. +inline bm_word_t tail_of_map(bm_word_t value, idx_t tail_bits) { + return value & tail_mask(tail_bits); +} + +// Compute the new last word of a map with a non-aligned length. +// new_value has the new trailing bits of the map in the low tail_bits. +// old_value is the last word of the map, including bits beyond the end. +// Returns old_value with the low tail_bits replaced by the corresponding +// bits in new_value. +inline bm_word_t merge_tail_of_map(bm_word_t new_value, + bm_word_t old_value, + idx_t tail_bits) { + bm_word_t mask = tail_mask(tail_bits); + return (new_value & mask) | (old_value & ~mask); +} + bool BitMap::contains(const BitMap& other) const { assert(size() == other.size(), "must have same size"); const bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size_in_words(); index++) { - bm_word_t word_union = dest_map[index] | other_map[index]; - // If this has more bits set than dest_map[index], then other is not a - // subset. - if (word_union != dest_map[index]) return false; + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + // false if other bitmap has bits set which are clear in this bitmap. + if ((~dest_map[index] & other_map[index]) != 0) return false; } - return true; + idx_t rest = bit_in_word(size()); + // true unless there is a partial-word tail in which the other + // bitmap has bits set which are clear in this bitmap. + return (rest == 0) || tail_of_map(~dest_map[limit] & other_map[limit], rest) == 0; } bool BitMap::intersects(const BitMap& other) const { assert(size() == other.size(), "must have same size"); const bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size_in_words(); index++) { + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { if ((dest_map[index] & other_map[index]) != 0) return true; } - // Otherwise, no intersection. - return false; + idx_t rest = bit_in_word(size()); + // false unless there is a partial-word tail with non-empty intersection. + return (rest > 0) && tail_of_map(dest_map[limit] & other_map[limit], rest) != 0; } void BitMap::set_union(const BitMap& other) { assert(size() == other.size(), "must have same size"); bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size_in_words(); index++) { - dest_map[index] = dest_map[index] | other_map[index]; + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + dest_map[index] |= other_map[index]; + } + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + dest_map[limit] = merge_tail_of_map(orig | other_map[limit], orig, rest); } } - void BitMap::set_difference(const BitMap& other) { assert(size() == other.size(), "must have same size"); bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size_in_words(); index++) { - dest_map[index] = dest_map[index] & ~(other_map[index]); + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + dest_map[index] &= ~other_map[index]; + } + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + dest_map[limit] = merge_tail_of_map(orig & ~other_map[limit], orig, rest); } } - void BitMap::set_intersection(const BitMap& other) { assert(size() == other.size(), "must have same size"); bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { - dest_map[index] = dest_map[index] & other_map[index]; + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + dest_map[index] &= other_map[index]; } -} - - -void BitMap::set_intersection_at_offset(const BitMap& other, idx_t offset) { - assert(other.size() >= offset, "offset not in range"); - assert(other.size() - offset >= size(), "other not large enough"); - // XXX Ideally, we would remove this restriction. - guarantee((offset % (sizeof(bm_word_t) * BitsPerByte)) == 0, - "Only handle aligned cases so far."); - bm_word_t* dest_map = map(); - const bm_word_t* other_map = other.map(); - idx_t offset_word_ind = word_index(offset); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { - dest_map[index] = dest_map[index] & other_map[offset_word_ind + index]; + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + dest_map[limit] = merge_tail_of_map(orig & other_map[limit], orig, rest); } } @@ -455,88 +477,111 @@ bool BitMap::set_union_with_result(const BitMap& other) { bool changed = false; bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { - idx_t temp = dest_map[index] | other_map[index]; - changed = changed || (temp != dest_map[index]); + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + bm_word_t orig = dest_map[index]; + bm_word_t temp = orig | other_map[index]; + changed = changed || (temp != orig); dest_map[index] = temp; } + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + bm_word_t temp = merge_tail_of_map(orig | other_map[limit], orig, rest); + changed = changed || (temp != orig); + dest_map[limit] = temp; + } return changed; } - bool BitMap::set_difference_with_result(const BitMap& other) { assert(size() == other.size(), "must have same size"); bool changed = false; bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { - bm_word_t temp = dest_map[index] & ~(other_map[index]); - changed = changed || (temp != dest_map[index]); + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + bm_word_t orig = dest_map[index]; + bm_word_t temp = orig & ~other_map[index]; + changed = changed || (temp != orig); dest_map[index] = temp; } + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + bm_word_t temp = merge_tail_of_map(orig & ~other_map[limit], orig, rest); + changed = changed || (temp != orig); + dest_map[limit] = temp; + } return changed; } - bool BitMap::set_intersection_with_result(const BitMap& other) { assert(size() == other.size(), "must have same size"); bool changed = false; bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { bm_word_t orig = dest_map[index]; bm_word_t temp = orig & other_map[index]; changed = changed || (temp != orig); - dest_map[index] = temp; + dest_map[index] = temp; + } + idx_t rest = bit_in_word(size()); + if (rest > 0) { + bm_word_t orig = dest_map[limit]; + bm_word_t temp = merge_tail_of_map(orig & other_map[limit], orig, rest); + changed = changed || (temp != orig); + dest_map[limit] = temp; } return changed; } - void BitMap::set_from(const BitMap& other) { assert(size() == other.size(), "must have same size"); bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { - dest_map[index] = other_map[index]; + idx_t copy_words = word_index(size()); + Copy::disjoint_words((HeapWord*)other_map, (HeapWord*)dest_map, copy_words); + idx_t rest = bit_in_word(size()); + if (rest > 0) { + dest_map[copy_words] = merge_tail_of_map(other_map[copy_words], + dest_map[copy_words], + rest); } } - -bool BitMap::is_same(const BitMap& other) { +bool BitMap::is_same(const BitMap& other) const { assert(size() == other.size(), "must have same size"); - bm_word_t* dest_map = map(); + const bm_word_t* dest_map = map(); const bm_word_t* other_map = other.map(); - idx_t size = size_in_words(); - for (idx_t index = 0; index < size; index++) { + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { if (dest_map[index] != other_map[index]) return false; } - return true; + idx_t rest = bit_in_word(size()); + return (rest == 0) || (tail_of_map(dest_map[limit] ^ other_map[limit], rest) == 0); } bool BitMap::is_full() const { - const bm_word_t* word = map(); - idx_t rest = size(); - for (; rest >= (idx_t) BitsPerWord; rest -= BitsPerWord) { - if (*word != ~(bm_word_t)0) return false; - word++; + const bm_word_t* words = map(); + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + if (~words[index] != 0) return false; } - return rest == 0 || (*word | ~right_n_bits((int)rest)) == ~(bm_word_t)0; + idx_t rest = bit_in_word(size()); + return (rest == 0) || (tail_of_map(~words[limit], rest) == 0); } - bool BitMap::is_empty() const { - const bm_word_t* word = map(); - idx_t rest = size(); - for (; rest >= (idx_t) BitsPerWord; rest -= BitsPerWord) { - if (*word != 0) return false; - word++; + const bm_word_t* words = map(); + idx_t limit = word_index(size()); + for (idx_t index = 0; index < limit; ++index) { + if (words[index] != 0) return false; } - return rest == 0 || (*word & right_n_bits((int)rest)) == 0; + idx_t rest = bit_in_word(size()); + return (rest == 0) || (tail_of_map(words[limit], rest) == 0); } void BitMap::clear_large() { diff --git a/hotspot/src/share/vm/utilities/bitMap.hpp b/hotspot/src/share/vm/utilities/bitMap.hpp index 01c94dae19c..919a54cd483 100644 --- a/hotspot/src/share/vm/utilities/bitMap.hpp +++ b/hotspot/src/share/vm/utilities/bitMap.hpp @@ -284,18 +284,9 @@ class BitMap VALUE_OBJ_CLASS_SPEC { bool set_difference_with_result(const BitMap& bits); bool set_intersection_with_result(const BitMap& bits); - // Requires the submap of "bits" starting at offset to be at least as - // large as "this". Modifies "this" to be the intersection of its - // current contents and the submap of "bits" starting at "offset" of the - // same length as "this." - // (For expedience, currently requires the offset to be aligned to the - // bitsize of a uintptr_t. This should go away in the future though it - // will probably remain a good case to optimize.) - void set_intersection_at_offset(const BitMap& bits, idx_t offset); - void set_from(const BitMap& bits); - bool is_same(const BitMap& bits); + bool is_same(const BitMap& bits) const; // Test if all bits are set or cleared bool is_full() const; diff --git a/hotspot/test/native/utilities/test_bitMap_setops.cpp b/hotspot/test/native/utilities/test_bitMap_setops.cpp new file mode 100644 index 00000000000..45b6d79a444 --- /dev/null +++ b/hotspot/test/native/utilities/test_bitMap_setops.cpp @@ -0,0 +1,417 @@ +/* + * 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. + * + */ + +#include "precompiled.hpp" +#include "utilities/bitMap.inline.hpp" +#include "utilities/copy.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include +#include "unittest.hpp" + +typedef BitMap::idx_t idx_t; +typedef BitMap::bm_word_t bm_word_t; + +class BitMapMemory { +private: + idx_t _words; + bm_word_t* _memory; + +public: + BitMapMemory(idx_t bits) : + _words(BitMap::calc_size_in_words(bits)), + _memory(static_cast(malloc(_words * sizeof(bm_word_t)))) + { } + + ~BitMapMemory() { + free(_memory); + } + + BitMapView make_view(idx_t bits, bm_word_t value) { + vmassert(BitMap::calc_size_in_words(bits) <= _words, "invalid request"); + STATIC_ASSERT(sizeof(bm_word_t) == sizeof(HeapWord)); + Copy::fill_to_aligned_words((HeapWord*)_memory, _words, value); + return BitMapView(_memory, bits); + } + + bm_word_t* memory() { return _memory; } +}; + +const idx_t aligned_size = 4 * BitsPerWord; +const idx_t unaligned_size = aligned_size - (BitsPerWord / 2); + +static bm_word_t make_even_bits() { + bm_word_t result = 1; + while (true) { + bm_word_t next = (result << 2) | 1; + if (next == result) { + return result; + } + result = next; + } +} + +const bm_word_t even_bits = make_even_bits(); +const bm_word_t odd_bits = ~even_bits; +const bm_word_t one_bits = ~bm_word_t(0); +const bm_word_t zero_bits = 0; + +// Scoped set a clear bit and restore to clear. +class WithBitSet { +private: + BitMap& _bm; + idx_t _index; + +public: + WithBitSet(BitMap& bm, idx_t index) : _bm(bm), _index(index) { + // Failure may indicate test bug; can't use ASSERT_xxx in constructor. + EXPECT_FALSE(_bm.at(_index)); + bm.set_bit(_index); + } + + ~WithBitSet() { + _bm.clear_bit(_index); + } +}; + +// Scoped clear a set bit and restore to set. +class WithBitClear { +private: + BitMap& _bm; + idx_t _index; + +public: + WithBitClear(BitMap& bm, idx_t index) : _bm(bm), _index(index) { + // Failure may indicate test bug; can't use ASSERT_xxx in constructor. + EXPECT_TRUE(_bm.at(_index)); + bm.clear_bit(_index); + } + + ~WithBitClear() { + _bm.set_bit(_index); + } +}; + +////////////////////////////////////////////////////////////////////////////// +// bool is_same(const BitMap& bits); + +TEST(BitMap, is_same__aligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(aligned_size, even_bits); + BitMapView y = my.make_view(aligned_size, even_bits); + EXPECT_TRUE(x.is_same(y)); + + WithBitClear wbc(x, aligned_size / 2); + EXPECT_FALSE(x.is_same(y)); +} + +TEST(BitMap, is_same__unaligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(unaligned_size, even_bits); + BitMapView y = my.make_view(unaligned_size, even_bits); + + // Check that a difference beyond the end of x/y doesn't count. + { + BitMapView aligned = BitMapView(mx.memory(), aligned_size); + const idx_t index = aligned_size - 2; + STATIC_ASSERT(unaligned_size <= index); + + WithBitClear wbc(aligned, index); + EXPECT_TRUE(x.is_same(y)); + } + + // Check that a difference in the final partial word does count. + { + idx_t index = unaligned_size - 2; + ASSERT_LE(BitMap::word_align_down(unaligned_size), index); + + WithBitClear wbc(y, index); + EXPECT_FALSE(x.is_same(y)); + } +} + +////////////////////////////////////////////////////////////////////////////// +// bool is_full(); +// bool is_empty(); + +TEST(BitMap, is_full_or_empty__aligned) { + BitMapMemory mx(aligned_size); + + { + BitMapView x = mx.make_view(aligned_size, even_bits); + EXPECT_FALSE(x.is_full()); + EXPECT_FALSE(x.is_empty()); + } + + { + BitMapView x = mx.make_view(aligned_size, zero_bits); + EXPECT_FALSE(x.is_full()); + EXPECT_TRUE(x.is_empty()); + } + + { + BitMapView x = mx.make_view(aligned_size, one_bits); + EXPECT_TRUE(x.is_full()); + EXPECT_FALSE(x.is_empty()); + } +} + +TEST(BitMap, is_full__unaligned) { + BitMapMemory mx(aligned_size); + + BitMapView x = mx.make_view(unaligned_size, one_bits); + EXPECT_TRUE(x.is_full()); + + // Check that a missing bit beyond the end doesn't count. + { + idx_t index = aligned_size - 1; + BitMapView aligned = BitMapView(mx.memory(), aligned_size); + + WithBitClear wcb(aligned, index); + EXPECT_FALSE(aligned.is_full()); + EXPECT_TRUE(x.is_full()); + } + + // Check that a missing bit in the final partial word does count. + { + WithBitClear wcb(x, unaligned_size - 1); + EXPECT_FALSE(x.is_full()); + } +} + +TEST(BitMap, is_empty__unaligned) { + BitMapMemory mx(aligned_size); + + BitMapView x = mx.make_view(unaligned_size, zero_bits); + EXPECT_TRUE(x.is_empty()); + + // Check that a set bit beyond the end doesn't count. + { + idx_t index = aligned_size - 1; + BitMapView aligned = BitMapView(mx.memory(), aligned_size); + + WithBitSet wbs(aligned, index); + EXPECT_FALSE(aligned.is_empty()); + EXPECT_TRUE(x.is_empty()); + } + + // Check that a set bit in the final partial word does count. + { + WithBitSet wbs(x, unaligned_size - 1); + EXPECT_FALSE(x.is_empty()); + } +} + +////////////////////////////////////////////////////////////////////////////// +// bool contains(const BitMap& bits); + +TEST(BitMap, contains__aligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(aligned_size, even_bits); + BitMapView y = my.make_view(aligned_size, even_bits); + EXPECT_TRUE(x.contains(y)); + + WithBitClear wbc(x, aligned_size / 2); + EXPECT_FALSE(x.contains(y)); +} + +TEST(BitMap, contains__unaligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(unaligned_size, even_bits); + BitMapView y = my.make_view(unaligned_size, even_bits); + + // Check that a missing bit beyond the end of x doesn't count. + { + BitMapView aligned = BitMapView(mx.memory(), aligned_size); + const idx_t index = aligned_size - 2; + STATIC_ASSERT(unaligned_size <= index); + + WithBitClear wbc(aligned, index); + EXPECT_TRUE(x.contains(y)); + } + + // Check that a missing bit in the final partial word does count. + { + idx_t index = unaligned_size - 2; + ASSERT_LE(BitMap::word_align_down(unaligned_size), index); + + WithBitClear wbc(x, index); + EXPECT_FALSE(x.contains(y)); + } +} + +////////////////////////////////////////////////////////////////////////////// +// bool intersects(const BitMap& bits); + +TEST(BitMap, intersects__aligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(aligned_size, even_bits); + BitMapView y = my.make_view(aligned_size, zero_bits); + EXPECT_FALSE(x.intersects(y)); + + ASSERT_TRUE(x.at(aligned_size / 2)); + WithBitSet wbs(y, aligned_size / 2); + EXPECT_TRUE(x.intersects(y)); +} + +TEST(BitMap, intersects__unaligned) { + BitMapMemory mx(aligned_size); + BitMapMemory my(aligned_size); + + BitMapView x = mx.make_view(unaligned_size, even_bits); + BitMapView y = my.make_view(unaligned_size, zero_bits); + EXPECT_FALSE(x.intersects(y)); + + // Check that adding a bit beyond the end of y doesn't count. + { + BitMapView aligned_x = BitMapView(mx.memory(), aligned_size); + BitMapView aligned_y = BitMapView(my.memory(), aligned_size); + const idx_t index = aligned_size - 2; + STATIC_ASSERT(unaligned_size <= index); + ASSERT_TRUE(aligned_x.at(index)); + + WithBitSet wbs(aligned_y, index); + EXPECT_FALSE(x.intersects(y)); + } + + // Check that adding a bit in the final partial word does count. + { + idx_t index = unaligned_size - 2; + ASSERT_LE(BitMap::word_align_down(unaligned_size), index); + ASSERT_TRUE(x.at(index)); + + WithBitSet wbs(y, index); + EXPECT_TRUE(x.intersects(y)); + } +} + +////////////////////////////////////////////////////////////////////////////// +// void set_from(const BitMap& bits); +// void set_union(const BitMap& bits); +// void set_difference(const BitMap& bits); +// void set_intersection(const BitMap& bits); +// +// bool set_union_with_result(const BitMap& bits); +// bool set_difference_with_result(const BitMap& bits); +// bool set_intersection_with_result(const BitMap& bits); + +static void check_tail_unmodified(BitMapMemory& mem, + idx_t bits, + bm_word_t fill_word) { + if (!BitMap::is_word_aligned(bits)) { + idx_t last_word_bit_index = BitMap::word_align_down(bits); + idx_t last_word_index = BitMap::calc_size_in_words(last_word_bit_index); + bm_word_t last_word = mem.memory()[last_word_index]; + idx_t shift = bits - last_word_bit_index; + EXPECT_EQ(fill_word >> shift, last_word >> shift); + } +} + +static void check_mod_setop(void (BitMap::*f)(const BitMap&), + idx_t bits, + bm_word_t wx, + bm_word_t wy, + bm_word_t wexp) { + BitMapMemory mx(bits); + BitMapMemory my(bits); + BitMapMemory mexp(bits); + + BitMapView x = mx.make_view(bits, wx); + BitMapView y = my.make_view(bits, wy); + BitMapView exp = mexp.make_view(bits, wexp); + + (x.*f)(y); + + EXPECT_TRUE(exp.is_same(x)); + check_tail_unmodified(mx, bits, wx); +} + +static void check_mod_setop_with_result(bool (BitMap::*f)(const BitMap&), + idx_t bits, + bm_word_t wx, + bm_word_t wy, + bm_word_t wexp) { + BitMapMemory mx(bits); + BitMapMemory my(bits); + BitMapMemory mexp(bits); + + BitMapView x = mx.make_view(bits, wx); + BitMapView y = my.make_view(bits, wy); + BitMapView exp = mexp.make_view(bits, wexp); + + bool value = (x.*f)(y); + EXPECT_EQ(value, wx != wexp); + + EXPECT_TRUE(exp.is_same(x)); + check_tail_unmodified(mx, bits, wx); +} + +#define CHECK_MOD_SETOP_AUX(checker, name, x, y, exp) \ + TEST(BitMap, name ## __ ## x ## _ ## y) { \ + checker(&BitMap::name, aligned_size, \ + x ## _bits, y ## _bits, exp ## _bits); \ + checker(&BitMap::name, unaligned_size, \ + x ## _bits, y ## _bits, exp ## _bits); \ + } + +#define CHECK_MOD_SETOP(name, x, y, exp) \ + CHECK_MOD_SETOP_AUX(check_mod_setop, name, x, y, exp) + +#define CHECK_MOD_SETOP_WITH_RESULT(name, x, y, exp) \ + CHECK_MOD_SETOP_AUX(check_mod_setop_with_result, name, x, y, exp) + +#define CHECK_MOD_SETOPS(name, x, y, exp) \ + CHECK_MOD_SETOP(name, x, y, exp) \ + CHECK_MOD_SETOP_WITH_RESULT(name ## _with_result, x, y, exp) + +CHECK_MOD_SETOP(set_from, even, even, even) +CHECK_MOD_SETOP(set_from, even, odd, odd) +CHECK_MOD_SETOP(set_from, even, one, one) +CHECK_MOD_SETOP(set_from, even, zero, zero) + +CHECK_MOD_SETOPS(set_union, even, even, even) +CHECK_MOD_SETOPS(set_union, even, odd, one) +CHECK_MOD_SETOPS(set_union, even, one, one) +CHECK_MOD_SETOPS(set_union, even, zero, even) + +CHECK_MOD_SETOPS(set_difference, even, even, zero) +CHECK_MOD_SETOPS(set_difference, even, odd, even) +CHECK_MOD_SETOPS(set_difference, even, one, zero) +CHECK_MOD_SETOPS(set_difference, even, zero, even) + +CHECK_MOD_SETOPS(set_intersection, even, even, even) +CHECK_MOD_SETOPS(set_intersection, even, odd, zero) +CHECK_MOD_SETOPS(set_intersection, even, one, even) +CHECK_MOD_SETOPS(set_intersection, even, zero, zero) + From 61066d37958542bb5cf0ab75aaf5fb04577c799d Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Mon, 15 Aug 2016 16:04:16 +0200 Subject: [PATCH 03/99] 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent Stackwalking from corrupt frame Reviewed-by: dlong, thartmann --- .../src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index be5134db66f..a4a4e3da963 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -274,8 +274,14 @@ bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_ // stack overflow handling return false; } else { - *fr = os::fetch_frame_from_ucontext(thread, uc); - *fr = frame(fr->sender_sp(), fr->sp()); + // Returned frame will be the caller of the method that faults on the stack bang. + // Register window not yet rotated (happens at SAVE after stack bang), so there is no new + // frame to go with the faulting PC. Using caller SP that is still in SP, and caller PC + // that was written to O7 at call. + intptr_t* sp = os::Solaris::ucontext_get_sp(uc); + address pc = (address)uc->uc_mcontext.gregs[REG_O7]; + *fr = frame(sp, frame::unpatchable, pc); + if (!fr->is_java_frame()) { assert(fr->safe_for_sender(thread), "Safety check"); *fr = fr->java_sender(); From 72dcc9193edb5db554351574b7ff3c17d1f6c23f Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Mon, 15 Aug 2016 14:08:01 -0700 Subject: [PATCH 04/99] 8163962: [JVMCI] integrate VarHandles Add VarHandle support to JVMCI Reviewed-by: psandoz, iveresov --- hotspot/src/share/vm/jvmci/jvmciEnv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp index 994220ff006..9c5d98361e0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp @@ -342,7 +342,7 @@ methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool, Symbol* sig_sym = cpool->signature_ref_at(index); if (cpool->has_preresolution() - || (holder() == SystemDictionary::MethodHandle_klass() && + || ((holder() == SystemDictionary::MethodHandle_klass() || holder() == SystemDictionary::VarHandle_klass()) && MethodHandles::is_signature_polymorphic_name(holder(), name_sym))) { // Short-circuit lookups for JSR 292-related call sites. // That is, do not rely only on name-based lookups, because they may fail From 6e820bb025b5cd16e391a7839ae215dcba401c3a Mon Sep 17 00:00:00 2001 From: Dean Long Date: Tue, 16 Aug 2016 09:19:13 -0700 Subject: [PATCH 05/99] 8161598: Kitchensink fails: assert(nm->insts_contains(original_pc)) failed: original PC must be in nmethod/CompiledMethod Skip unwalkable frames in Reviewed-by: fparain, coleenp, aph --- hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp | 4 +-- hotspot/src/cpu/x86/vm/frame_x86.cpp | 31 ++++++++++++++++--- hotspot/src/cpu/x86/vm/frame_x86.inline.hpp | 1 + .../src/cpu/x86/vm/javaFrameAnchor_x86.hpp | 7 ++--- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 17 +++++----- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 4 +-- hotspot/src/cpu/x86/vm/runtime_x86_32.cpp | 2 +- .../src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 16 +++++----- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 20 ++++++------ .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 2 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 2 +- .../vm/templateInterpreterGenerator_x86.cpp | 4 +-- .../src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp | 2 +- .../src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp | 8 ++--- .../os_cpu/linux_x86/vm/thread_linux_x86.cpp | 2 +- .../os_cpu/linux_x86/vm/thread_linux_x86.hpp | 8 ++--- .../solaris_x86/vm/thread_solaris_x86.cpp | 5 ++- .../solaris_x86/vm/thread_solaris_x86.hpp | 8 ++--- .../windows_x86/vm/thread_windows_x86.cpp | 2 +- .../windows_x86/vm/thread_windows_x86.hpp | 8 ++--- 20 files changed, 77 insertions(+), 76 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index 0b607df2606..5fe455600d1 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -98,7 +98,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre } pop(rax); #endif - reset_last_Java_frame(thread, true, align_stack); + reset_last_Java_frame(thread, true); // discard thread and arguments NOT_LP64(addptr(rsp, num_rt_args()*BytesPerWord)); @@ -872,7 +872,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { } __ pop(rax); #endif - __ reset_last_Java_frame(thread, true, false); + __ reset_last_Java_frame(thread, true); #ifndef _LP64 __ pop(rcx); // discard thread arg __ pop(rcx); // discard dummy diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 1db4b424cf5..0a636f44ec0 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -337,13 +337,16 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const { JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); assert(!entry_frame_is_first(), "next Java fp must be non zero"); assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack"); + // Since we are walking the stack now this nested anchor is obviously walkable + // even if it wasn't when it was stacked. + if (!jfa->walkable()) { + // Capture _last_Java_pc (if needed) and mark anchor walkable. + jfa->capture_last_Java_pc(); + } map->clear(); assert(map->include_argument_oops(), "should be set by clear"); - if (jfa->last_Java_pc() != NULL ) { - frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc()); - return fr; - } - frame fr(jfa->last_Java_sp(), jfa->last_Java_fp()); + vmassert(jfa->last_Java_pc() != NULL, "not walkable"); + frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc()); return fr; } @@ -666,3 +669,21 @@ frame::frame(void* sp, void* fp, void* pc) { init((intptr_t*)sp, (intptr_t*)fp, (address)pc); } #endif + +void JavaFrameAnchor::make_walkable(JavaThread* thread) { + // last frame set? + if (last_Java_sp() == NULL) return; + // already walkable? + if (walkable()) return; + vmassert(Thread::current() == (Thread*)thread, "not current thread"); + vmassert(last_Java_sp() != NULL, "not called from Java code?"); + vmassert(last_Java_pc() == NULL, "already walkable"); + capture_last_Java_pc(); + vmassert(walkable(), "something went wrong"); +} + +void JavaFrameAnchor::capture_last_Java_pc() { + vmassert(_last_Java_sp != NULL, "no last frame set"); + vmassert(_last_Java_pc == NULL, "already walkable"); + _last_Java_pc = (address)_last_Java_sp[-1]; +} diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 0c968ce80cf..d7d8e47ea89 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -101,6 +101,7 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) { // call a specialized frame constructor instead of this one. // Then we could use the assert below. However this assert is of somewhat dubious // value. + // UPDATE: this constructor is only used by trace_method_handle_stub() now. // assert(_pc != NULL, "no pc?"); _cb = CodeCache::find_blob(_pc); diff --git a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp index 77298e53770..40eedf019ae 100644 --- a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp +++ b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp @@ -62,10 +62,9 @@ public: _last_Java_sp = src->_last_Java_sp; } - // Always walkable - bool walkable(void) { return true; } - // Never any thing to do since we are always walkable and can find address of return addresses - void make_walkable(JavaThread* thread) { } + bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; } + void make_walkable(JavaThread* thread); + void capture_last_Java_pc(void); intptr_t* last_Java_sp(void) const { return _last_Java_sp; } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 9b52535459a..9957425c95c 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -752,8 +752,7 @@ void MacroAssembler::pushptr(AddressLiteral src) { } } -void MacroAssembler::reset_last_Java_frame(bool clear_fp, - bool clear_pc) { +void MacroAssembler::reset_last_Java_frame(bool clear_fp) { // we must set sp to zero to clear frame movptr(Address(r15_thread, JavaThread::last_Java_sp_offset()), NULL_WORD); // must clear fp, so that compiled frames are not confused; it is @@ -762,9 +761,8 @@ void MacroAssembler::reset_last_Java_frame(bool clear_fp, movptr(Address(r15_thread, JavaThread::last_Java_fp_offset()), NULL_WORD); } - if (clear_pc) { - movptr(Address(r15_thread, JavaThread::last_Java_pc_offset()), NULL_WORD); - } + // Always clear the pc because it could have been set by make_walkable() + movptr(Address(r15_thread, JavaThread::last_Java_pc_offset()), NULL_WORD); } void MacroAssembler::set_last_Java_frame(Register last_java_sp, @@ -2531,7 +2529,7 @@ void MacroAssembler::call_VM_base(Register oop_result, } // reset last Java frame // Only interpreter should have to clear fp - reset_last_Java_frame(java_thread, true, false); + reset_last_Java_frame(java_thread, true); // C++ interp handles this in the interpreter check_and_handle_popframe(java_thread); @@ -3642,8 +3640,7 @@ void MacroAssembler::push_IU_state() { pusha(); } -void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp, bool clear_pc) { - // determine java_thread register +void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp) { // determine java_thread register if (!java_thread->is_valid()) { java_thread = rdi; get_thread(java_thread); @@ -3654,8 +3651,8 @@ void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp, movptr(Address(java_thread, JavaThread::last_Java_fp_offset()), NULL_WORD); } - if (clear_pc) - movptr(Address(java_thread, JavaThread::last_Java_pc_offset()), NULL_WORD); + // Always clear the pc because it could have been set by make_walkable() + movptr(Address(java_thread, JavaThread::last_Java_pc_offset()), NULL_WORD); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index 2098c05891e..cd3c67c4ab2 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -288,10 +288,10 @@ class MacroAssembler: public Assembler { Register last_java_fp, address last_java_pc); - void reset_last_Java_frame(Register thread, bool clear_fp, bool clear_pc); + void reset_last_Java_frame(Register thread, bool clear_fp); // thread in the default location (r15_thread on 64bit) - void reset_last_Java_frame(bool clear_fp, bool clear_pc); + void reset_last_Java_frame(bool clear_fp); // Stores void store_check(Register obj); // store check for obj - register is destroyed afterwards diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp index 5ff630145a7..a40edbd1297 100644 --- a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp @@ -117,7 +117,7 @@ void OptoRuntime::generate_exception_blob() { // No registers to map, rbp is known implicitly oop_maps->add_gc_map( __ pc() - start, new OopMap( framesize, 0 )); __ get_thread(rcx); - __ reset_last_Java_frame(rcx, false, false); + __ reset_last_Java_frame(rcx, false); // Restore callee-saved registers __ movptr(rbp, Address(rsp, rbp_off * wordSize)); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index a24397f4c8f..96961a8b9b0 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1330,7 +1330,7 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, __ increment(rsp, wordSize); __ get_thread(thread); - __ reset_last_Java_frame(thread, false, true); + __ reset_last_Java_frame(thread, false); save_or_restore_arguments(masm, stack_slots, total_in_args, arg_save_area, NULL, in_regs, in_sig_bt); @@ -2224,7 +2224,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // We can finally stop using that last_Java_frame we setup ages ago - __ reset_last_Java_frame(thread, false, true); + __ reset_last_Java_frame(thread, false); // Unpack oop result if (ret_type == T_OBJECT || ret_type == T_ARRAY) { @@ -2553,7 +2553,7 @@ void SharedRuntime::generate_deopt_blob() { __ pop(rcx); __ get_thread(rcx); - __ reset_last_Java_frame(rcx, false, false); + __ reset_last_Java_frame(rcx, false); // Load UnrollBlock into EDI __ mov(rdi, rax); @@ -2702,7 +2702,7 @@ void SharedRuntime::generate_deopt_blob() { __ push(rax); __ get_thread(rcx); - __ reset_last_Java_frame(rcx, false, false); + __ reset_last_Java_frame(rcx, false); // Collect return values __ movptr(rax,Address(rsp, (RegisterSaver::raxOffset() + additional_words + 1)*wordSize)); @@ -2806,7 +2806,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { __ get_thread(rcx); - __ reset_last_Java_frame(rcx, false, false); + __ reset_last_Java_frame(rcx, false); // Load UnrollBlock into EDI __ movptr(rdi, rax); @@ -2912,7 +2912,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { oop_maps->add_gc_map( __ pc()-start, new OopMap( framesize, 0 ) ); __ get_thread(rdi); - __ reset_last_Java_frame(rdi, true, false); + __ reset_last_Java_frame(rdi, true); // Pop self-frame. __ leave(); // Epilog! @@ -3007,7 +3007,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t // Clear last_Java_sp again __ get_thread(java_thread); - __ reset_last_Java_frame(java_thread, false, false); + __ reset_last_Java_frame(java_thread, false); __ cmpptr(Address(java_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); __ jcc(Assembler::equal, noException); @@ -3082,7 +3082,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha __ addptr(rsp, wordSize); // clear last_Java_sp - __ reset_last_Java_frame(thread, true, false); + __ reset_last_Java_frame(thread, true); // check for pending exceptions Label pending; __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 81ed472f462..76b7bb46e34 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1461,7 +1461,7 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, __ mov(rsp, r12); // restore sp __ reinit_heapbase(); - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); save_or_restore_arguments(masm, stack_slots, total_in_args, arg_save_area, NULL, in_regs, in_sig_bt); @@ -2577,7 +2577,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, restore_native_result(masm, ret_type, stack_slots); } - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // Unpack oop result if (ret_type == T_OBJECT || ret_type == T_ARRAY) { @@ -2849,7 +2849,7 @@ void SharedRuntime::generate_deopt_blob() { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap))); oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); __ jmp(after_fetch_unroll_info_call); } // EnableJVMCI @@ -2939,7 +2939,7 @@ void SharedRuntime::generate_deopt_blob() { // find any register it might need. oop_maps->add_gc_map(__ pc() - start, map); - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); #if INCLUDE_JVMCI if (EnableJVMCI) { @@ -3087,7 +3087,7 @@ void SharedRuntime::generate_deopt_blob() { new OopMap( frame_size_in_words, 0 )); // Clear fp AND pc - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); // Collect return values __ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes())); @@ -3164,7 +3164,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { oop_maps->add_gc_map(__ pc() - start, map); - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); // Load UnrollBlock* into rdi __ mov(rdi, rax); @@ -3281,7 +3281,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); // Clear fp AND pc - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); // Pop self-frame. __ leave(); // Epilog @@ -3364,7 +3364,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t Label noException; - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); __ jcc(Assembler::equal, noException); @@ -3434,7 +3434,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha // rax contains the address we are going to jump to assuming no exception got installed // clear last_Java_sp - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); // check for pending exceptions Label pending; __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); @@ -3809,7 +3809,7 @@ void OptoRuntime::generate_exception_blob() { oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // Restore callee-saved registers diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 60485a6a1d8..c52be1e17cb 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -3766,7 +3766,7 @@ class StubGenerator: public StubCodeGenerator { // however can use the register value directly if it is callee saved. __ get_thread(java_thread); - __ reset_last_Java_frame(java_thread, true, false); + __ reset_last_Java_frame(java_thread, true); __ leave(); // required for proper stackwalking of RuntimeStub frame diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 02e46bd02aa..668b3e1e128 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -5018,7 +5018,7 @@ class StubGenerator: public StubCodeGenerator { oop_maps->add_gc_map(the_pc - start, map); - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); __ leave(); // required for proper stackwalking of RuntimeStub frame diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index 225850e8f40..845959fe4e4 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -1167,7 +1167,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_Java); // reset_last_Java_frame - __ reset_last_Java_frame(thread, true, true); + __ reset_last_Java_frame(thread, true); // reset handle block __ movptr(t, Address(thread, JavaThread::active_handles_offset())); @@ -1659,7 +1659,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { __ set_last_Java_frame(noreg, rbp, __ pc()); __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), r15_thread, c_rarg1, c_rarg2); #endif - __ reset_last_Java_frame(thread, true, true); + __ reset_last_Java_frame(thread, true); // Restore the last_sp and null it out __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); diff --git a/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp index df36e6edbe1..9747e0aab65 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp @@ -45,7 +45,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than ucontext info. - if (jt->has_last_Java_frame()) { + if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { *fr_addr = jt->pd_last_frame(); return true; } diff --git a/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp b/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp index 1d7921c7114..b1717c5c22a 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp @@ -32,12 +32,8 @@ frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); } public: diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp index 3075dd19dd3..59991b7765f 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp @@ -46,7 +46,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than ucontext info. - if (jt->has_last_Java_frame()) { + if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { *fr_addr = jt->pd_last_frame(); return true; } diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp index 75fb7df5787..ab8bd4c3cb9 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp @@ -32,12 +32,8 @@ frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); } public: diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp index 48af49f7497..4f413baaca3 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp @@ -45,9 +45,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, assert(this->is_Java_thread(), "must be JavaThread"); JavaThread* jt = (JavaThread *)this; - // last_Java_frame is always walkable and safe use it if we have it - - if (jt->has_last_Java_frame()) { + // There is small window where last_Java_frame is not walkable or safe + if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { *fr_addr = jt->pd_last_frame(); return true; } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp index 7589a81a83b..934f80a04fe 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp @@ -30,12 +30,8 @@ frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); } public: diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp index ba5be5736cf..c093c146842 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp @@ -48,7 +48,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than CONTEXT info. - if (jt->has_last_Java_frame()) { + if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { *fr_addr = jt->pd_last_frame(); return true; } diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp index 65aac35109a..8d6e5f820f8 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp @@ -32,12 +32,8 @@ frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); } public: From ad3fc31b3de2618c325de5c9590067991da6884e Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 16 Aug 2016 17:31:57 +0100 Subject: [PATCH 06/99] 8164113: AArch64: follow-up the fix for 8161598 Reviewed-by: dlong --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 2 +- .../cpu/aarch64/vm/c1_Runtime1_aarch64.cpp | 4 +-- hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 31 ++++++++++++++++--- .../cpu/aarch64/vm/interp_masm_aarch64.hpp | 2 +- .../aarch64/vm/javaFrameAnchor_aarch64.hpp | 7 ++--- .../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 13 ++++---- .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 6 ++-- .../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 18 +++++------ .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 2 +- .../templateInterpreterGenerator_aarch64.cpp | 2 +- .../linux_aarch64/vm/thread_linux_aarch64.cpp | 2 +- .../linux_aarch64/vm/thread_linux_aarch64.hpp | 7 +---- 12 files changed, 55 insertions(+), 41 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 50c6d33f39d..f338390dbbb 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -4680,7 +4680,7 @@ encode %{ Label retaddr; __ adr(rscratch2, retaddr); __ lea(rscratch1, RuntimeAddress(entry)); - // Leave a breadcrumb for JavaThread::pd_last_frame(). + // Leave a breadcrumb for JavaFrameAnchor::capture_last_Java_pc() __ stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize))); __ blrt(rscratch1, gpcnt, fpcnt, rtype); __ bind(retaddr); diff --git a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp index 7752e7bfee3..f6339d7976c 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp @@ -78,7 +78,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre } pop(r0, sp); #endif - reset_last_Java_frame(true, true); + reset_last_Java_frame(true); maybe_isb(); // check for pending exceptions @@ -547,7 +547,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { __ bind(L); } #endif - __ reset_last_Java_frame(true, false); + __ reset_last_Java_frame(true); __ maybe_isb(); // check for pending exceptions diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 473c4bc67eb..8963353ede3 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -336,13 +336,16 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const { JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); assert(!entry_frame_is_first(), "next Java fp must be non zero"); assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack"); + // Since we are walking the stack now this nested anchor is obviously walkable + // even if it wasn't when it was stacked. + if (!jfa->walkable()) { + // Capture _last_Java_pc (if needed) and mark anchor walkable. + jfa->capture_last_Java_pc(); + } map->clear(); assert(map->include_argument_oops(), "should be set by clear"); - if (jfa->last_Java_pc() != NULL ) { - frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc()); - return fr; - } - frame fr(jfa->last_Java_sp(), jfa->last_Java_fp()); + vmassert(jfa->last_Java_pc() != NULL, "not walkable"); + frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc()); return fr; } @@ -769,3 +772,21 @@ frame::frame(void* sp, void* fp, void* pc) { init((intptr_t*)sp, (intptr_t*)fp, (address)pc); } #endif + +void JavaFrameAnchor::make_walkable(JavaThread* thread) { + // last frame set? + if (last_Java_sp() == NULL) return; + // already walkable? + if (walkable()) return; + vmassert(Thread::current() == (Thread*)thread, "not current thread"); + vmassert(last_Java_sp() != NULL, "not called from Java code?"); + vmassert(last_Java_pc() == NULL, "already walkable"); + capture_last_Java_pc(); + vmassert(walkable(), "something went wrong"); +} + +void JavaFrameAnchor::capture_last_Java_pc() { + vmassert(_last_Java_sp != NULL, "no last frame set"); + vmassert(_last_Java_pc == NULL, "already walkable"); + _last_Java_pc = (address)_last_Java_sp[-1]; +} diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index dd73bf5283d..925690b0d80 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -201,7 +201,7 @@ class InterpreterMacroAssembler: public MacroAssembler { // #endif MacroAssembler::null_check(reg, offset); // #ifdef ASSERT -// reset_last_Java_frame(true, false); +// reset_last_Java_frame(true); // #endif } diff --git a/hotspot/src/cpu/aarch64/vm/javaFrameAnchor_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/javaFrameAnchor_aarch64.hpp index e6375d77bdc..afdab23b9b5 100644 --- a/hotspot/src/cpu/aarch64/vm/javaFrameAnchor_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/javaFrameAnchor_aarch64.hpp @@ -64,10 +64,9 @@ public: _last_Java_sp = src->_last_Java_sp; } - // Always walkable - bool walkable(void) { return true; } - // Never any thing to do since we are always walkable and can find address of return addresses - void make_walkable(JavaThread* thread) { } + bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; } + void make_walkable(JavaThread* thread); + void capture_last_Java_pc(void); intptr_t* last_Java_sp(void) const { return _last_Java_sp; } diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 6e686f51b1b..bd350716788 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -274,19 +274,18 @@ void MacroAssembler::serialize_memory(Register thread, Register tmp) { } -void MacroAssembler::reset_last_Java_frame(bool clear_fp, - bool clear_pc) { +void MacroAssembler::reset_last_Java_frame(bool clear_fp) { // we must set sp to zero to clear frame str(zr, Address(rthread, JavaThread::last_Java_sp_offset())); + // must clear fp, so that compiled frames are not confused; it is // possible that we need it only for debugging if (clear_fp) { str(zr, Address(rthread, JavaThread::last_Java_fp_offset())); } - if (clear_pc) { - str(zr, Address(rthread, JavaThread::last_Java_pc_offset())); - } + // Always clear the pc because it could have been set by make_walkable() + str(zr, Address(rthread, JavaThread::last_Java_pc_offset())); } // Calls to C land @@ -632,7 +631,7 @@ void MacroAssembler::call_VM_base(Register oop_result, // reset last Java frame // Only interpreter should have to clear fp - reset_last_Java_frame(true, true); + reset_last_Java_frame(true); // C++ interp handles this in the interpreter check_and_handle_popframe(java_thread); @@ -875,7 +874,7 @@ void MacroAssembler:: notify(int type) { if (type == bytecode_start) { // set_last_Java_frame(esp, rfp, (address)NULL); Assembler:: notify(type); - // reset_last_Java_frame(true, false); + // reset_last_Java_frame(true); } else Assembler:: notify(type); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 51a47b7a83e..84fe75e305e 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -757,10 +757,10 @@ public: Register last_java_pc, Register scratch); - void reset_last_Java_frame(Register thread, bool clearfp, bool clear_pc); + void reset_last_Java_frame(Register thread); - // thread in the default location (r15_thread on 64bit) - void reset_last_Java_frame(bool clear_fp, bool clear_pc); + // thread in the default location (rthread) + void reset_last_Java_frame(bool clear_fp); // Stores void store_check(Register obj); // store check for obj - register is destroyed afterwards diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 6a5bb7a66b7..771dc099b9f 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -2030,7 +2030,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ bind(dtrace_method_exit_done); } - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // Unpack oop result if (ret_type == T_OBJECT || ret_type == T_ARRAY) { @@ -2370,7 +2370,7 @@ void SharedRuntime::generate_deopt_blob() { __ bind(retaddr); oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); - __ reset_last_Java_frame(false, false); + __ reset_last_Java_frame(false); __ b(after_fetch_unroll_info_call); } // EnableJVMCI @@ -2465,7 +2465,7 @@ void SharedRuntime::generate_deopt_blob() { // find any register it might need. oop_maps->add_gc_map(__ pc() - start, map); - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); #if INCLUDE_JVMCI if (EnableJVMCI) { @@ -2606,7 +2606,7 @@ void SharedRuntime::generate_deopt_blob() { new OopMap( frame_size_in_words, 0 )); // Clear fp AND pc - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); // Collect return values __ ldrd(v0, Address(sp, RegisterSaver::v0_offset_in_bytes())); @@ -2709,7 +2709,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { oop_maps->add_gc_map(__ pc() - start, map); - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // move UnrollBlock* into r4 __ mov(r4, r0); @@ -2828,7 +2828,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); // Clear fp AND pc - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); // Pop self-frame. __ leave(); // Epilog @@ -2906,7 +2906,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t Label noException; - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); __ maybe_isb(); __ membar(Assembler::LoadLoad | Assembler::LoadStore); @@ -2985,7 +2985,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha // r0 contains the address we are going to jump to assuming no exception got installed // clear last_Java_sp - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // check for pending exceptions Label pending; __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset())); @@ -3116,7 +3116,7 @@ void OptoRuntime::generate_exception_blob() { oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); - __ reset_last_Java_frame(false, true); + __ reset_last_Java_frame(false); // Restore callee-saved registers diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 13071f52aba..4df4aad6228 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -3801,7 +3801,7 @@ class StubGenerator: public StubCodeGenerator { oop_maps->add_gc_map(the_pc - start, map); - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); __ maybe_isb(); __ leave(); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 293024c9826..5ac01c904fc 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -1353,7 +1353,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { __ stlrw(rscratch1, rscratch2); // reset_last_Java_frame - __ reset_last_Java_frame(true, true); + __ reset_last_Java_frame(true); // reset handle block __ ldr(t, Address(rthread, JavaThread::active_handles_offset())); diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp index 07206d873d7..f0f2e05ccf1 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp @@ -47,7 +47,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than ucontext info. - if (jt->has_last_Java_frame()) { + if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { *fr_addr = jt->pd_last_frame(); return true; } diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp index 70e37cecaeb..95127e67421 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp @@ -43,12 +43,7 @@ frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); } public: From be08874935929df5f2e6ea464e995ea1bad7f22f Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Wed, 17 Aug 2016 08:19:06 +0200 Subject: [PATCH 07/99] 8164091: VM fails during startup with "assert(resolved_method->method_holder()->is_linked()) failed: must be linked" Don't throw java_lang_VirtualMachineError during VM initialization. Reviewed-by: zmajo, dlong, dholmes --- hotspot/src/share/vm/oops/method.cpp | 10 +++++++++- hotspot/test/compiler/startup/StartupOutput.java | 13 ++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 9bcf81fe0f7..f890d1d1e9b 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -54,6 +54,7 @@ #include "runtime/compilationPolicy.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/init.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/relocator.hpp" #include "runtime/sharedRuntime.hpp" @@ -1015,7 +1016,14 @@ address Method::make_adapters(methodHandle mh, TRAPS) { // so making them eagerly shouldn't be too expensive. AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh); if (adapter == NULL ) { - THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "Out of space in CodeCache for adapters"); + if (!is_init_completed()) { + // Don't throw exceptions during VM initialization because java.lang.* classes + // might not have been initialized, causing problems when constructing the + // Java exception object. + vm_exit_during_initialization("Out of space in CodeCache for adapters"); + } else { + THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "Out of space in CodeCache for adapters"); + } } if (mh->is_shared()) { diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java index b8cd3157d59..04e2a1a3e16 100644 --- a/hotspot/test/compiler/startup/StartupOutput.java +++ b/hotspot/test/compiler/startup/StartupOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8026949 + * @bug 8026949 8164091 * @summary Test ensures correct VM output during startup * @library /testlibrary * @modules java.base/jdk.internal.misc @@ -45,7 +45,14 @@ public class StartupOutput { pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); out = new OutputAnalyzer(pb.start()); out.shouldNotContain("no space to run compilers"); - out.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version"); + out = new OutputAnalyzer(pb.start()); + // The VM should not crash but may return an error message because we don't have enough space for adapters + int exitCode = out.getExitValue(); + if (exitCode != 1 && exitCode != 0) { + throw new Exception("VM crashed with exit code " + exitCode); + } } } From e3d5b655af20c6dd5cc96787424bb3cb81fa1a34 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Wed, 17 Aug 2016 22:09:57 +0300 Subject: [PATCH 08/99] 8164103: C2: Broken cmpxchgb encoding on x86 Reviewed-by: kvn, shade, psandoz --- hotspot/src/cpu/x86/vm/x86_64.ad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 52b58ec0281..6be113df68e 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -986,7 +986,7 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const emit_opcode(cbuf, 0x58 | RBP_enc); if (StackReservedPages > 0 && C->has_reserved_stack_access()) { - __ reserved_stack_check(); + __ reserved_stack_check(); } if (do_polling() && C->is_method_compilation()) { @@ -7355,7 +7355,7 @@ instruct compareAndSwapB(rRegI res, "movzbl $res, $res" %} opcode(0x0F, 0xB0); ins_encode(lock_prefix, - REX_reg_mem(newval, mem_ptr), + REX_breg_mem(newval, mem_ptr), OpcP, OpcS, reg_mem(newval, mem_ptr), REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete @@ -7380,7 +7380,7 @@ instruct compareAndSwapS(rRegI res, opcode(0x0F, 0xB1); ins_encode(lock_prefix, SizePrefix, - REX_reg_mem(newval, mem_ptr), + REX_reg_mem(newval, mem_ptr), OpcP, OpcS, reg_mem(newval, mem_ptr), REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete @@ -7424,7 +7424,7 @@ instruct compareAndExchangeB( "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %} opcode(0x0F, 0xB0); ins_encode(lock_prefix, - REX_reg_mem(newval, mem_ptr), + REX_breg_mem(newval, mem_ptr), OpcP, OpcS, reg_mem(newval, mem_ptr) // lock cmpxchg ); From c645d7bb87cdae8d17d8d6e9f84fc84cf773ba29 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Thu, 18 Aug 2016 11:26:35 +0300 Subject: [PATCH 09/99] 8164035: compiler/profiling/spectrapredefineclass_classloaders/Launcher.java failing with Agent JAR not found or no Agent-Class attribute Reviewed-by: kvn --- .../spectrapredefineclass/Agent.java | 7 ++-- .../spectrapredefineclass/Launcher.java | 32 +++++++++++------ .../Agent.java | 7 ++-- .../Launcher.java | 34 ++++++++++++------- 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass/Agent.java b/hotspot/test/compiler/profiling/spectrapredefineclass/Agent.java index f0a30c6b6a5..98be2c9e1fd 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass/Agent.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass/Agent.java @@ -24,10 +24,12 @@ package compiler.profiling.spectrapredefineclass; import com.sun.tools.attach.VirtualMachine; +import jdk.test.lib.Utils; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; import java.lang.management.ManagementFactory; +import java.nio.file.Paths; import java.security.ProtectionDomain; class A { @@ -67,8 +69,7 @@ class Test { } public class Agent implements ClassFileTransformer { - - + public static final String AGENT_JAR = Paths.get(Utils.TEST_CLASSES, "agent.jar").toString(); static public boolean m2(A a) { boolean res = false; if (a.getClass() == B.class) { @@ -95,7 +96,7 @@ public class Agent implements ClassFileTransformer { // Redefine class try { VirtualMachine vm = VirtualMachine.attach(pid); - vm.loadAgent(System.getProperty("test.classes",".") + "/agent.jar", ""); + vm.loadAgent(AGENT_JAR, ""); vm.detach(); } catch (Exception e) { throw new RuntimeException(e); diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java index 95593898201..5ce2e2d59d5 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java @@ -28,7 +28,7 @@ * @modules java.base/jdk.internal.misc * java.instrument * java.management - * @build compiler.profiling.spectrapredefineclass_classloaders.Agent + * @build compiler.profiling.spectrapredefineclass.Agent * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass.Agent * @run driver compiler.profiling.spectrapredefineclass.Launcher * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation @@ -39,23 +39,33 @@ package compiler.profiling.spectrapredefineclass; -import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.OutputAnalyzer; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; public class Launcher { + private static final String MANIFEST = "MANIFEST.MF"; public static void main(String[] args) throws Exception { + try (PrintWriter pw = new PrintWriter(MANIFEST)) { + pw.println("Agent-Class: " + Agent.class.getName()); + pw.println("Can-Retransform-Classes: true"); + } - PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Agent-Class: " + Launcher.class.getPackage().getName() +".Agent"); - pw.println("Can-Retransform-Classes: true"); - pw.close(); + JDKToolLauncher jar = JDKToolLauncher.create("jar") + .addToolArg("cmf") + .addToolArg(MANIFEST) + .addToolArg(Agent.AGENT_JAR) + .addToolArg(Agent.class.getName().replace('.', File.separatorChar) + ".class"); - ProcessBuilder pb = new ProcessBuilder(); - pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", - System.getProperty("test.classes",".") + "/agent.jar", - "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)}); - pb.start().waitFor(); + ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); + try { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + } catch (IOException ex) { + throw new Error("TESTBUG: jar failed.", ex); + } } } diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java index 35f8523de42..e4a32e2a626 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java @@ -24,6 +24,7 @@ package compiler.profiling.spectrapredefineclass_classloaders; import com.sun.tools.attach.VirtualMachine; +import jdk.test.lib.Utils; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; @@ -32,14 +33,16 @@ import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.file.Path; import java.nio.file.Paths; import java.security.ProtectionDomain; public class Agent implements ClassFileTransformer { + public static final String AGENT_JAR = Paths.get(Utils.TEST_CLASSES, "agent.jar").toString(); public static ClassLoader newClassLoader() { try { return new URLClassLoader(new URL[] { - Paths.get(System.getProperty("test.classes",".")).toUri().toURL(), + Paths.get(Utils.TEST_CLASSES).toUri().toURL(), }, null); } catch (MalformedURLException e){ throw new RuntimeException("Unexpected URL conversion failure", e); @@ -76,7 +79,7 @@ public class Agent implements ClassFileTransformer { for (int i = 0; i < 2; i++) { try { VirtualMachine vm = VirtualMachine.attach(pid); - vm.loadAgent(System.getProperty("test.classes",".") + "/agent.jar", ""); + vm.loadAgent(AGENT_JAR, ""); vm.detach(); } catch (Exception e) { throw new RuntimeException(e); diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java index 328c5bc468e..598e799d9b1 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java @@ -39,26 +39,36 @@ * -XX:ReservedCodeCacheSize=3M * compiler.profiling.spectrapredefineclass_classloaders.Agent */ + package compiler.profiling.spectrapredefineclass_classloaders; -import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.OutputAnalyzer; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; public class Launcher { - public static void main(String[] args) throws Exception { + private static final String MANIFEST = "MANIFEST.MF"; + public static void main(String[] args) throws Exception { + try (PrintWriter pw = new PrintWriter(MANIFEST)) { + pw.println("Agent-Class: " + Agent.class.getName()); + pw.println("Can-Retransform-Classes: true"); + } - PrintWriter pw = new PrintWriter("MANIFEST.MF"); + JDKToolLauncher jar = JDKToolLauncher.create("jar") + .addToolArg("cmf") + .addToolArg(MANIFEST) + .addToolArg(Agent.AGENT_JAR) + .addToolArg(Agent.class.getName().replace('.', File.separatorChar) + ".class"); - pw.println("Agent-Class: " + Launcher.class.getPackage().getName() + ".Agent"); - pw.println("Can-Retransform-Classes: true"); - pw.close(); - - ProcessBuilder pb = new ProcessBuilder(); - pb.command(new String[]{JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", - System.getProperty("test.classes", ".") + "/agent.jar", - "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)}); - pb.start().waitFor(); + ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); + try { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + } catch (IOException ex) { + throw new Error("TESTBUG: jar failed.", ex); + } } } From c0cfad4f3d40852f8b9d1944c07727ddd3278265 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Thu, 18 Aug 2016 12:10:18 +0300 Subject: [PATCH 10/99] 8151345: compiler/codecache/jmx/PeakUsageTest.java is failing on jdk9/dev for JPRT -testset hotspot Reviewed-by: sla, dsamersoff --- .../codecache/jmx/CodeCacheUtils.java | 24 ++++++++++++++- .../compiler/codecache/jmx/PeakUsageTest.java | 29 ++++++++++++------- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java b/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java index 31646f96225..0cce0931188 100644 --- a/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java +++ b/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -119,6 +119,28 @@ public final class CodeCacheUtils { } } + /** + * Verifies that 'newValue' is equal to 'oldValue' if usage of the + * corresponding code heap is predictable. Checks the weaker condition + * 'newValue <= oldValue' if usage is not predictable because intermediate + * allocations may happen. + * + * @param btype BlobType of the code heap to be checked + * @param newValue New value to be verified + * @param oldValue Old value to be verified + * @param msg Error message if verification fails + */ + public static void assertEQorLTE(BlobType btype, long newValue, long oldValue, String msg) { + if (CodeCacheUtils.isCodeHeapPredictable(btype)) { + // Usage is predictable, check strong == condition + Asserts.assertEQ(newValue, oldValue, msg); + } else { + // Usage is not predictable, check weaker <= condition + Asserts.assertLTE(newValue, oldValue, msg); + } + } + + public static void disableCollectionUsageThresholds() { BlobType.getAvailable().stream() .map(BlobType::getMemoryPool) diff --git a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java index e75a362142e..4b593c7ad6d 100644 --- a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java +++ b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java @@ -27,7 +27,6 @@ * @modules java.base/jdk.internal.misc * java.management * - * @ignore 8151345 * @build ompiler.codecache.jmx.PeakUsageTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -69,9 +68,17 @@ public class PeakUsageTest { bean.resetPeakUsage(); long addr = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); - long newPeakUsage = bean.getPeakUsage().getUsed(); + try { - CodeCacheUtils.assertEQorGTE(btype, newPeakUsage, bean.getUsage().getUsed(), + /* + Always save peakUsage after saving currentUsage. Reversing the order + can lead to inconsistent results (currentUsage > peakUsage) because + of intermediate allocations. + */ + long currUsage = bean.getUsage().getUsed(); + long peakUsage = bean.getPeakUsage().getUsed(); + CodeCacheUtils.assertEQorLTE(btype, currUsage, + peakUsage, "Peak usage does not match usage after allocation for " + bean.getName()); } finally { @@ -79,19 +86,21 @@ public class PeakUsageTest { CodeCacheUtils.WB.freeCodeBlob(addr); } } - CodeCacheUtils.assertEQorGTE(btype, newPeakUsage, bean.getPeakUsage().getUsed(), - "Code cache peak usage has changed after usage decreased for " - + bean.getName()); bean.resetPeakUsage(); - CodeCacheUtils.assertEQorGTE(btype, bean.getPeakUsage().getUsed(), - bean.getUsage().getUsed(), + long currUsage = bean.getUsage().getUsed(); + long peakUsage = bean.getPeakUsage().getUsed(); + CodeCacheUtils.assertEQorLTE(btype, currUsage, + peakUsage, "Code cache peak usage is not equal to usage after reset for " + bean.getName()); long addr2 = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); try { - CodeCacheUtils.assertEQorGTE(btype, bean.getPeakUsage().getUsed(), - bean.getUsage().getUsed(), + currUsage = bean.getUsage().getUsed(); + peakUsage = bean.getPeakUsage().getUsed(); + + CodeCacheUtils.assertEQorLTE(btype, currUsage, + peakUsage, "Code cache peak usage is not equal to usage after fresh " + "allocation for " + bean.getName()); } finally { From e29ddeca2c76971e600a6c59cbcf349d41aaab56 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Thu, 18 Aug 2016 14:07:00 +0300 Subject: [PATCH 11/99] 8157236: attach on ARMv7 fails with com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file Add more diagnostic to attach code Reviewed-by: dholmes, alanb --- hotspot/src/os/aix/vm/attachListener_aix.cpp | 9 ++++++++- hotspot/src/os/bsd/vm/attachListener_bsd.cpp | 14 ++++++++++---- hotspot/src/os/linux/vm/attachListener_linux.cpp | 9 ++++++++- .../src/os/solaris/vm/attachListener_solaris.cpp | 11 +++++++++-- hotspot/src/share/vm/logging/logTag.hpp | 3 ++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/hotspot/src/os/aix/vm/attachListener_aix.cpp b/hotspot/src/os/aix/vm/attachListener_aix.cpp index 06225616bb6..a199c711820 100644 --- a/hotspot/src/os/aix/vm/attachListener_aix.cpp +++ b/hotspot/src/os/aix/vm/attachListener_aix.cpp @@ -494,7 +494,7 @@ void AttachListener::vm_start() { if (ret == 0) { ret = ::unlink(fn); if (ret == -1) { - debug_only(warning("failed to remove stale attach pid file at %s", fn)); + log_debug(attach)("Failed to remove stale attach pid file at %s", fn); } } } @@ -537,16 +537,23 @@ bool AttachListener::is_init_trigger() { struct stat64 st; RESTARTABLE(::stat64(fn, &st), ret); if (ret == -1) { + log_trace(attach)("Failed to find attach file: %s, trying alternate", fn); snprintf(fn, sizeof(fn), "%s/.attach_pid%d", os::get_temp_directory(), os::current_process_id()); RESTARTABLE(::stat64(fn, &st), ret); + if (ret == -1) { + log_debug(attach)("Failed to find attach file: %s", fn); + } } if (ret == 0) { // simple check to avoid starting the attach mechanism when // a bogus user creates the file if (st.st_uid == geteuid()) { init(); + log_trace(attach)("Attach trigerred by %s", fn); return true; + } else { + log_debug(attach)("File %s has wrong user id %d (vs %d). Attach is not triggered", fn, st.st_uid, geteuid()); } } return false; diff --git a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp index 57db0673fd2..f9246117812 100644 --- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp +++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp @@ -456,7 +456,7 @@ void AttachListener::vm_start() { if (ret == 0) { ret = ::unlink(fn); if (ret == -1) { - debug_only(warning("failed to remove stale attach pid file at %s", fn)); + log_debug(attach)("Failed to remove stale attach pid file at %s", fn); } } } @@ -493,19 +493,25 @@ bool AttachListener::is_init_trigger() { if (init_at_startup() || is_initialized()) { return false; // initialized at startup or already initialized } - char path[PATH_MAX + 1]; + char fn[PATH_MAX + 1]; int ret; struct stat st; - snprintf(path, PATH_MAX + 1, "%s/.attach_pid%d", + snprintf(fn, PATH_MAX + 1, "%s/.attach_pid%d", os::get_temp_directory(), os::current_process_id()); - RESTARTABLE(::stat(path, &st), ret); + RESTARTABLE(::stat(fn, &st), ret); + if (ret == -1) { + log_debug(attach)("Failed to find attach file: %s", fn); + } if (ret == 0) { // simple check to avoid starting the attach mechanism when // a bogus user creates the file if (st.st_uid == geteuid()) { init(); + log_trace(attach)("Attach trigerred by %s", fn); return true; + } else { + log_debug(attach)("File %s has wrong user id %d (vs %d). Attach is not triggered", fn, st.st_uid, geteuid()); } } return false; diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp index 4e54d898fb2..652d0de1201 100644 --- a/hotspot/src/os/linux/vm/attachListener_linux.cpp +++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp @@ -453,7 +453,7 @@ void AttachListener::vm_start() { if (ret == 0) { ret = ::unlink(fn); if (ret == -1) { - debug_only(warning("failed to remove stale attach pid file at %s", fn)); + log_debug(attach)("Failed to remove stale attach pid file at %s", fn); } } } @@ -496,16 +496,23 @@ bool AttachListener::is_init_trigger() { struct stat64 st; RESTARTABLE(::stat64(fn, &st), ret); if (ret == -1) { + log_trace(attach)("Failed to find attach file: %s, trying alternate", fn); snprintf(fn, sizeof(fn), "%s/.attach_pid%d", os::get_temp_directory(), os::current_process_id()); RESTARTABLE(::stat64(fn, &st), ret); + if (ret == -1) { + log_debug(attach)("Failed to find attach file: %s", fn); + } } if (ret == 0) { // simple check to avoid starting the attach mechanism when // a bogus user creates the file if (st.st_uid == geteuid()) { init(); + log_trace(attach)("Attach trigerred by %s", fn); return true; + } else { + log_debug(attach)("File %s has wrong user id %d (vs %d). Attach is not trigerred", fn, st.st_uid, geteuid()); } } return false; diff --git a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp index b6a4b434940..a1c078490ce 100644 --- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp +++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp @@ -394,7 +394,7 @@ int SolarisAttachListener::create_door() { snprintf(initial_path, sizeof(initial_path), "%s.tmp", door_path); RESTARTABLE(::creat(initial_path, S_IRUSR | S_IWUSR), fd); if (fd == -1) { - debug_only(warning("attempt to create %s failed", initial_path)); + log_debug(attach)("attempt to create door file %s failed (%d)", initial_path, errno); ::door_revoke(dd); return -1; } @@ -409,6 +409,7 @@ int SolarisAttachListener::create_door() { res = ::fattach(dd, initial_path); } if (res == -1) { + log_debug(attach)("unable to create door - fattach failed (%d)", errno); ::door_revoke(dd); dd = -1; } @@ -419,12 +420,14 @@ int SolarisAttachListener::create_door() { if (::rename(initial_path, door_path) == -1) { ::close(dd); ::fdetach(initial_path); + log_debug(attach)("unable to create door - rename %s to %s failed (%d)", errno); dd = -1; } } if (dd >= 0) { set_door_descriptor(dd); set_door_path(door_path); + log_trace(attach)("door file %s created succesfully", door_path); } else { // unable to create door, attach it to file, or rename file into place ::unlink(initial_path); @@ -602,7 +605,7 @@ void AttachListener::vm_start() { if (ret == 0) { ret = ::unlink(fn); if (ret == -1) { - debug_only(warning("failed to remove stale attach pid file at %s", fn)); + log_debug(attach)("Failed to remove stale attach pid file at %s", fn); } } } @@ -645,9 +648,13 @@ bool AttachListener::is_init_trigger() { struct stat64 st; RESTARTABLE(::stat64(fn, &st), ret); if (ret == -1) { + log_trace(attach)("Failed to find attach file: %s, trying alternate", fn); snprintf(fn, sizeof(fn), "%s/.attach_pid%d", os::get_temp_directory(), os::current_process_id()); RESTARTABLE(::stat64(fn, &st), ret); + if (ret == -1) { + log_debug(attach)("Failed to find attach file: %s", fn); + } } if (ret == 0) { // simple check to avoid starting the attach mechanism when diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index f5dc582c6b5..9cbb568b414 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -35,8 +35,9 @@ LOG_TAG(add) \ LOG_TAG(age) \ LOG_TAG(alloc) \ - LOG_TAG(arguments) \ LOG_TAG(annotation) \ + LOG_TAG(arguments) \ + LOG_TAG(attach) \ LOG_TAG(barrier) \ LOG_TAG(biasedlocking) \ LOG_TAG(bot) \ From 663f12c18e9e6df267593a2eba9256c42eae86ed Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 18 Aug 2016 10:47:09 -0400 Subject: [PATCH 12/99] 8037138: x86: problem with JVMTI breakpoint Do aload(0) after rewriting aload bytecodes to fast version for frequent pairs. Reviewed-by: dlong, dholmes, dcubed --- .../src/cpu/aarch64/vm/templateTable_aarch64.cpp | 16 +++++++--------- hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp | 8 +++----- hotspot/src/cpu/x86/vm/templateTable_x86.cpp | 16 +++++++--------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp index 3fd9dbef98e..b2f6e2329d3 100644 --- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -852,26 +852,23 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { // get next bytecode __ load_unsigned_byte(r1, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0))); - // do actual aload_0 - aload(0); - // if _getfield then wait with rewrite __ cmpw(r1, Bytecodes::Bytecodes::_getfield); __ br(Assembler::EQ, done); - // if _igetfield then reqrite to _fast_iaccess_0 + // if _igetfield then rewrite to _fast_iaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_iaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpw(r1, Bytecodes::_fast_igetfield); __ movw(bc, Bytecodes::_fast_iaccess_0); __ br(Assembler::EQ, rewrite); - // if _agetfield then reqrite to _fast_aaccess_0 + // if _agetfield then rewrite to _fast_aaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_aaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpw(r1, Bytecodes::_fast_agetfield); __ movw(bc, Bytecodes::_fast_aaccess_0); __ br(Assembler::EQ, rewrite); - // if _fgetfield then reqrite to _fast_faccess_0 + // if _fgetfield then rewrite to _fast_faccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_faccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpw(r1, Bytecodes::_fast_fgetfield); __ movw(bc, Bytecodes::_fast_faccess_0); @@ -887,9 +884,10 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { patch_bytecode(Bytecodes::_aload_0, bc, r1, false); __ bind(done); - } else { - aload(0); } + + // Do actual aload_0 (must do this after patch_bytecode which might call VM and GC might change oop). + aload(0); } void TemplateTable::istore() diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 44bee0c703c..f828aa0e370 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -705,9 +705,6 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { // get next byte __ ldub(at_bcp(Bytecodes::length_for(Bytecodes::_aload_0)), G3_scratch); - // do actual aload_0 - aload(0); - // if _getfield then wait with rewrite __ cmp_and_br_short(G3_scratch, (int)Bytecodes::_getfield, Assembler::equal, Assembler::pn, done); @@ -738,9 +735,10 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { __ bind(rewrite); patch_bytecode(Bytecodes::_aload_0, G4_scratch, G3_scratch, false); __ bind(done); - } else { - aload(0); } + + // Do actual aload_0 (must do this after patch_bytecode which might call VM and GC might change oop). + aload(0); } void TemplateTable::istore() { diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp index 9f99613b1e6..5f1c935f944 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -858,26 +858,23 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { // get next byte __ load_unsigned_byte(rbx, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0))); - // do actual aload_0 - aload(0); - // if _getfield then wait with rewrite __ cmpl(rbx, Bytecodes::_getfield); __ jcc(Assembler::equal, done); - // if _igetfield then reqrite to _fast_iaccess_0 + // if _igetfield then rewrite to _fast_iaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_iaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_igetfield); __ movl(bc, Bytecodes::_fast_iaccess_0); __ jccb(Assembler::equal, rewrite); - // if _agetfield then reqrite to _fast_aaccess_0 + // if _agetfield then rewrite to _fast_aaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_aaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_agetfield); __ movl(bc, Bytecodes::_fast_aaccess_0); __ jccb(Assembler::equal, rewrite); - // if _fgetfield then reqrite to _fast_faccess_0 + // if _fgetfield then rewrite to _fast_faccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_faccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_fgetfield); __ movl(bc, Bytecodes::_fast_faccess_0); @@ -893,9 +890,10 @@ void TemplateTable::aload_0_internal(RewriteControl rc) { patch_bytecode(Bytecodes::_aload_0, bc, rbx, false); __ bind(done); - } else { - aload(0); } + + // Do actual aload_0 (must do this after patch_bytecode which might call VM and GC might change oop). + aload(0); } void TemplateTable::istore() { From bc0d3d976b98bf9c1840e3b29ba996428a8b678e Mon Sep 17 00:00:00 2001 From: David Holmes Date: Thu, 18 Aug 2016 21:37:26 -0400 Subject: [PATCH 13/99] 8152849: share/vm/runtime/mutex.cpp:1161 assert(((uintptr_t(_owner))|(uintptr_t(_LockWord.FullWord))|(uintptr_t(_EntryList))|(uintptr_t(_WaitSet))|(uintptr_t(_OnDeck))) == 0) failed Reviewed-by: dcubed --- hotspot/src/share/vm/runtime/mutex.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp index f24e2a034db..0fc65b89fb7 100644 --- a/hotspot/src/share/vm/runtime/mutex.cpp +++ b/hotspot/src/share/vm/runtime/mutex.cpp @@ -1148,7 +1148,16 @@ bool Monitor::wait(bool no_safepoint_check, long timeout, } Monitor::~Monitor() { - assert((UNS(_owner)|UNS(_LockWord.FullWord)|UNS(_EntryList)|UNS(_WaitSet)|UNS(_OnDeck)) == 0, ""); +#ifdef ASSERT + uintptr_t owner = UNS(_owner); + uintptr_t lockword = UNS(_LockWord.FullWord); + uintptr_t entrylist = UNS(_EntryList); + uintptr_t waitset = UNS(_WaitSet); + uintptr_t ondeck = UNS(_OnDeck); + assert((owner|lockword|entrylist|waitset|ondeck) == 0, + "_owner(" INTPTR_FORMAT ")|_LockWord(" INTPTR_FORMAT ")|_EntryList(" INTPTR_FORMAT ")|_WaitSet(" + INTPTR_FORMAT ")|_OnDeck(" INTPTR_FORMAT ") != 0", owner, lockword, entrylist, waitset, ondeck); +#endif } void Monitor::ClearMonitor(Monitor * m, const char *name) { From 7c11898ffe62a5ec4ddaa8f1d958da09a8246cca Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Fri, 19 Aug 2016 01:20:39 -0400 Subject: [PATCH 14/99] 8164319: CLHSDB dumpcodecache throws StackOverflowError Reviewed-by: dholmes, dsamersoff --- .../share/classes/sun/jvm/hotspot/code/CodeBlob.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java index 89bc1fcfce2..787060e9761 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java @@ -32,6 +32,7 @@ import sun.jvm.hotspot.types.CIntegerField; import sun.jvm.hotspot.types.Type; import sun.jvm.hotspot.types.TypeDataBase; import sun.jvm.hotspot.utilities.Assert; +import sun.jvm.hotspot.utilities.CStringUtilities; import java.io.PrintStream; import java.util.Observable; @@ -115,7 +116,7 @@ public class CodeBlob extends VMObject { } public String getName() { - return getName(); + return CStringUtilities.getString(nameField.getValue(addr)); } /** OopMap for frame; can return null if none available */ From 42a009f5dd16610b2d97f3cc0ad8ab457ac86f7d Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Fri, 19 Aug 2016 16:02:11 +0200 Subject: [PATCH 15/99] 8164297: Jtreg test exeinvoke fails to link on Ubuntu Reviewed-by: tbell, dholmes --- make/common/TestFilesCompilation.gmk | 1 + 1 file changed, 1 insertion(+) diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index 1dd40a0a877..74414a9ca30 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -86,6 +86,7 @@ define SetupTestFilesCompilationBody LANG := C, \ CFLAGS := $$($1_CFLAGS) $$($1_CFLAGS_$$($1_PREFIX)$$(name)), \ LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$($1_PREFIX)$$(name)), \ + LIBS := $$($1_LIBS_$$($1_PREFIX)$$(name)), \ OPTIMIZATION := LOW, \ )) \ $$(eval $1 += $$(BUILD_TEST_$$(name)) ) \ From f05597d5009807346914341617cc847e8bdb3d33 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Fri, 19 Aug 2016 16:02:21 +0200 Subject: [PATCH 16/99] 8164297: Jtreg test exeinvoke fails to link on Ubuntu Reviewed-by: tbell, dholmes --- hotspot/make/test/JtregNative.gmk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk index ce4a0319909..9ed952f36c0 100644 --- a/hotspot/make/test/JtregNative.gmk +++ b/hotspot/make/test/JtregNative.gmk @@ -71,15 +71,15 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC += \ endif ifeq ($(TOOLCHAIN_TYPE), solstudio) - BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_liboverflow := -lc - BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libSimpleClassFileLoadHook := -lc - BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libGetNamedModuleTest := -lc + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_liboverflow := -lc + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libSimpleClassFileLoadHook := -lc + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libGetNamedModuleTest := -lc endif ifeq ($(OPENJDK_TARGET_OS), linux) BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rw := -z noexecstack BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rwx := -z execstack - BUILD_HOTSPOT_JTREG_EXECUTABLES_LDFLAGS_exeinvoke := -ljvm -lpthread + BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeinvoke := -ljvm -lpthread BUILD_TEST_invoke_exeinvoke.c_OPTIMIZATION := NONE endif From ad85e18f236a6771a29156535f68ad4c19feb804 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Fri, 19 Aug 2016 10:06:30 -0400 Subject: [PATCH 17/99] 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder Reviewed-by: coleenp, gtriantafill, mseledtsov, iignatyev, dholmes, dsamersoff --- .../arguments/BMISupportedCPUTest.java | 4 +- .../arguments/BMIUnsupportedCPUTest.java | 4 +- .../arguments/CheckCICompilerCount.java | 6 +- .../CheckCompileThresholdScaling.java | 6 +- ...TestUseBMI1InstructionsOnSupportedCPU.java | 7 +- ...stUseBMI1InstructionsOnUnsupportedCPU.java | 7 +- ...LeadingZerosInstructionOnSupportedCPU.java | 6 +- ...adingZerosInstructionOnUnsupportedCPU.java | 6 +- ...railingZerosInstructionOnSupportedCPU.java | 6 +- ...ilingZerosInstructionOnUnsupportedCPU.java | 6 +- .../arraycopy/TestArrayCopyNoInitDeopt.java | 7 +- hotspot/test/compiler/c2/PolynomialRoot.java | 2 +- hotspot/test/compiler/c2/Test5057225.java | 4 +- hotspot/test/compiler/c2/Test6603011.java | 4 +- hotspot/test/compiler/c2/Test6800154.java | 4 +- hotspot/test/compiler/c2/Test6805724.java | 4 +- hotspot/test/compiler/c2/Test6857159.java | 8 +- hotspot/test/compiler/c2/Test7068051.java | 6 +- hotspot/test/compiler/c2/Test7177917.java | 4 +- .../test/compiler/c2/cr6589834/Test_ia32.java | 8 +- hotspot/test/compiler/c2/stemmer/Stemmer.java | 2 +- .../CompiledInvokeDynamic2CompiledTest.java | 5 +- ...CompiledInvokeDynamic2InterpretedTest.java | 5 +- .../CompiledInvokeDynamic2NativeTest.java | 5 +- .../CompiledInvokeInterface2CompiledTest.java | 6 +- ...mpiledInvokeInterface2InterpretedTest.java | 6 +- .../CompiledInvokeInterface2NativeTest.java | 6 +- .../CompiledInvokeSpecial2CompiledTest.java | 6 +- ...CompiledInvokeSpecial2InterpretedTest.java | 6 +- .../CompiledInvokeSpecial2NativeTest.java | 6 +- .../CompiledInvokeStatic2CompiledTest.java | 6 +- .../CompiledInvokeStatic2InterpretedTest.java | 6 +- .../CompiledInvokeStatic2NativeTest.java | 6 +- .../CompiledInvokeVirtual2CompiledTest.java | 6 +- ...CompiledInvokeVirtual2InterpretedTest.java | 6 +- .../CompiledInvokeVirtual2NativeTest.java | 6 +- ...InterpretedInvokeDynamic2CompiledTest.java | 5 +- ...erpretedInvokeDynamic2InterpretedTest.java | 5 +- .../InterpretedInvokeDynamic2NativeTest.java | 5 +- ...terpretedInvokeInterface2CompiledTest.java | 6 +- ...pretedInvokeInterface2InterpretedTest.java | 6 +- ...InterpretedInvokeInterface2NativeTest.java | 6 +- ...InterpretedInvokeSpecial2CompiledTest.java | 6 +- ...erpretedInvokeSpecial2InterpretedTest.java | 6 +- .../InterpretedInvokeSpecial2NativeTest.java | 4 +- .../InterpretedInvokeStatic2CompiledTest.java | 6 +- ...terpretedInvokeStatic2InterpretedTest.java | 6 +- .../InterpretedInvokeStatic2NativeTest.java | 6 +- ...InterpretedInvokeVirtual2CompiledTest.java | 6 +- ...erpretedInvokeVirtual2InterpretedTest.java | 6 +- .../InterpretedInvokeVirtual2NativeTest.java | 6 +- .../NativeInvokeSpecial2CompiledTest.java | 6 +- .../NativeInvokeSpecial2InterpretedTest.java | 6 +- .../NativeInvokeSpecial2NativeTest.java | 6 +- .../NativeInvokeStatic2CompiledTest.java | 6 +- .../NativeInvokeStatic2InterpretedTest.java | 6 +- .../NativeInvokeStatic2NativeTest.java | 6 +- .../NativeInvokeVirtual2CompiledTest.java | 6 +- .../NativeInvokeVirtual2InterpretedTest.java | 6 +- .../NativeInvokeVirtual2NativeTest.java | 6 +- .../TestAnonymousClassUnloading.java | 4 +- .../methodUnloading/TestMethodUnloading.java | 6 +- ...kReservedInitialCodeCacheSizeArgOrder.java | 8 +- .../codecache/CheckSegmentedCodeCache.java | 8 +- .../compiler/codecache/CheckUpperLimit.java | 8 +- .../codecache/OverflowCodeCacheTest.java | 6 +- .../cli/TestSegmentedCodeCacheOption.java | 7 +- .../CodeCacheFreeSpaceRunner.java | 4 +- .../cli/codeheapsize/JVMStartupRunner.java | 4 +- .../codeheapsize/TestCodeHeapSizeOptions.java | 5 +- .../printcodecache/PrintCodeCacheRunner.java | 4 +- .../TestPrintCodeCacheOption.java | 5 +- .../dtrace/DtraceResultsAnalyzer.java | 6 +- .../codecache}/dtrace/DtraceRunner.java | 6 +- .../dtrace/SegmentedCodeCacheDtraceTest.java | 10 +- .../compiler/codecache/jmx/BeanTypeTest.java | 6 +- .../jmx/CodeHeapBeanPresenceTest.java | 6 +- .../compiler/codecache/jmx/GetUsageTest.java | 6 +- .../codecache/jmx/InitialAndMaxUsageTest.java | 4 +- .../codecache/jmx/ManagerNamesTest.java | 6 +- .../jmx/MemoryPoolsPresenceTest.java | 6 +- .../compiler/codecache/jmx/PeakUsageTest.java | 4 +- .../codecache/jmx/PoolsIndependenceTest.java | 6 +- .../jmx/ThresholdNotificationsTest.java | 6 +- ...sageThresholdExceededSeveralTimesTest.java | 6 +- .../jmx/UsageThresholdExceededTest.java | 6 +- .../jmx/UsageThresholdIncreasedTest.java | 5 +- .../jmx/UsageThresholdNotExceededTest.java | 4 +- .../stress/CodeCacheStressRunner.java | 4 +- .../compiler/codecache/stress/Helper.java | 4 +- .../stress/OverloadCompileQueueTest.java | 6 +- .../stress/RandomAllocationTest.java | 6 +- .../stress/UnexpectedDeoptimizationTest.java | 6 +- .../test/compiler/codegen/Test6823354.java | 4 +- .../test/compiler/codegen/Test6896617.java | 4 +- .../test/compiler/codegen/Test7100757.java | 4 +- .../compiler/codegen/aes/TestAESMain.java | 4 +- .../compilercontrol/InlineMatcherTest.java | 6 +- ...stCompilerDirectivesCompatibilityBase.java | 10 +- ...ilerDirectivesCompatibilityCommandOff.java | 10 +- ...pilerDirectivesCompatibilityCommandOn.java | 10 +- ...stCompilerDirectivesCompatibilityFlag.java | 10 +- .../commandfile/CompileOnlyTest.java | 11 +- .../commandfile/ExcludeTest.java | 11 +- .../compilercontrol/commandfile/LogTest.java | 11 +- .../commandfile/PrintTest.java | 11 +- .../commands/CompileOnlyTest.java | 11 +- .../compilercontrol/commands/ExcludeTest.java | 11 +- .../compilercontrol/commands/LogTest.java | 11 +- .../compilercontrol/commands/PrintTest.java | 11 +- .../directives/CompileOnlyTest.java | 11 +- .../directives/ExcludeTest.java | 11 +- .../compilercontrol/directives/LogTest.java | 11 +- .../compilercontrol/directives/PrintTest.java | 11 +- .../jcmd/AddAndRemoveTest.java | 11 +- .../jcmd/AddCompileOnlyTest.java | 11 +- .../compilercontrol/jcmd/AddExcludeTest.java | 11 +- .../compilercontrol/jcmd/AddLogTest.java | 11 +- .../jcmd/AddPrintAssemblyTest.java | 11 +- .../jcmd/ClearDirectivesFileStackTest.java | 11 +- .../jcmd/ClearDirectivesStackTest.java | 11 +- .../jcmd/PrintDirectivesTest.java | 11 +- .../jcmd/StressAddJcmdBase.java | 6 +- .../jcmd/StressAddMultiThreadedTest.java | 11 +- .../logcompilation/LogTest.java | 11 +- .../matcher/MethodMatcherTest.java | 8 +- .../mixed/RandomCommandsTest.java | 11 +- .../mixed/RandomValidCommandsTest.java | 11 +- .../parser/DirectiveParserTest.java | 6 +- .../parser/DirectiveStressTest.java | 6 +- .../parser/HugeDirectiveUtil.java | 6 +- .../share/AbstractTestBase.java | 4 +- .../share/actions/BaseAction.java | 6 +- .../share/actions/CompileAction.java | 4 +- .../share/method/MethodDescriptor.java | 4 +- .../share/method/MethodGenerator.java | 6 +- .../share/pool/MethodHolder.java | 4 +- .../share/pool/PoolHelper.java | 4 +- .../share/pool/SubMethodHolder.java | 2 +- .../share/processors/CommandProcessor.java | 4 +- .../share/processors/LogProcessor.java | 4 +- .../processors/PrintDirectivesProcessor.java | 4 +- .../share/processors/PrintProcessor.java | 4 +- .../scenario/AbstractCommandBuilder.java | 4 +- .../share/scenario/DirectiveBuilder.java | 4 +- .../share/scenario/Executor.java | 6 +- .../share/scenario/JcmdStateBuilder.java | 4 +- .../share/scenario/Scenario.java | 6 +- .../test/compiler/cpuflags/RestoreMXCSR.java | 8 +- .../TestAESIntrinsicsOnSupportedConfig.java | 11 +- .../TestAESIntrinsicsOnUnsupportedConfig.java | 11 +- .../compiler/debug/VerifyAdapterSharing.java | 8 +- .../eliminateAutobox/UnsignedLoads.java | 4 +- .../test/compiler/floatingpoint/TestPow2.java | 6 +- .../gcbarriers/PreserveFPRegistersTest.java | 2 +- .../compiler/inlining/InlineAccessors.java | 8 +- .../compiler/interpreter/DisableOSRTest.java | 2 +- .../intrinsics/IntrinsicAvailableTest.java | 4 +- .../intrinsics/IntrinsicDisabledTest.java | 6 +- .../bigInteger/MontgomeryMultiplyTest.java | 6 +- .../intrinsics/bmi/BMITestRunner.java | 6 +- .../compiler/intrinsics/bmi/TestAndnI.java | 8 +- .../compiler/intrinsics/bmi/TestAndnL.java | 6 +- .../compiler/intrinsics/bmi/TestBlsiI.java | 6 +- .../compiler/intrinsics/bmi/TestBlsiL.java | 6 +- .../compiler/intrinsics/bmi/TestBlsmskI.java | 6 +- .../compiler/intrinsics/bmi/TestBlsmskL.java | 6 +- .../compiler/intrinsics/bmi/TestBlsrI.java | 6 +- .../compiler/intrinsics/bmi/TestBlsrL.java | 6 +- .../compiler/intrinsics/bmi/TestLzcntI.java | 6 +- .../compiler/intrinsics/bmi/TestLzcntL.java | 6 +- .../compiler/intrinsics/bmi/TestTzcntI.java | 6 +- .../compiler/intrinsics/bmi/TestTzcntL.java | 6 +- .../intrinsics/bmi/verifycode/AndnTestI.java | 4 +- .../intrinsics/bmi/verifycode/AndnTestL.java | 4 +- .../intrinsics/bmi/verifycode/BlsiTestI.java | 6 +- .../intrinsics/bmi/verifycode/BlsiTestL.java | 6 +- .../bmi/verifycode/BlsmskTestI.java | 6 +- .../bmi/verifycode/BlsmskTestL.java | 6 +- .../intrinsics/bmi/verifycode/BlsrTestI.java | 6 +- .../intrinsics/bmi/verifycode/BlsrTestL.java | 6 +- .../intrinsics/bmi/verifycode/LZcntTestI.java | 6 +- .../intrinsics/bmi/verifycode/LZcntTestL.java | 6 +- .../intrinsics/bmi/verifycode/TZcntTestI.java | 6 +- .../intrinsics/bmi/verifycode/TZcntTestL.java | 6 +- .../klass/CastNullCheckDroppingsTest.java | 8 +- .../mathexact/AddExactIConstantTest.java | 4 +- .../mathexact/AddExactILoadTest.java | 4 +- .../mathexact/AddExactILoopDependentTest.java | 4 +- .../mathexact/AddExactINonConstantTest.java | 4 +- .../mathexact/AddExactIRepeatTest.java | 4 +- .../mathexact/AddExactLConstantTest.java | 4 +- .../mathexact/AddExactLNonConstantTest.java | 4 +- .../intrinsics/mathexact/DecExactITest.java | 4 +- .../intrinsics/mathexact/DecExactLTest.java | 4 +- .../intrinsics/mathexact/IncExactITest.java | 4 +- .../intrinsics/mathexact/IncExactLTest.java | 4 +- .../mathexact/MulExactIConstantTest.java | 4 +- .../mathexact/MulExactILoadTest.java | 4 +- .../mathexact/MulExactILoopDependentTest.java | 4 +- .../mathexact/MulExactINonConstantTest.java | 4 +- .../mathexact/MulExactIRepeatTest.java | 4 +- .../mathexact/MulExactLConstantTest.java | 4 +- .../mathexact/MulExactLNonConstantTest.java | 4 +- .../mathexact/NegExactIConstantTest.java | 4 +- .../mathexact/NegExactILoadTest.java | 4 +- .../mathexact/NegExactILoopDependentTest.java | 4 +- .../mathexact/NegExactINonConstantTest.java | 4 +- .../mathexact/NegExactLConstantTest.java | 4 +- .../mathexact/NegExactLNonConstantTest.java | 4 +- .../mathexact/SubExactICondTest.java | 4 +- .../mathexact/SubExactIConstantTest.java | 4 +- .../mathexact/SubExactILoadTest.java | 4 +- .../mathexact/SubExactILoopDependentTest.java | 4 +- .../mathexact/SubExactINonConstantTest.java | 4 +- .../mathexact/SubExactIRepeatTest.java | 4 +- .../mathexact/SubExactLConstantTest.java | 4 +- .../mathexact/SubExactLNonConstantTest.java | 4 +- .../mathexact/sanity/AddExactIntTest.java | 6 +- .../mathexact/sanity/AddExactLongTest.java | 6 +- .../sanity/DecrementExactIntTest.java | 6 +- .../sanity/DecrementExactLongTest.java | 6 +- .../sanity/IncrementExactIntTest.java | 6 +- .../sanity/IncrementExactLongTest.java | 6 +- .../sanity/MultiplyExactIntTest.java | 6 +- .../sanity/MultiplyExactLongTest.java | 6 +- .../mathexact/sanity/NegateExactIntTest.java | 6 +- .../mathexact/sanity/NegateExactLongTest.java | 6 +- .../sanity/SubtractExactIntTest.java | 6 +- .../sanity/SubtractExactLongTest.java | 6 +- .../compiler/intrinsics/object/TestClone.java | 4 +- ...UseSHA1IntrinsicsOptionOnSupportedCPU.java | 6 +- ...eSHA1IntrinsicsOptionOnUnsupportedCPU.java | 6 +- ...eSHA256IntrinsicsOptionOnSupportedCPU.java | 6 +- ...HA256IntrinsicsOptionOnUnsupportedCPU.java | 6 +- ...eSHA512IntrinsicsOptionOnSupportedCPU.java | 6 +- ...HA512IntrinsicsOptionOnUnsupportedCPU.java | 6 +- .../cli/TestUseSHAOptionOnSupportedCPU.java | 6 +- .../cli/TestUseSHAOptionOnUnsupportedCPU.java | 6 +- .../testcases/GenericTestCaseForOtherCPU.java | 4 +- .../GenericTestCaseForSupportedCPU.java | 4 +- ...nericTestCaseForUnsupportedAArch64CPU.java | 4 +- ...GenericTestCaseForUnsupportedSparcCPU.java | 4 +- .../GenericTestCaseForUnsupportedX86CPU.java | 2 +- ...sicsSpecificTestCaseForUnsupportedCPU.java | 4 +- ...UseSHASpecificTestCaseForSupportedCPU.java | 4 +- ...eSHASpecificTestCaseForUnsupportedCPU.java | 4 +- .../sha/sanity/TestSHA1Intrinsics.java | 7 +- .../sanity/TestSHA1MultiBlockIntrinsics.java | 7 +- .../sha/sanity/TestSHA256Intrinsics.java | 7 +- .../TestSHA256MultiBlockIntrinsics.java | 7 +- .../sha/sanity/TestSHA512Intrinsics.java | 7 +- .../TestSHA512MultiBlockIntrinsics.java | 7 +- .../intrinsics/string/TestHasNegatives.java | 1 - .../string/TestStringIntrinsicMemoryFlow.java | 2 +- .../TestStringIntrinsicRangeChecks.java | 3 +- .../string/TestStringIntrinsics2.java | 2 +- .../unsafe/DirectByteBufferTest.java | 2 +- .../intrinsics/unsafe/HeapByteBufferTest.java | 2 +- .../TestUnsafeMismatchedArrayFieldAccess.java | 4 +- .../jsr292/ConcurrentClassLoadingTest.java | 4 +- .../ContinuousCallSiteTargetChange.java | 6 +- .../test/compiler/jsr292/MHInlineTest.java | 8 +- .../compiler/jsr292/NonInlinedCall/Agent.java | 4 +- .../jsr292/NonInlinedCall/GCTest.java | 4 +- .../jsr292/NonInlinedCall/InvokeTest.java | 5 +- .../jsr292/NonInlinedCall/RedefineTest.java | 2 +- .../compiler/jsr292/PollutedTrapCounts.java | 8 +- .../jvmci/JVM_GetJVMCIRuntimeTest.java | 2 +- .../jvmci/SecurityRestrictionsTest.java | 4 +- .../compilerToVM/AllocateCompileIdTest.java | 10 +- .../compilerToVM/CanInlineMethodTest.java | 8 +- .../compilerToVM/CollectCountersTest.java | 7 +- .../compilerToVM/CompileCodeTestCase.java | 4 +- .../jvmci/compilerToVM/DebugOutputTest.java | 9 +- .../compilerToVM/DisassembleCodeBlobTest.java | 8 +- .../DoNotInlineOrCompileTest.java | 8 +- .../ExecuteInstalledCodeTest.java | 8 +- .../FindUniqueConcreteMethodTest.java | 5 +- .../jvmci/compilerToVM/GetBytecodeTest.java | 5 +- .../compilerToVM/GetClassInitializerTest.java | 5 +- .../compilerToVM/GetConstantPoolTest.java | 5 +- .../compilerToVM/GetExceptionTableTest.java | 5 +- .../compilerToVM/GetImplementorTest.java | 5 +- .../compilerToVM/GetLineNumberTableTest.java | 5 +- .../GetLocalVariableTableTest.java | 5 +- .../GetMaxCallTargetOffsetTest.java | 5 +- .../compilerToVM/GetNextStackFrameTest.java | 5 +- .../GetResolvedJavaMethodAtSlotTest.java | 5 +- .../GetResolvedJavaMethodTest.java | 6 +- .../compilerToVM/GetResolvedJavaTypeTest.java | 7 +- .../GetStackTraceElementTest.java | 5 +- .../jvmci/compilerToVM/GetSymbolTest.java | 5 +- .../GetVtableIndexForInterfaceTest.java | 5 +- .../HasCompiledCodeForOSRTest.java | 8 +- .../HasFinalizableSubclassTest.java | 5 +- .../InitializeConfigurationTest.java | 3 +- .../InvalidateInstalledCodeTest.java | 8 +- .../jvmci/compilerToVM/IsMatureTest.java | 5 +- .../JVM_RegisterJVMCINatives.java | 2 +- .../compilerToVM/LookupKlassInPoolTest.java | 6 +- .../LookupKlassRefIndexInPoolTest.java | 6 +- .../compilerToVM/LookupMethodInPoolTest.java | 6 +- .../LookupNameAndTypeRefIndexInPoolTest.java | 6 +- .../compilerToVM/LookupNameInPoolTest.java | 3 +- .../LookupSignatureInPoolTest.java | 3 +- .../jvmci/compilerToVM/LookupTypeTest.java | 5 +- .../MaterializeVirtualObjectTest.java | 8 +- ...ethodIsIgnoredBySecurityStackWalkTest.java | 5 +- .../jvmci/compilerToVM/ReprofileTest.java | 8 +- .../ResolveConstantInPoolTest.java | 6 +- .../compilerToVM/ResolveFieldInPoolTest.java | 6 +- .../jvmci/compilerToVM/ResolveMethodTest.java | 5 +- ...solvePossiblyCachedConstantInPoolTest.java | 6 +- .../compilerToVM/ResolveTypeInPoolTest.java | 6 +- .../ShouldDebugNonSafepointsTest.java | 5 +- .../compilerToVM/ShouldInlineMethodTest.java | 8 +- .../errors/TestInvalidCompilationResult.java | 1 - ...JvmciNotifyBootstrapFinishedEventTest.java | 6 +- .../events/JvmciNotifyInstallEventTest.java | 12 +- .../jvmci/events/JvmciShutdownEventTest.java | 5 +- .../jdk/vm/ci/code/test/NativeCallTest.java | 2 +- ...HotSpotConstantReflectionProviderTest.java | 2 +- .../test/MemoryAccessProviderTest.java | 2 +- .../test/MethodHandleAccessProviderTest.java | 2 +- .../jdk/vm/ci/runtime/test/ConstantTest.java | 3 +- .../vm/ci/runtime/test/RedefineClassTest.java | 3 +- .../test/TestConstantReflectionProvider.java | 3 +- .../jdk/vm/ci/runtime/test/TestJavaField.java | 3 +- .../vm/ci/runtime/test/TestJavaMethod.java | 3 +- .../jdk/vm/ci/runtime/test/TestJavaType.java | 3 +- .../runtime/test/TestMetaAccessProvider.java | 3 +- .../runtime/test/TestResolvedJavaField.java | 3 +- .../runtime/test/TestResolvedJavaMethod.java | 3 +- .../ci/runtime/test/TestResolvedJavaType.java | 1 - .../compiler/jvmci/meta/StableFieldTest.java | 2 +- .../loopopts/UseCountedLoopSafepoints.java | 8 +- .../TestVectorizationWithInvariant.java | 4 +- .../compiler/onSpinWait/TestOnSpinWait.java | 8 +- .../oracle/CheckCompileCommandOption.java | 8 +- .../compiler/oracle/GetMethodOptionTest.java | 6 +- .../compiler/oracle/MethodMatcherTest.java | 4 +- .../compiler/oracle/TestCompileCommand.java | 8 +- .../print/TestProfileReturnTypePrinting.java | 3 +- .../spectrapredefineclass/Launcher.java | 4 +- .../Launcher.java | 4 +- .../rangechecks/TestExplicitRangeChecks.java | 5 +- .../rangechecks/TestRangeCheckSmearing.java | 6 +- .../cli/RTMGenericCommandLineOptionTest.java | 2 +- .../compiler/rtm/cli/RTMLockingAwareTest.java | 4 +- ...tPrintPreciseRTMLockingStatisticsBase.java | 4 +- ...kingStatisticsOptionOnSupportedConfig.java | 6 +- ...ngStatisticsOptionOnUnsupportedConfig.java | 4 +- ...tRTMAbortRatioOptionOnSupportedConfig.java | 6 +- ...TMAbortRatioOptionOnUnsupportedConfig.java | 6 +- .../rtm/cli/TestRTMAbortThresholdOption.java | 5 +- .../TestRTMLockingCalculationDelayOption.java | 5 +- .../cli/TestRTMLockingThresholdOption.java | 5 +- .../rtm/cli/TestRTMRetryCountOption.java | 5 +- .../rtm/cli/TestRTMSpinLoopCountOption.java | 5 +- ...lCountIncrRateOptionOnSupportedConfig.java | 6 +- ...ountIncrRateOptionOnUnsupportedConfig.java | 6 +- ...estUseRTMDeoptOptionOnSupportedConfig.java | 8 +- ...tUseRTMDeoptOptionOnUnsupportedConfig.java | 6 +- ...MForStackLocksOptionOnSupportedConfig.java | 8 +- ...orStackLocksOptionOnUnsupportedConfig.java | 8 +- ...tUseRTMLockingOptionOnSupportedConfig.java | 8 +- ...stUseRTMLockingOptionOnUnsupportedCPU.java | 8 +- ...estUseRTMLockingOptionOnUnsupportedVM.java | 8 +- ...tUseRTMLockingOptionWithBiasedLocking.java | 8 +- .../cli/TestUseRTMXendForLockBusyOption.java | 5 +- .../rtm/locking/TestRTMAbortRatio.java | 8 +- .../rtm/locking/TestRTMAbortThreshold.java | 8 +- .../rtm/locking/TestRTMAfterNonRTMDeopt.java | 8 +- .../locking/TestRTMDeoptOnHighAbortRatio.java | 8 +- .../locking/TestRTMDeoptOnLowAbortRatio.java | 8 +- .../TestRTMLockingCalculationDelay.java | 8 +- .../rtm/locking/TestRTMLockingThreshold.java | 8 +- .../rtm/locking/TestRTMRetryCount.java | 8 +- .../rtm/locking/TestRTMSpinLoopCount.java | 8 +- .../locking/TestRTMTotalCountIncrRate.java | 8 +- .../locking/TestUseRTMAfterLockInflation.java | 8 +- .../compiler/rtm/locking/TestUseRTMDeopt.java | 8 +- .../locking/TestUseRTMForInflatedLocks.java | 8 +- .../rtm/locking/TestUseRTMForStackLocks.java | 8 +- .../locking/TestUseRTMXendForLockBusy.java | 8 +- .../TestNoRTMLockElidingOption.java | 8 +- .../TestUseRTMLockElidingOption.java | 8 +- .../TestPrintPreciseRTMLockingStatistics.java | 8 +- .../test/compiler/runtime/Test8010927.java | 6 +- .../runtime/cr8015436/Test8015436.java | 3 +- .../compiler/stable/TestStableBoolean.java | 3 +- .../test/compiler/stable/TestStableByte.java | 3 +- .../test/compiler/stable/TestStableChar.java | 3 +- .../compiler/stable/TestStableDouble.java | 3 +- .../test/compiler/stable/TestStableFloat.java | 3 +- .../test/compiler/stable/TestStableInt.java | 3 +- .../test/compiler/stable/TestStableLong.java | 3 +- .../compiler/stable/TestStableObject.java | 3 +- .../test/compiler/stable/TestStableShort.java | 3 +- .../test/compiler/stable/TestStableUByte.java | 3 +- .../compiler/stable/TestStableUShort.java | 3 +- .../startup/NumCompilerThreadsCheck.java | 8 +- .../startup/SmallCodeCacheStartup.java | 8 +- .../test/compiler/startup/StartupOutput.java | 8 +- .../compiler/testlibrary/rtm/RTMTestBase.java | 6 +- .../ConstantGettersTransitionsTest.java | 6 +- .../compiler/tiered/LevelTransitionTest.java | 6 +- .../compiler/tiered/NonTieredLevelsTest.java | 6 +- .../compiler/tiered/TieredLevelsTest.java | 6 +- .../tiered/TransitionsTestExecutor.java | 6 +- .../TestMeetIncompatibleInterfaceArrays.java | 2 +- .../types/correctness/CorrectnessTest.java | 6 +- .../compiler/types/correctness/OffTest.java | 10 +- .../uncommontrap/DeoptReallocFailure.java | 2 +- .../compiler/uncommontrap/Test8009761.java | 6 +- .../uncommontrap/TestUnstableIfTrap.java | 8 +- .../unsafe/UnsafeGetConstantField.java | 2 +- .../unsafe/UnsafeGetStableArrayElement.java | 2 +- hotspot/test/compiler/unsafe/UnsafeRaw.java | 4 +- .../whitebox/AllocationCodeBlobTest.java | 8 +- .../whitebox/BlockingCompilation.java | 3 +- .../whitebox/ClearMethodStateTest.java | 6 +- .../compiler/whitebox/DeoptimizeAllTest.java | 6 +- .../whitebox/DeoptimizeFramesTest.java | 6 +- .../whitebox/DeoptimizeMethodTest.java | 6 +- .../whitebox/DeoptimizeMultipleOSRTest.java | 6 +- .../EnqueueMethodForCompilationTest.java | 6 +- .../whitebox/ForceNMethodSweepTest.java | 6 +- .../whitebox/GetCodeHeapEntriesTest.java | 6 +- .../compiler/whitebox/GetNMethodTest.java | 6 +- .../whitebox/IsMethodCompilableTest.java | 9 +- .../whitebox/LockCompilationTest.java | 6 +- .../whitebox/MakeMethodNotCompilableTest.java | 6 +- .../whitebox/SetDontInlineMethodTest.java | 6 +- .../whitebox/SetForceInlineMethodTest.java | 6 +- hotspot/test/gc/CondCardMark/Basic.java | 4 +- hotspot/test/gc/TestCardTablePageCommits.java | 6 +- hotspot/test/gc/TestDisableExplicitGC.java | 2 +- hotspot/test/gc/TestObjectAlignment.java | 8 +- hotspot/test/gc/TestSmallHeap.java | 4 +- .../gc/TestSoftReferencesBehaviorOnOOME.java | 5 +- hotspot/test/gc/TestVerifyDuringStartup.java | 8 +- hotspot/test/gc/TestVerifySilently.java | 6 +- hotspot/test/gc/TestVerifySubSet.java | 6 +- .../arguments}/AllocationHelper.java | 4 +- .../arguments}/HeapRegionUsageTool.java | 4 +- .../TestArrayAllocatorMallocLimit.java | 8 +- .../gc/arguments/TestCMSHeapSizeFlags.java | 4 +- .../arguments/TestCompressedClassFlags.java | 8 +- .../gc/arguments/TestDisableDefaultGC.java | 6 +- .../gc/arguments/TestDynMaxHeapFreeRatio.java | 4 +- .../gc/arguments/TestDynMinHeapFreeRatio.java | 4 +- .../TestG1ConcMarkStepDurationMillis.java | 5 +- .../TestG1ConcRefinementThreads.java | 5 +- .../gc/arguments/TestG1HeapRegionSize.java | 5 +- .../gc/arguments/TestG1HeapSizeFlags.java | 4 +- .../gc/arguments/TestG1PercentageOptions.java | 5 +- .../test/gc/arguments/TestHeapFreeRatio.java | 7 +- .../TestInitialTenuringThreshold.java | 5 +- .../gc/arguments/TestMaxHeapSizeTools.java | 3 +- .../TestMaxMinHeapFreeRatioFlags.java | 8 +- hotspot/test/gc/arguments/TestMaxNewSize.java | 8 +- .../TestMinAndInitialSurvivorRatioFlags.java | 12 +- .../arguments/TestMinInitialErgonomics.java | 6 +- .../test/gc/arguments/TestNewRatioFlag.java | 11 +- .../test/gc/arguments/TestNewSizeFlags.java | 10 +- .../arguments/TestNewSizeThreadIncrease.java | 7 +- .../gc/arguments/TestObjectTenuringFlags.java | 6 +- .../gc/arguments/TestParallelGCThreads.java | 8 +- .../arguments/TestParallelHeapSizeFlags.java | 4 +- .../gc/arguments/TestSelectDefaultGC.java | 7 +- .../gc/arguments/TestSerialHeapSizeFlags.java | 6 +- .../gc/arguments/TestShrinkHeapInSteps.java | 3 +- .../TestSurvivorAlignmentInBytesOption.java | 6 +- .../gc/arguments/TestSurvivorRatioFlag.java | 12 +- .../TestTargetSurvivorRatioFlag.java | 10 +- .../TestUnrecognizedVMOptionsHandling.java | 7 +- .../arguments/TestUseCompressedOopsErgo.java | 6 +- .../TestUseCompressedOopsErgoTools.java | 4 +- .../gc/arguments/TestUseNUMAInterleaving.java | 8 +- .../TestVerifyBeforeAndAfterGCFlags.java | 8 +- .../TestCMSClassUnloadingEnabledHWM.java | 10 +- .../TestG1ClassUnloadingHWM.java | 10 +- hotspot/test/gc/cms/GuardShrinkWarning.java | 7 +- .../TestDynamicNumberOfGCThreads.java | 6 +- .../TestInitialGCThreadLogging.java | 6 +- hotspot/test/gc/g1/Test2GbHeap.java | 6 +- .../g1/TestEagerReclaimHumongousRegions.java | 8 +- ...rReclaimHumongousRegionsClearMarkBits.java | 8 +- ...tEagerReclaimHumongousRegionsWithRefs.java | 8 +- ...stG1TraceEagerReclaimHumongousObjects.java | 6 +- hotspot/test/gc/g1/TestGCLogMessages.java | 6 +- .../gc/g1/TestHumongousAllocInitialMark.java | 7 +- .../TestHumongousAllocNearlyFullRegion.java | 7 +- .../gc/g1/TestHumongousCodeCacheRoots.java | 9 +- .../test/gc/g1/TestHumongousShrinkHeap.java | 2 +- .../gc/g1/TestLargePageUseForAuxMemory.java | 9 +- .../TestNoEagerReclaimOfHumongousRegions.java | 4 +- hotspot/test/gc/g1/TestPLABOutput.java | 6 +- hotspot/test/gc/g1/TestPLABSizeBounds.java | 6 +- .../g1/TestPrintRegionRememberedSetInfo.java | 7 +- .../test/gc/g1/TestRegionLivenessPrint.java | 4 +- hotspot/test/gc/g1/TestRemsetLogging.java | 4 +- .../gc/g1/TestRemsetLoggingPerRegion.java | 4 +- .../test/gc/g1/TestRemsetLoggingThreads.java | 6 +- .../test/gc/g1/TestRemsetLoggingTools.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData.java | 4 +- .../test/gc/g1/TestShrinkAuxiliaryData00.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData05.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData10.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData15.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData20.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData25.java | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData30.java | 5 +- .../gc/g1/TestShrinkDefragmentedHeap.java | 8 +- .../TestStringDeduplicationAgeThreshold.java | 4 +- .../gc/g1/TestStringDeduplicationFullGC.java | 4 +- .../g1/TestStringDeduplicationInterned.java | 4 +- .../TestStringDeduplicationPrintOptions.java | 4 +- .../TestStringDeduplicationTableRehash.java | 4 +- .../TestStringDeduplicationTableResize.java | 4 +- .../gc/g1/TestStringDeduplicationTools.java | 5 +- .../gc/g1/TestStringDeduplicationYoungGC.java | 4 +- .../gc/g1/TestStringSymbolTableStats.java | 8 +- .../g1/humongousObjects/TestHeapCounters.java | 4 +- .../TestHumongousClassLoader.java | 7 +- .../TestHumongousMovement.java | 4 +- .../TestHumongousNonArrayAllocation.java | 6 +- .../TestHumongousThreshold.java | 4 +- .../TestNoAllocationsInHRegions.java | 5 +- .../humongousObjects/TestObjectCollected.java | 5 +- .../TestObjectGraphAfterGC.java | 11 +- hotspot/test/gc/g1/ihop/TestIHOPErgo.java | 8 +- hotspot/test/gc/g1/ihop/TestIHOPStatic.java | 8 +- hotspot/test/gc/g1/ihop/lib/IhopUtils.java | 2 +- hotspot/test/gc/g1/mixedgc/TestLogging.java | 8 +- .../gc/g1/plab/TestPLABEvacuationFailure.java | 8 +- .../test/gc/g1/plab/TestPLABPromotion.java | 12 +- hotspot/test/gc/g1/plab/TestPLABResize.java | 13 +- hotspot/test/gc/g1/plab/lib/PLABUtils.java | 2 +- .../gc/logging/TestDeprecatedPrintFlags.java | 5 +- hotspot/test/gc/logging/TestGCId.java | 6 +- .../test/gc/logging/TestPrintReferences.java | 8 +- .../TestUnifiedLoggingSwitchStress.java | 2 +- .../CompressedClassSpaceSizeInJmapHeap.java | 9 +- .../lib => gc/metaspace}/InputArguments.java | 4 +- hotspot/test/gc/metaspace/PerfCounters.java | 4 +- .../TestCapacityUntilGCWrapAround.java | 6 +- .../gc/metaspace/TestMetaspaceCMSCancel.java | 4 +- .../TestMetaspaceInitialization.java | 1 - .../gc/metaspace/TestMetaspaceMemoryPool.java | 8 +- .../metaspace/TestMetaspacePerfCounters.java | 9 +- .../gc/metaspace/TestMetaspaceSizeFlags.java | 6 +- .../TestPerfCountersAndMemoryPools.java | 4 +- .../test/gc/parallel/AdaptiveGCBoundary.java | 7 +- .../test/gc/parallel/TestDynShrinkHeap.java | 2 +- .../parallel/TestPrintGCDetailsVerbose.java | 1 - hotspot/test/gc/serial/HeapChangeLogging.java | 8 +- hotspot/test/gc/startup_warnings/TestCMS.java | 8 +- .../gc/startup_warnings/TestDefNewCMS.java | 8 +- hotspot/test/gc/startup_warnings/TestG1.java | 8 +- .../gc/startup_warnings/TestParNewCMS.java | 8 +- .../startup_warnings/TestParNewSerialOld.java | 8 +- .../gc/startup_warnings/TestParallelGC.java | 8 +- .../TestParallelScavengeSerialOld.java | 8 +- .../gc/startup_warnings/TestSerialGC.java | 8 +- .../gc/stress/TestMultiThreadStressRSet.java | 2 +- .../gc/stress/TestStressRSetCoarsening.java | 2 +- .../TestAllocationInEden.java | 6 +- .../TestPromotionFromEdenToTenured.java | 7 +- ...otionFromSurvivorToTenuredAfterFullGC.java | 7 +- ...tionFromSurvivorToTenuredAfterMinorGC.java | 7 +- .../TestPromotionToSurvivor.java | 7 +- hotspot/test/gc/testlibrary/Helpers.java | 2 +- .../test/gc/whitebox/TestConcMarkCycleWB.java | 4 +- hotspot/test/gc/whitebox/TestWBGC.java | 10 +- hotspot/test/native/GTestWrapper.java | 2 +- .../8026365/InvokeSpecialAnonTest.java | 4 +- .../BadObjectClass/BootstrapRedefine.java | 6 +- .../BoolReturn/NativeSmallIntCallsTest.java | 2 +- .../BootClassPathAppend.java | 5 +- .../BootClassPathAppendProp.java | 1 - .../CDSCompressedKPtrs.java | 8 +- .../CDSCompressedKPtrsError.java | 8 +- .../CDSCompressedKPtrs/XShareAuto.java | 8 +- .../test/runtime/ClassFile/JsrRewriting.java | 9 +- .../ClassFile/OomWhileParsingRepeatedJsr.java | 10 +- .../UnsupportedClassFileVersion.java | 7 +- .../runtime/ClassUnload/KeepAliveClass.java | 7 +- .../ClassUnload/KeepAliveClassLoader.java | 7 +- .../runtime/ClassUnload/KeepAliveObject.java | 7 +- .../ClassUnload/KeepAliveSoftReference.java | 7 +- .../test/runtime/ClassUnload/UnloadTest.java | 7 +- .../BooleanFlagWithInvalidValue.java | 7 +- .../CompilerConfigFileWarning.java | 8 +- .../CommandLine/ConfigFileParsing.java | 7 +- .../CommandLine/ConfigFileWarning.java | 8 +- .../CommandLine/FlagWithInvalidValue.java | 7 +- .../IgnoreUnrecognizedVMOptions.java | 8 +- ...onBooleanFlagWithInvalidBooleanPrefix.java | 7 +- .../CommandLine/ObsoleteFlagErrorMessage.java | 5 +- .../OptionsValidation/TestJcmdOutput.java | 8 +- .../TestOptionsWithRanges.java | 3 +- .../TestOptionsWithRangesDynamic.java | 4 +- .../common/optionsvalidation/JVMOption.java | 4 +- .../optionsvalidation/JVMOptionsUtils.java | 4 +- .../CommandLine/PrintTouchedMethods.java | 8 +- .../runtime/CommandLine/TestHexArguments.java | 7 +- .../TestLongUnrecognizedVMOption.java | 8 +- .../CommandLine/TestNullTerminatedFlags.java | 7 +- .../runtime/CommandLine/TestVMOptions.java | 7 +- .../CommandLine/TraceExceptionsTest.java | 5 +- .../CommandLine/UnrecognizedVMOption.java | 7 +- .../runtime/CommandLine/VMAliasOptions.java | 7 +- .../CommandLine/VMDeprecatedOptions.java | 5 +- .../runtime/CommandLine/VMOptionWarning.java | 8 +- .../VMOptionsFile/TestVMOptionsFile.java | 8 +- .../CompressedClassPointers.java | 6 +- .../CompressedClassSpaceSize.java | 8 +- .../CompressedKlassPointerAndOops.java | 8 +- .../CompressedOops/ObjectAlignment.java | 9 +- .../CompressedOops/UseCompressedOops.java | 6 +- .../ConstantPool/BadMethodHandles.java | 1 - .../test/runtime/ConstantPool/IntfMethod.java | 1 - .../EnclosingMethodAttr/EnclMethodAttr.java | 7 +- .../ErrorHandling/CreateCoredumpOnCrash.java | 10 +- .../runtime/ErrorHandling/ErrorHandler.java | 8 +- .../ErrorHandling/ProblematicFrameTest.java | 8 +- .../SafeFetchInErrorHandlingTest.java | 8 +- .../ErrorHandling/SecondaryErrorTest.java | 8 +- .../TestCrashOnOutOfMemoryError.java | 9 +- .../TestExitOnOutOfMemoryError.java | 9 +- .../runtime/ErrorHandling/TestOnError.java | 9 +- .../ErrorHandling/TestOnOutOfMemoryError.java | 8 +- hotspot/test/runtime/Final/TestPutMain.java | 2 +- .../runtime/LoadClass/LoadClassNegative.java | 8 +- .../runtime/LocalVariableTable/TestLVT.java | 7 +- .../runtime/Metaspace/FragmentMetaspace.java | 3 +- hotspot/test/runtime/NMT/AutoshutdownNMT.java | 7 +- .../runtime/NMT/BaselineWithParameter.java | 8 +- .../test/runtime/NMT/ChangeTrackingLevel.java | 7 +- .../NMT/CheckForProperDetailStackTrace.java | 6 +- .../test/runtime/NMT/CommandLineDetail.java | 7 +- .../runtime/NMT/CommandLineEmptyArgument.java | 7 +- .../NMT/CommandLineInvalidArgument.java | 7 +- .../test/runtime/NMT/CommandLineSummary.java | 7 +- .../runtime/NMT/CommandLineTurnOffNMT.java | 7 +- .../runtime/NMT/CommitOverlappingRegions.java | 8 +- .../test/runtime/NMT/JcmdBaselineDetail.java | 8 +- hotspot/test/runtime/NMT/JcmdDetailDiff.java | 10 +- hotspot/test/runtime/NMT/JcmdScale.java | 8 +- hotspot/test/runtime/NMT/JcmdScaleDetail.java | 8 +- hotspot/test/runtime/NMT/JcmdSummaryDiff.java | 10 +- .../test/runtime/NMT/JcmdWithNMTDisabled.java | 8 +- .../runtime/NMT/MallocRoundingReportTest.java | 10 +- .../runtime/NMT/MallocSiteHashOverflow.java | 10 +- .../test/runtime/NMT/MallocStressTest.java | 11 +- hotspot/test/runtime/NMT/MallocTestType.java | 10 +- .../runtime/NMT/MallocTrackingVerify.java | 10 +- hotspot/test/runtime/NMT/NMTWithCDS.java | 7 +- .../test/runtime/NMT/PrintNMTStatistics.java | 5 +- .../PrintNMTStatisticsWithNMTDisabled.java | 7 +- .../runtime/NMT/ReleaseCommittedMemory.java | 6 +- hotspot/test/runtime/NMT/ReleaseNoCommit.java | 10 +- hotspot/test/runtime/NMT/ShutdownTwice.java | 8 +- .../runtime/NMT/SummaryAfterShutdown.java | 8 +- .../test/runtime/NMT/SummarySanityCheck.java | 10 +- .../runtime/NMT/ThreadedMallocTestType.java | 10 +- .../NMT/ThreadedVirtualAllocTestType.java | 10 +- .../VirtualAllocCommitUncommitRecommit.java | 10 +- .../runtime/NMT/VirtualAllocTestType.java | 10 +- .../PerfMemDestroy/PerfMemDestroy.java | 7 +- .../RedefineObject/TestRedefineObject.java | 9 +- .../RedefineTests/RedefineAnnotations.java | 2 +- .../RedefineTests/RedefineFinalizer.java | 5 +- .../RedefineTests/RedefineRunningMethods.java | 5 +- .../RedefineRunningMethodsWithBacktrace.java | 5 +- ...ineRunningMethodsWithResolutionErrors.java | 3 +- .../ReservedStack/ReservedStackTest.java | 3 +- .../ReservedStackTestCompiler.java | 3 +- .../AssertSafepointCheckConsistency1.java | 10 +- .../AssertSafepointCheckConsistency2.java | 10 +- .../AssertSafepointCheckConsistency3.java | 10 +- .../AssertSafepointCheckConsistency4.java | 10 +- .../test/runtime/SameObject/SameObject.java | 4 +- .../AbstractMethodErrorTest.java | 1 - .../IllegalAccessErrorTest.java | 1 - .../InvokeInterfaceICCE.java | 1 - .../InvokeInterfaceSuccessTest.java | 1 - .../InvokeSpecialICCE.java | 1 - .../InvokeSpecialSuccessTest.java | 1 - .../SelectionResolution/InvokeStaticICCE.java | 1 - .../InvokeStaticSuccessTest.java | 1 - .../InvokeVirtualICCE.java | 1 - .../InvokeVirtualSuccessTest.java | 1 - .../NoSuchMethodErrorTest.java | 1 - .../ArchiveDoesNotExist.java | 7 +- .../SharedArchiveFile/BootAppendTests.java | 8 +- .../CdsDifferentCompactStrings.java | 7 +- .../CdsDifferentObjectAlignment.java | 8 +- .../CdsSameObjectAlignment.java | 8 +- .../DefaultUseWithClient.java | 8 +- .../DumpSymbolAndStringTable.java | 8 +- .../SharedArchiveFile/LimitSharedSizes.java | 6 +- .../SharedArchiveFile/MaxMetaspaceSize.java | 7 +- .../PrintSharedArchiveAndExit.java | 7 +- .../SharedArchiveFile/SASymbolTableTest.java | 9 +- .../SharedArchiveFile/SharedArchiveFile.java | 7 +- .../SharedArchiveFile/SharedBaseAddress.java | 5 +- .../SharedArchiveFile/SharedStrings.java | 7 +- .../SharedArchiveFile/SharedStringsDedup.java | 5 +- .../SharedStringsRunAuto.java | 5 +- .../SharedSymbolTableBucketSize.java | 7 +- .../SpaceUtilizationCheck.java | 7 +- hotspot/test/runtime/Thread/Fibonacci.java | 4 +- .../TestThreadDumpMonitorContention.java | 8 +- .../test/runtime/Thread/ThreadPriorities.java | 8 +- .../ThreadSignalMask/ThreadSignalMask.java | 4 +- .../runtime/Throwable/StackTraceLogging.java | 7 +- .../test/runtime/Throwable/TestThrowable.java | 2 +- .../ThrowableIntrospectionSegfault.java | 1 - .../test/runtime/Unsafe/AllocateInstance.java | 6 +- .../test/runtime/Unsafe/AllocateMemory.java | 4 +- hotspot/test/runtime/Unsafe/CopyMemory.java | 6 +- hotspot/test/runtime/Unsafe/DefineClass.java | 7 +- hotspot/test/runtime/Unsafe/FieldOffset.java | 6 +- hotspot/test/runtime/Unsafe/GetField.java | 6 +- .../test/runtime/Unsafe/GetPutAddress.java | 7 +- .../test/runtime/Unsafe/GetPutBoolean.java | 6 +- hotspot/test/runtime/Unsafe/GetPutByte.java | 6 +- hotspot/test/runtime/Unsafe/GetPutChar.java | 6 +- hotspot/test/runtime/Unsafe/GetPutDouble.java | 6 +- hotspot/test/runtime/Unsafe/GetPutFloat.java | 6 +- hotspot/test/runtime/Unsafe/GetPutInt.java | 6 +- hotspot/test/runtime/Unsafe/GetPutLong.java | 6 +- hotspot/test/runtime/Unsafe/GetPutObject.java | 6 +- hotspot/test/runtime/Unsafe/GetPutShort.java | 6 +- .../runtime/Unsafe/GetUncompressedObject.java | 7 +- hotspot/test/runtime/Unsafe/NestedUnsafe.java | 5 +- hotspot/test/runtime/Unsafe/PageSize.java | 6 +- .../runtime/Unsafe/PrimitiveHostClass.java | 1 - hotspot/test/runtime/Unsafe/RangeCheck.java | 8 +- hotspot/test/runtime/Unsafe/Reallocate.java | 4 +- hotspot/test/runtime/Unsafe/SetMemory.java | 6 +- .../test/runtime/Unsafe/ThrowException.java | 6 +- .../runtime/XCheckJniJsig/XCheckJSig.java | 8 +- .../ClassFileParserBug.java | 7 +- .../TestEmptyBootstrapMethodsAttr.java | 8 +- hotspot/test/runtime/contended/Options.java | 7 +- .../duplAttributes/DuplAttributesTest.java | 7 +- .../test/runtime/execstack/Testexecstack.java | 7 +- .../runtime/getSysPackage/GetSysPkgTest.java | 6 +- hotspot/test/runtime/interned/SanityTest.java | 6 +- .../ToStringInInterfaceTest/ToStringTest.java | 5 +- .../Testlibadimalloc.java | 7 +- .../runtime/logging/BiasedLockingTest.java | 7 +- .../logging/ClassInitializationTest.java | 7 +- .../runtime/logging/ClassLoadUnloadTest.java | 7 +- .../runtime/logging/ClassResolutionTest.java | 7 +- .../runtime/logging/CompressedOopsTest.java | 7 +- .../runtime/logging/DefaultMethodsTest.java | 7 +- .../test/runtime/logging/ExceptionsTest.java | 7 +- hotspot/test/runtime/logging/ItablesTest.java | 6 +- .../logging/LoaderConstraintsTest.java | 7 +- hotspot/test/runtime/logging/ModulesTest.java | 9 +- .../runtime/logging/MonitorInflationTest.java | 7 +- .../runtime/logging/MonitorMismatchTest.java | 7 +- .../runtime/logging/OsCpuLoggingTest.java | 7 +- .../ProtectionDomainVerificationTest.java | 7 +- .../logging/RemovedDevelopFlagsTest.java | 7 +- .../runtime/logging/SafepointCleanupTest.java | 7 +- .../test/runtime/logging/SafepointTest.java | 7 +- .../test/runtime/logging/StartupTimeTest.java | 7 +- .../runtime/logging/ThreadLoggingTest.java | 7 +- .../test/runtime/logging/VMOperationTest.java | 7 +- .../runtime/logging/VerificationTest.java | 7 +- hotspot/test/runtime/logging/VtablesTest.java | 6 +- .../LargePages/TestLargePageSizeInBytes.java | 8 +- .../LargePages/TestLargePagesFlags.java | 8 +- .../runtime/memory/ReadFromNoaccessArea.java | 10 +- .../test/runtime/memory/ReadVMPageSize.java | 7 +- .../test/runtime/memory/ReserveMemory.java | 9 +- .../memory/RunUnitTestsConcurrently.java | 8 +- .../memory/StressVirtualSpaceResize.java | 6 +- .../test/runtime/modules/AccModuleTest.java | 5 +- .../modules/AccessCheck/CheckRead.java | 3 +- .../modules/AccessCheck/DiffCL_CheckRead.java | 3 +- .../AccessCheck/DiffCL_ExpQualOther.java | 3 +- .../AccessCheck/DiffCL_ExpQualToM1.java | 3 +- .../modules/AccessCheck/DiffCL_ExpUnqual.java | 3 +- .../modules/AccessCheck/DiffCL_PkgNotExp.java | 3 +- .../modules/AccessCheck/DiffCL_Umod.java | 3 +- .../modules/AccessCheck/DiffCL_UmodUpkg.java | 3 +- .../modules/AccessCheck/ExpQualOther.java | 3 +- .../modules/AccessCheck/ExpQualToM1.java | 3 +- .../modules/AccessCheck/ExpUnqual.java | 3 +- .../modules/AccessCheck/ExportAllUnnamed.java | 3 +- .../modules/AccessCheck/PkgNotExp.java | 3 +- .../runtime/modules/AccessCheck/Umod.java | 3 +- .../AccessCheck/UmodDiffCL_ExpQualOther.java | 3 +- .../AccessCheck/UmodDiffCL_ExpUnqual.java | 3 +- .../AccessCheck/UmodDiffCL_PkgNotExp.java | 3 +- .../modules/AccessCheck/UmodDiffCL_Umod.java | 3 +- .../AccessCheck/UmodDiffCL_UmodUpkg.java | 3 +- .../runtime/modules/AccessCheck/UmodUPkg.java | 3 +- .../UmodUpkgDiffCL_ExpQualOther.java | 3 +- .../AccessCheck/UmodUpkgDiffCL_NotExp.java | 3 +- .../AccessCheck/UmodUpkgDiffCL_Umod.java | 3 +- .../AccessCheck/UmodUpkg_ExpQualOther.java | 3 +- .../modules/AccessCheck/UmodUpkg_NotExp.java | 3 +- .../modules/AccessCheck/UmodUpkg_Umod.java | 3 +- .../AccessCheck/Umod_ExpQualOther.java | 3 +- .../modules/AccessCheck/Umod_ExpUnqual.java | 3 +- .../modules/AccessCheck/Umod_PkgNotExp.java | 3 +- .../modules/AccessCheck/Umod_UmodUpkg.java | 3 +- .../modules/AccessCheckAllUnnamed.java | 2 +- .../test/runtime/modules/AccessCheckExp.java | 2 +- .../runtime/modules/AccessCheckJavaBase.java | 2 +- .../test/runtime/modules/AccessCheckRead.java | 3 +- .../runtime/modules/AccessCheckSuper.java | 2 +- .../runtime/modules/AccessCheckUnnamed.java | 2 +- .../runtime/modules/AccessCheckWorks.java | 2 +- hotspot/test/runtime/modules/ExportTwice.java | 2 +- .../modules/IgnoreModulePropertiesTest.java | 5 +- .../JVMAddModuleExportToAllUnnamed.java | 2 +- .../runtime/modules/JVMAddModuleExports.java | 2 +- .../modules/JVMAddModuleExportsToAll.java | 2 +- .../runtime/modules/JVMAddModulePackage.java | 2 +- .../runtime/modules/JVMAddReadsModule.java | 2 +- .../runtime/modules/JVMCanReadModule.java | 2 +- .../test/runtime/modules/JVMDefineModule.java | 2 +- .../modules/JVMGetModuleByPkgName.java | 2 +- .../modules/JVMIsExportedToModule.java | 2 +- .../modules/LoadUnloadModuleStress.java | 2 +- .../runtime/modules/ModuleOptionsTest.java | 5 +- .../runtime/modules/ModuleOptionsWarn.java | 5 +- .../ModuleStress/ExportModuleStressTest.java | 6 +- .../modules/ModuleStress/ModuleStress.java | 7 +- .../modules/ModuleStress/ModuleStressGC.java | 6 +- .../modules/PatchModule/BasicJarBuilder.java | 2 - .../modules/PatchModule/PatchModule2Dirs.java | 6 +- .../modules/PatchModule/PatchModuleCDS.java | 5 +- .../PatchModule/PatchModuleDupJavaBase.java | 5 +- .../PatchModule/PatchModuleDupModule.java | 5 +- .../PatchModule/PatchModuleJavaBase.java | 6 +- .../modules/PatchModule/PatchModuleTest.java | 6 +- .../PatchModule/PatchModuleTestJar.java | 7 +- .../PatchModule/PatchModuleTestJarDir.java | 7 +- .../PatchModule/PatchModuleTraceCL.java | 6 +- .../Visibility/PatchModuleVisibility.java | 6 +- .../Visibility/XbootcpNoVisibility.java | 8 +- .../modules/Visibility/XbootcpVisibility.java | 8 +- .../test/runtime/os/AvailableProcessors.java | 7 +- .../test/runtime/verifier/OverriderMsg.java | 7 +- .../test/runtime/verifier/TestANewArray.java | 7 +- .../runtime/verifier/TestMultiANewArray.java | 7 +- .../test/runtime/verifier/TraceClassRes.java | 5 +- .../test/runtime/whitebox/WBStackSize.java | 6 +- .../sanity/MismatchedWhiteBox/WhiteBox.java | 4 +- hotspot/test/sanity/WBApi.java | 6 +- hotspot/test/serviceability/ParserTest.java | 6 +- .../attach/AttachSetGetFlag.java | 5 +- .../attach/AttachWithStalePidFile.java | 6 +- .../dcmd/compiler/CodeCacheTest.java | 8 +- .../dcmd/compiler/CodelistTest.java | 9 +- .../compiler/CompilerDirectivesDCMDTest.java | 9 +- .../dcmd/compiler/CompilerQueueTest.java | 11 +- .../dcmd/framework/HelpTest.java | 8 +- .../dcmd/framework/InvalidCommandTest.java | 8 +- .../dcmd/framework/VMVersionTest.java | 8 +- .../dcmd/gc/ClassHistogramAllTest.java | 7 +- .../dcmd/gc/ClassHistogramTest.java | 6 +- .../dcmd/gc/FinalizerInfoTest.java | 6 +- .../dcmd/gc/HeapDumpAllTest.java | 10 +- .../serviceability/dcmd/gc/HeapDumpTest.java | 11 +- .../serviceability/dcmd/gc/HeapInfoTest.java | 6 +- .../dcmd/gc/RunFinalizationTest.java | 10 +- .../serviceability/dcmd/gc/RunGCTest.java | 8 +- .../dcmd/jvmti/DataDumpDcmdTest.java | 7 +- .../dcmd/jvmti/LoadAgentDcmdTest.java | 35 +- .../dcmd/thread/PrintConcurrentLocksTest.java | 7 +- .../serviceability/dcmd/thread/PrintTest.java | 8 +- .../dcmd/vm/ClassHierarchyTest.java | 8 +- .../dcmd/vm/ClassLoaderStatsTest.java | 8 +- .../dcmd/vm/CommandLineTest.java | 8 +- .../serviceability/dcmd/vm/DynLibsTest.java | 8 +- .../serviceability/dcmd/vm/FlagsTest.java | 8 +- .../serviceability/dcmd/vm/SetVMFlagTest.java | 8 +- .../dcmd/vm/SystemPropertiesTest.java | 8 +- .../serviceability/dcmd/vm/UptimeTest.java | 8 +- .../JvmtiGetAllModulesTest.java | 2 +- .../jvmti/GetObjectSizeClass.java | 9 +- .../jvmti/GetObjectSizeOverflow.java | 11 +- .../jvmti/TestLambdaFormRetransformation.java | 10 +- .../TestRedefineWithUnresolvedClass.java | 10 +- .../logging/TestBasicLogOutput.java | 8 +- .../logging/TestDefaultLogOutput.java | 6 +- .../logging/TestLogRotation.java | 6 +- .../logging/TestMultipleXlogArgs.java | 8 +- .../logging/TestQuotedLogOutputs.java | 8 +- .../sa/DeadlockDetectionTest.java | 12 +- .../sa/TestInstanceKlassSize.java | 14 +- .../sa/TestInstanceKlassSizeForInterface.java | 14 +- .../sa/jmap-hashcode/Test8028623.java | 9 +- .../sa/jmap-hprof/JMapHProfLargeHeapTest.java | 9 +- .../sa/sadebugd/SADebugDTest.java | 2 +- .../threads/TestFalseDeadLock.java | 4 +- .../tmtools/jstack/DaemonThreadTest.java | 6 +- .../tmtools/jstack/JstackThreadTest.java | 7 +- .../tmtools/jstack/SpreadLockTest.java | 6 +- .../tmtools/jstack/ThreadNamesTest.java | 6 +- .../tmtools/jstack/TraveledLockTest.java | 6 +- .../tmtools/jstack/WaitNotifyThreadTest.java | 6 +- .../tmtools/jstat/GcCapacityTest.java | 4 +- .../tmtools/jstat/GcCauseTest01.java | 5 +- .../tmtools/jstat/GcCauseTest02.java | 5 +- .../tmtools/jstat/GcCauseTest03.java | 5 +- .../tmtools/jstat/GcNewTest.java | 4 +- .../tmtools/jstat/GcTest01.java | 5 +- .../tmtools/jstat/GcTest02.java | 4 +- .../test/testlibrary/ClassFileInstaller.java | 257 ------- .../test/testlibrary/RedefineClassHelper.java | 79 --- .../testlibrary/jdk/test/lib/Asserts.java | 454 ------------ .../testlibrary/jdk/test/lib/BuildHelper.java | 106 --- .../jdk/test/lib/ByteCodeLoader.java | 90 --- .../jdk/test/lib/DynamicVMOption.java | 165 ----- .../testlibrary/jdk/test/lib/ExitCode.java | 40 -- .../jdk/test/lib/FileInstaller.java | 97 --- .../jdk/test/lib/InMemoryJavaCompiler.java | 153 ----- .../jdk/test/lib/InfiniteLoop.java | 66 -- .../jdk/test/lib/JDKToolFinder.java | 111 --- .../jdk/test/lib/JDKToolLauncher.java | 137 ---- .../jdk/test/lib/OutputAnalyzer.java | 440 ------------ .../jdk/test/lib/OutputBuffer.java | 64 -- .../test/testlibrary/jdk/test/lib/Pair.java | 68 -- .../testlibrary/jdk/test/lib/Platform.java | 242 ------- .../jdk/test/lib/ProcessTools.java | 264 ------- .../jdk/test/lib/StreamPumper.java | 81 --- .../jdk/test/lib/TimeLimitedRunner.java | 86 --- .../test/testlibrary/jdk/test/lib/Triple.java | 90 --- .../test/testlibrary/jdk/test/lib/Utils.java | 648 ------------------ .../cli/CPUSpecificCommandLineOptionTest.java | 65 -- .../test/lib/cli/CommandLineOptionTest.java | 520 -------------- .../test/lib/cli/predicate/AndPredicate.java | 41 -- .../cli/predicate/CPUSpecificPredicate.java | 71 -- .../test/lib/cli/predicate/NotPredicate.java | 40 -- .../test/lib/cli/predicate/OrPredicate.java | 42 -- .../jdk/test/lib/dcmd/CommandExecutor.java | 75 -- .../lib/dcmd/CommandExecutorException.java | 36 - .../jdk/test/lib/dcmd/FileJcmdExecutor.java | 81 --- .../jdk/test/lib/dcmd/JMXExecutor.java | 187 ----- .../jdk/test/lib/dcmd/JcmdExecutor.java | 58 -- .../test/lib/dcmd/MainClassJcmdExecutor.java | 57 -- .../jdk/test/lib/dcmd/PidJcmdExecutor.java | 63 -- .../src/jdk/test/lib/jittester/Automatic.java | 4 +- .../AssignmentOperatorImplFactory.java | 4 +- .../BinaryArithmeticOperatorFactory.java | 4 +- .../BinaryBitwiseOperatorFactory.java | 4 +- .../BinaryComparisonOperatorFactory.java | 4 +- .../BinaryEqualityOperatorFactory.java | 4 +- .../factories/BinaryLogicOperatorFactory.java | 4 +- .../factories/BinaryOperatorFactory.java | 4 +- .../factories/BinaryShiftOperatorFactory.java | 4 +- .../factories/BinaryStringPlusFactory.java | 4 +- ...ndArithmeticAssignmentOperatorFactory.java | 4 +- ...poundBitwiseAssignmentOperatorFactory.java | 4 +- ...ompoundShiftAssignmentOperatorFactory.java | 4 +- .../lib/jittester/jtreg/JitTesterDriver.java | 6 +- .../jittester/visitors/ByteCodeVisitor.java | 2 +- .../test/testlibrary_tests/AssertsTest.java | 4 +- .../OutputAnalyzerReportingTest.java | 8 +- .../testlibrary_tests/OutputAnalyzerTest.java | 6 +- .../RandomGeneratorTest.java | 8 +- .../testlibrary_tests/RedefineClassTest.java | 6 +- .../SimpleClassFileLoadHookTest.java | 2 +- ...stMutuallyExclusivePlatformPredicates.java | 4 +- .../TestPlatformIsTieredSupported.java | 6 +- .../testlibrary_tests/ctw/ClassesDirTest.java | 4 +- .../ctw/ClassesListTest.java | 4 +- .../test/testlibrary_tests/ctw/CtwTest.java | 4 +- .../testlibrary_tests/ctw/JarDirTest.java | 6 +- .../test/testlibrary_tests/ctw/JarsTest.java | 6 +- .../whitebox/BlobSanityTest.java | 6 +- .../whitebox/vm_flags/BooleanTest.java | 9 +- .../whitebox/vm_flags/DoubleTest.java | 6 +- .../whitebox/vm_flags/IntxTest.java | 6 +- .../whitebox/vm_flags/SizeTTest.java | 6 +- .../whitebox/vm_flags/StringTest.java | 6 +- .../whitebox/vm_flags/Uint64Test.java | 6 +- .../whitebox/vm_flags/UintxTest.java | 6 +- .../whitebox/vm_flags/VmFlagTest.java | 4 +- 992 files changed, 2690 insertions(+), 8044 deletions(-) rename hotspot/test/{testlibrary/jdk/test/lib => compiler/codecache}/dtrace/DtraceResultsAnalyzer.java (88%) rename hotspot/test/{testlibrary/jdk/test/lib => compiler/codecache}/dtrace/DtraceRunner.java (97%) rename hotspot/test/{testlibrary/jdk/test/lib => gc/arguments}/AllocationHelper.java (97%) rename hotspot/test/{testlibrary/jdk/test/lib => gc/arguments}/HeapRegionUsageTool.java (96%) rename hotspot/test/{testlibrary/jdk/test/lib => gc/metaspace}/InputArguments.java (96%) delete mode 100644 hotspot/test/testlibrary/ClassFileInstaller.java delete mode 100644 hotspot/test/testlibrary/RedefineClassHelper.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/Asserts.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/BuildHelper.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/ByteCodeLoader.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/DynamicVMOption.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/ExitCode.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/FileInstaller.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/InfiniteLoop.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/Pair.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/Platform.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/TimeLimitedRunner.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/Triple.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/Utils.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/predicate/AndPredicate.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/predicate/NotPredicate.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/cli/predicate/OrPredicate.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutor.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutorException.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/FileJcmdExecutor.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/JMXExecutor.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/JcmdExecutor.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/MainClassJcmdExecutor.java delete mode 100644 hotspot/test/testlibrary/jdk/test/lib/dcmd/PidJcmdExecutor.java diff --git a/hotspot/test/compiler/arguments/BMISupportedCPUTest.java b/hotspot/test/compiler/arguments/BMISupportedCPUTest.java index 9582e8fe69f..4979de0ae5c 100644 --- a/hotspot/test/compiler/arguments/BMISupportedCPUTest.java +++ b/hotspot/test/compiler/arguments/BMISupportedCPUTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,7 +23,7 @@ package compiler.arguments; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; /** diff --git a/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java b/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java index 103d2a91e7e..957bc7607a2 100644 --- a/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java +++ b/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,7 +23,7 @@ package compiler.arguments; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/hotspot/test/compiler/arguments/CheckCICompilerCount.java b/hotspot/test/compiler/arguments/CheckCICompilerCount.java index 14bbdaa3dc5..7a975785a16 100644 --- a/hotspot/test/compiler/arguments/CheckCICompilerCount.java +++ b/hotspot/test/compiler/arguments/CheckCICompilerCount.java @@ -25,7 +25,7 @@ * @test CheckCheckCICompilerCount * @bug 8130858 8132525 8162881 * @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * @run driver compiler.arguments.CheckCICompilerCount @@ -33,8 +33,8 @@ package compiler.arguments; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class CheckCICompilerCount { private static final String[][] NON_TIERED_ARGUMENTS = { diff --git a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java index ecfe31d427f..1d2de0f7640 100644 --- a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java +++ b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java @@ -25,7 +25,7 @@ * @test CheckCompileThresholdScaling * @bug 8059604 * @summary Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver compiler.arguments.CheckCompileThresholdScaling @@ -33,8 +33,8 @@ package compiler.arguments; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class CheckCompileThresholdScaling { diff --git a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java index 5d7f9fc3bc3..001ac21ac34 100644 --- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @bug 8031321 * @summary Verify processing of UseBMI1Instructions option on CPU with * BMI1 feature support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.arguments.TestUseBMI1InstructionsOnSupportedCPU - * compiler.arguments.BMISupportedCPUTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java index 4fd996f584a..fe4f4d8df57 100644 --- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @bug 8031321 * @summary Verify processing of UseBMI1Instructions option on CPU without * BMI1 feature support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.arguments.TestUseBMI1InstructionsOnUnsupportedCPU - * compiler.arguments.BMIUnsupportedCPUTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java index 3ebd44d5b13..2d71823fe10 100644 --- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @bug 8031321 * @summary Verify processing of UseCountLeadingZerosInstruction option * on CPU with LZCNT support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java index 4285c27cb48..a79a04f3b7a 100644 --- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @bug 8031321 * @summary Verify processing of UseCountLeadingZerosInstruction option * on CPU without LZCNT support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java index 3e988e6b7fe..a0262952134 100644 --- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option * on CPU with TZCNT (BMI1 feature) support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java index 96ccd674126..a6a9501322a 100644 --- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option * on CPU without TZCNT instruction (BMI1 feature) support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java index c3ee9a4d495..e121ab36b6b 100644 --- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,13 +26,12 @@ * @bug 8072016 * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.arraycopy.TestArrayCopyNoInitDeopt + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * jdk.test.lib.Platform * @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 * compiler.arraycopy.TestArrayCopyNoInitDeopt diff --git a/hotspot/test/compiler/c2/PolynomialRoot.java b/hotspot/test/compiler/c2/PolynomialRoot.java index 86836d0b93b..fe34c845c94 100644 --- a/hotspot/test/compiler/c2/PolynomialRoot.java +++ b/hotspot/test/compiler/c2/PolynomialRoot.java @@ -13,7 +13,7 @@ * @test * @bug 8005956 * @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/c2/Test5057225.java b/hotspot/test/compiler/c2/Test5057225.java index 632f678d85f..99f7e5d6a44 100644 --- a/hotspot/test/compiler/c2/Test5057225.java +++ b/hotspot/test/compiler/c2/Test5057225.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -26,7 +26,7 @@ * @bug 5057225 * @summary Remove useless I2L conversions * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xcomp * -XX:CompileCommand=compileonly,compiler.c2.Test5057225::doload diff --git a/hotspot/test/compiler/c2/Test6603011.java b/hotspot/test/compiler/c2/Test6603011.java index 9495fe3a054..a4e7d03571e 100644 --- a/hotspot/test/compiler/c2/Test6603011.java +++ b/hotspot/test/compiler/c2/Test6603011.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -26,7 +26,7 @@ * @bug 6603011 * @summary long/int division by constant * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011 */ diff --git a/hotspot/test/compiler/c2/Test6800154.java b/hotspot/test/compiler/c2/Test6800154.java index 9de9b7648d2..d8407cfa9f0 100644 --- a/hotspot/test/compiler/c2/Test6800154.java +++ b/hotspot/test/compiler/c2/Test6800154.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -26,7 +26,7 @@ * @bug 6800154 * @summary Add comments to long_by_long_mulhi() for better understandability * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xcomp * -XX:CompileCommand=compileonly,compiler.c2.Test6800154::divcomp diff --git a/hotspot/test/compiler/c2/Test6805724.java b/hotspot/test/compiler/c2/Test6805724.java index 2433fce8377..d0565c6e67a 100644 --- a/hotspot/test/compiler/c2/Test6805724.java +++ b/hotspot/test/compiler/c2/Test6805724.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -27,7 +27,7 @@ * @summary ModLNode::Ideal() generates functionally incorrect graph * when divisor is any (2^k-1) constant. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xcomp * -XX:CompileCommand=compileonly,compiler.c2.Test6805724::fcomp diff --git a/hotspot/test/compiler/c2/Test6857159.java b/hotspot/test/compiler/c2/Test6857159.java index 894fc5f1cbe..efe9653ebe3 100644 --- a/hotspot/test/compiler/c2/Test6857159.java +++ b/hotspot/test/compiler/c2/Test6857159.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -26,7 +26,7 @@ * @test * @bug 6857159 * @summary local schedule failed with checkcast of Thread.currentThread() - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -35,8 +35,8 @@ package compiler.c2; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class Test6857159 { public static void main(String[] args) throws Throwable { diff --git a/hotspot/test/compiler/c2/Test7068051.java b/hotspot/test/compiler/c2/Test7068051.java index 408fd6f0b37..d16629077d9 100644 --- a/hotspot/test/compiler/c2/Test7068051.java +++ b/hotspot/test/compiler/c2/Test7068051.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -26,7 +26,7 @@ * @test * @bug 7068051 * @summary SIGSEGV in PhaseIdealLoop::build_loop_late_post on T5440 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -36,7 +36,7 @@ package compiler.c2; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.io.IOException; import java.io.InputStream; diff --git a/hotspot/test/compiler/c2/Test7177917.java b/hotspot/test/compiler/c2/Test7177917.java index 6fe88a37bff..ae4529a52f9 100644 --- a/hotspot/test/compiler/c2/Test7177917.java +++ b/hotspot/test/compiler/c2/Test7177917.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -27,7 +27,7 @@ * @bug 7177917 * @summary Micro-benchmark for Math.pow() and Math.exp() * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main compiler.c2.Test7177917 */ diff --git a/hotspot/test/compiler/c2/cr6589834/Test_ia32.java b/hotspot/test/compiler/c2/cr6589834/Test_ia32.java index c6cf6510c57..58f56351323 100644 --- a/hotspot/test/compiler/c2/cr6589834/Test_ia32.java +++ b/hotspot/test/compiler/c2/cr6589834/Test_ia32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -26,15 +26,13 @@ * @bug 6589834 * @summary Safepoint placed between stack pointer increment and decrement leads * to interpreter's stack corruption after deoptimization. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * - * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.* - * compiler.c2.cr6589834.Test_ia32 - * compiler.c2.cr6589834.InlinedArrayCloneTestCase + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/c2/stemmer/Stemmer.java b/hotspot/test/compiler/c2/stemmer/Stemmer.java index 0f8cb297010..893749d3a99 100644 --- a/hotspot/test/compiler/c2/stemmer/Stemmer.java +++ b/hotspot/test/compiler/c2/stemmer/Stemmer.java @@ -3,7 +3,7 @@ * @bug 7070134 * @summary Hotspot crashes with sigsegv from PorterStemmer * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run driver jdk.test.lib.FileInstaller words words * @run main/othervm -Xbatch compiler.c2.stemmer.Stemmer words diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java index 0ba2498b8a8..777189c307d 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from compiled to compiled using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java index 98a86b15360..e0a25eb3897 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from compiled to interpreted using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java index 397faf23229..4c81223b565 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from compiled to native using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java index 46667c9e794..4332fda343b 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @modules java.base/jdk.internal.misc * @summary check calls from compiled to compiled using InvokeInterface - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java index 07fcff14d2c..c889b919d11 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to interpreted using InvokeInterface * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java index e3a68951d30..2544b4cc3d8 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to native using InvokeInterface * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java index 07e6fc906ec..882b75ccb4b 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to compiled using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java index e08784dc1df..79a8075f130 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java index 600301b3e01..301811399c2 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to native using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java index ddd88ab72df..85412f2f762 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to compiled using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java index 7ca6263ca59..96c2d9655cb 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java index 560c8079cd5..a40d9d41090 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to native using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java index ef408fdfc3b..1c6701dd858 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java index 718aef28707..7ece0a4cd97 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java index e161834319e..c82f056bd24 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from compiled to native using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java index f83beb4127e..4b9d84f47f4 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from interpreted to compiled using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java index e4ff0998b66..028008805a4 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from interpreted to interpreted using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java index 37850589fa6..1d5ac09b6c1 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java @@ -24,12 +24,11 @@ /* * @test * @summary check calls from interpreted to native using InvokeDynamic - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * - * @build compiler.calls.common.InvokeDynamic - * compiler.calls.common.InvokeDynamicPatcher + * @build sun.hotspot.WhiteBox * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java index 83024bb25b4..4d3f556b6a7 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to compiled using InvokeInterface * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java index 2a811103ba3..8c1b18d7824 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to interpreted using InvokeInterface * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java index 72c927568cc..b03e5bd5ec2 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to native using InvokeInterface * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeInterface + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java index ad0b12f1d7f..2624a94386a 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,8 +24,8 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / - * @build compiler.calls.common.InvokeSpecial + * @library /test/lib / + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java index a6a3ae46ba3..d0da40eaa32 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java index f52dd626082..8593ebc2551 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @summary check calls from interpreted to native using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java index 1db10145bce..a83b6d3a31e 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to compiled using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java index 7e3925491eb..88aca669169 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java index 789fe9c77f3..a17e9c5c2a7 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to native using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java index 41e89d3babc..db644c14842 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java index f299f4ae85a..e6d94ee077b 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java index 5a99727c863..9ebf7a359c8 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from interpreted to native using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java index b25f7a12053..74007716168 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to compiled using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java index f7c66cf77e8..4efd098904d 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java index 041af4fb832..1005783754c 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to native using InvokeSpecial * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeSpecial + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java index f7e8f52b112..f1f0634e9f0 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to compiled using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java index ab0e447e350..fc0a0592072 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java index de0b8c158c8..f9da3d65c98 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to native using InvokeStatic * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeStatic + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java index 4361a8d5690..b6cce29b413 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java index fde24657a05..270ecfa6f35 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,8 +25,8 @@ * @test * @summary check calls from native to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / - * @build compiler.calls.common.InvokeVirtual + * @library /test/lib / + * @build sun.hotspot.WhiteBox * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java index a07510709f3..83564c143b2 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @summary check calls from native to native using InvokeVirtual * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary / + * @library /test/lib / * - * @build compiler.calls.common.InvokeVirtual + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java index 694b6e74bfc..ea2d1920d87 100644 --- a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java +++ b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test TestAnonymousClassUnloading * @bug 8054402 * @summary "Tests unloading of anonymous classes." - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * * @run main/othervm/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java b/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java index d0f022d7fbe..9b0598f3f60 100644 --- a/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java +++ b/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @bug 8029443 * @summary Tests the unloading of methods to to class unloading * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.classUnloading.methodUnloading.TestMethodUnloading + * @build sun.hotspot.WhiteBox * compiler.classUnloading.methodUnloading.WorkerClass * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java index 1c8d70f5adb..eb8fcc0c178 100644 --- a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java +++ b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @bug 8013496 * @summary Test checks that the order in which ReversedCodeCacheSize and * InitialCodeCacheSize are passed to the VM is irrelevant. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -35,8 +35,8 @@ package compiler.codecache; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class CheckReservedInitialCodeCacheSizeArgOrder { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java index 2e09a4a580c..12e1ca15ac7 100644 --- a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java +++ b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java @@ -25,11 +25,11 @@ * @test CheckSegmentedCodeCache * @bug 8015774 * @summary Checks VM options related to the segmented code cache - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.CheckSegmentedCodeCache + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,9 +39,9 @@ package compiler.codecache; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; public class CheckSegmentedCodeCache { diff --git a/hotspot/test/compiler/codecache/CheckUpperLimit.java b/hotspot/test/compiler/codecache/CheckUpperLimit.java index d4c34ca36e5..473ec3f147c 100644 --- a/hotspot/test/compiler/codecache/CheckUpperLimit.java +++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8015635 * @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -34,8 +34,8 @@ package compiler.codecache; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class CheckUpperLimit { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java index 6b45694e988..64bbd2c1dae 100644 --- a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java +++ b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @test OverflowCodeCacheTest * @bug 8059550 * @summary testing of code cache segments overflow - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.OverflowCodeCacheTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java index c5db695125b..c6fc3af49d5 100644 --- a/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java +++ b/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,20 +25,19 @@ * @test * @bug 8015774 * @summary Verify SegmentedCodeCache option's processing - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * - * @build jdk.test.lib.* * @run driver compiler.codecache.cli.TestSegmentedCodeCacheOption */ package compiler.codecache.cli; import compiler.codecache.cli.common.CodeCacheOptions; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; diff --git a/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java b/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java index ffc333c7d84..56816e8b81a 100644 --- a/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java +++ b/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ package compiler.codecache.cli.codeheapsize; import compiler.codecache.cli.common.CodeCacheCLITestCase; import compiler.codecache.cli.common.CodeCacheOptions; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; diff --git a/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java b/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java index 8eb8d15af3e..bde7beb68bf 100644 --- a/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java +++ b/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ package compiler.codecache.cli.codeheapsize; import compiler.codecache.cli.common.CodeCacheCLITestCase; import compiler.codecache.cli.common.CodeCacheOptions; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; diff --git a/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java index ce576107af8..ca28cdb29ff 100644 --- a/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java +++ b/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,12 @@ * @test * @bug 8015774 * @summary Verify processing of options related to code heaps sizing. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * - * @build compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions jdk.test.lib.* * @run driver/timeout=240 compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions */ diff --git a/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java b/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java index 4bd269aafb5..43d4e387852 100644 --- a/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java +++ b/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ package compiler.codecache.cli.printcodecache; import compiler.codecache.cli.common.CodeCacheCLITestCase; import compiler.codecache.cli.common.CodeCacheInfoFormatter; import compiler.codecache.cli.common.CodeCacheOptions; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; diff --git a/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java index eb50d4a7e3e..74ed9071156 100644 --- a/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,12 @@ * @test * @bug 8015774 * @summary Verify that PrintCodeCache option print correct information. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * - * @build jdk.test.lib.* compiler.codecache.cli.common.* * @run main/timeout=240 compiler.codecache.cli.printcodecache.TestPrintCodeCacheOption */ diff --git a/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceResultsAnalyzer.java b/hotspot/test/compiler/codecache/dtrace/DtraceResultsAnalyzer.java similarity index 88% rename from hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceResultsAnalyzer.java rename to hotspot/test/compiler/codecache/dtrace/DtraceResultsAnalyzer.java index 1df4512105e..9cab7a422c4 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceResultsAnalyzer.java +++ b/hotspot/test/compiler/codecache/dtrace/DtraceResultsAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -20,9 +20,9 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.test.lib.dtrace; +package compiler.codecache.dtrace; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; public interface DtraceResultsAnalyzer { public void analyze(OutputAnalyzer oa, String logFilePath); diff --git a/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceRunner.java b/hotspot/test/compiler/codecache/dtrace/DtraceRunner.java similarity index 97% rename from hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceRunner.java rename to hotspot/test/compiler/codecache/dtrace/DtraceRunner.java index 014087c8814..dbdbfa15f09 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceRunner.java +++ b/hotspot/test/compiler/codecache/dtrace/DtraceRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -20,10 +20,10 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.test.lib.dtrace; +package compiler.codecache.dtrace; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; import java.io.IOException; import java.util.ArrayList; diff --git a/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java b/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java index 535adc0a4fb..d4dbf663a19 100644 --- a/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java +++ b/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,9 +27,9 @@ * @summary testing of dtrace for segmented code cache * @requires os.family=="solaris" * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. @@ -42,10 +42,8 @@ package compiler.codecache.dtrace; import compiler.testlibrary.CompilerUtils; import jdk.test.lib.Asserts; import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; -import jdk.test.lib.dtrace.DtraceResultsAnalyzer; -import jdk.test.lib.dtrace.DtraceRunner; import java.io.IOException; import java.lang.reflect.Executable; diff --git a/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java b/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java index d620e9ee3f2..dca730a46ac 100644 --- a/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java +++ b/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary verify types of code cache memory pool bean * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.codecache.jmx.BeanTypeTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java index ccf6927a467..0bdd2f78676 100644 --- a/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java +++ b/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary verify CodeHeap bean presence * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.codecache.jmx.CodeHeapBeanPresenceTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/GetUsageTest.java b/hotspot/test/compiler/codecache/jmx/GetUsageTest.java index 01f247c43ed..cf838dd14da 100644 --- a/hotspot/test/compiler/codecache/jmx/GetUsageTest.java +++ b/hotspot/test/compiler/codecache/jmx/GetUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary testing of getUsage() for segmented code cache * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.codecache.jmx.GetUsageTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java index e96dc4713d9..49b1fa53fe8 100644 --- a/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java +++ b/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java @@ -26,9 +26,9 @@ * @summary testing of initial and max usage * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.codecache.jmx.InitialAndMaxUsageTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing diff --git a/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java b/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java index f8e678727e1..a80298a2066 100644 --- a/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java +++ b/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary verify getMemoryManageNames calls in case of segmented code cache * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.codecache.jmx.ManagerNamesTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java index b0796cd3213..6e5ea32f577 100644 --- a/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java +++ b/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary verify that MemoryManagerMXBean exists for every code cache segment * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.codecache.jmx.MemoryPoolsPresenceTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java index 4b593c7ad6d..57518e61833 100644 --- a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java +++ b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java @@ -23,11 +23,11 @@ /* * @test PeakUsageTest - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build ompiler.codecache.jmx.PeakUsageTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java index cd61fea7ac6..50b56ef461f 100644 --- a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,9 +26,9 @@ * @summary testing of getUsageThreshold() * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.codecache.jmx.PoolsIndependenceTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java b/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java index e173fc8a6c7..e3cc8734674 100644 --- a/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java +++ b/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,11 +24,11 @@ /* * @test ThresholdNotificationsTest * @summary testing of getUsageThreshold() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.jmx.ThresholdNotificationsTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java index e90222d8c1d..fd39beaaaf7 100644 --- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java +++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test UsageThresholdExceededSeveralTimesTest * @summary verifying that getUsageThresholdCount() returns correct value * after threshold has been hit several times - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.jmx.UsageThresholdExceededTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java index 154a096a277..bf78a1c910c 100644 --- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java +++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test UsageThresholdExceededTest * @summary verifying that getUsageThresholdCount() returns correct value * after threshold has been hit - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.jmx.UsageThresholdExceededTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java index f432f8a1e70..ee071d41843 100644 --- a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java +++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java @@ -25,11 +25,10 @@ * @test UsageThresholdIncreasedTest * @summary verifying that threshold hasn't been hit after allocation smaller * than threshold value and that threshold value can be changed - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * - * @build compiler.codecache.jmx.UsageThresholdIncreasedTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java index 46bd21b8b2d..60587960821 100644 --- a/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java +++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java @@ -25,13 +25,13 @@ * @test UsageThresholdNotExceededTest * @summary verifying that usage threshold not exceeded while allocating less * than usage threshold - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @build compiler.codecache.jmx.UsageThresholdNotExceededTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* diff --git a/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java index e3d4a9af13f..e02eef8f7bb 100644 --- a/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java +++ b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.codecache.stress; -import jdk.test.lib.TimeLimitedRunner; +import jdk.test.lib.wrappers.TimeLimitedRunner; import jdk.test.lib.Utils; public class CodeCacheStressRunner { diff --git a/hotspot/test/compiler/codecache/stress/Helper.java b/hotspot/test/compiler/codecache/stress/Helper.java index 6399d30d5dc..1e2f04f617b 100644 --- a/hotspot/test/compiler/codecache/stress/Helper.java +++ b/hotspot/test/compiler/codecache/stress/Helper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ package compiler.codecache.stress; import jdk.test.lib.Asserts; import jdk.test.lib.ByteCodeLoader; -import jdk.test.lib.InfiniteLoop; +import jdk.test.lib.wrappers.InfiniteLoop; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java index 4a93f2ef4dd..95899878e81 100644 --- a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java +++ b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,12 @@ /* * @test OverloadCompileQueueTest * @summary stressing code cache by overloading compile queues - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * * @ignore 8071905 - * @build compiler.codecache.stress.OverloadCompileQueueTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java index 761cbfd4842..21f602b39a7 100644 --- a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java +++ b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @test RandomAllocationTest * @key stress * @summary stressing code cache by allocating randomly sized "dummy" code blobs - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.stress.RandomAllocationTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java index 4cd43a154e7..a6b3a6cb9e4 100644 --- a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java +++ b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,11 @@ * @test UnexpectedDeoptimizationTest * @key stress * @summary stressing code cache by forcing unexpected deoptimizations - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.codecache.stress.UnexpectedDeoptimizationTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/codegen/Test6823354.java b/hotspot/test/compiler/codegen/Test6823354.java index 7ff6f2ca94d..fb332420f14 100644 --- a/hotspot/test/compiler/codegen/Test6823354.java +++ b/hotspot/test/compiler/codegen/Test6823354.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -26,7 +26,7 @@ * @bug 6823354 * @summary These methods can be instrinsified by using bit scan, bit test, and population count instructions. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xcomp * -XX:CompileCommand=compileonly,compiler.codegen.Test6823354::lzcomp diff --git a/hotspot/test/compiler/codegen/Test6896617.java b/hotspot/test/compiler/codegen/Test6896617.java index 90e4854f321..bc3807bef8d 100644 --- a/hotspot/test/compiler/codegen/Test6896617.java +++ b/hotspot/test/compiler/codegen/Test6896617.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 6896617 * @summary Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() with SSE instructions on x86 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.base/sun.nio.cs * java.management diff --git a/hotspot/test/compiler/codegen/Test7100757.java b/hotspot/test/compiler/codegen/Test7100757.java index 3736d85c7fb..6dbae9c6cab 100644 --- a/hotspot/test/compiler/codegen/Test7100757.java +++ b/hotspot/test/compiler/codegen/Test7100757.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -26,7 +26,7 @@ * @test * @bug 7100757 * @summary The BitSet.nextSetBit() produces incorrect result in 32bit VM on Sparc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/codegen/aes/TestAESMain.java b/hotspot/test/compiler/codegen/aes/TestAESMain.java index 36353ca45f3..4c9398de8da 100644 --- a/hotspot/test/compiler/codegen/aes/TestAESMain.java +++ b/hotspot/test/compiler/codegen/aes/TestAESMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -27,7 +27,7 @@ * @bug 7184394 * @key stress * @summary add intrinsics to use AES instructions - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/compilercontrol/InlineMatcherTest.java b/hotspot/test/compiler/compilercontrol/InlineMatcherTest.java index a406e2edbac..b2c6507c1d8 100644 --- a/hotspot/test/compiler/compilercontrol/InlineMatcherTest.java +++ b/hotspot/test/compiler/compilercontrol/InlineMatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,9 +26,9 @@ * @bug 8074095 * @summary Testing of compiler/InlineMatcher * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.compilercontrol.InlineMatcherTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java index 882e78367b8..11013a69da3 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,16 +25,12 @@ * @test TestCompilerDirectivesCompatibilityBase * @bug 8137167 * @summary Test compiler control compatibility with compile command - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.TestCompilerDirectivesCompatibilityBase + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java index 903691954f6..d8e246c429a 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,16 +25,12 @@ * @test TestCompilerDirectivesCompatibilityCommandOff * @bug 8137167 * @summary Test compiler control compatibility with compile command - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOff + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java index 7336b0ec3cc..44bf2a7ecd8 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,16 +25,12 @@ * @test TestCompilerDirectivesCompatibilityCommandOn * @bug 8137167 * @summary Test compiler control compatibility with compile command - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOn + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java index a8276567b8b..81f1460313d 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,16 +24,12 @@ /* * @test TestCompilerDirectivesCompatibilityFlag * @bug 8137167 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.TestCompilerDirectivesCompatibilityFlag + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java index ae03d3ff2c3..bb49aea3c4f 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commandfile.CompileOnlyTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.CompileOnlyTest diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index 0caa287210f..8c48e9a0443 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commandfile.ExcludeTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.ExcludeTest diff --git a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java index 1d5768b2cef..5c0551a0200 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commandfile.LogTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.LogTest diff --git a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java index 30127ce7885..1187d75334c 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commandfile.PrintTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.PrintTest diff --git a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java index 49b6c484759..7dcd1885f07 100644 --- a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commands.CompileOnlyTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.CompileOnlyTest diff --git a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java index d6b931eda15..3765d175dd6 100644 --- a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commands.ExcludeTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.ExcludeTest diff --git a/hotspot/test/compiler/compilercontrol/commands/LogTest.java b/hotspot/test/compiler/compilercontrol/commands/LogTest.java index b079475555e..0d9b7af260e 100644 --- a/hotspot/test/compiler/compilercontrol/commands/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/LogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commands.LogTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.LogTest diff --git a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java index ca5eaa06049..26ce69351ec 100644 --- a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.commands.PrintTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.PrintTest diff --git a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java index fce58414830..f79e97f9683 100644 --- a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests directives to be able to compile only specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.directives.CompileOnlyTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.CompileOnlyTest diff --git a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java index fda9b26a885..1d0dfe3c577 100644 --- a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests directives to be able to exclude methods from compilation * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.directives.ExcludeTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.ExcludeTest diff --git a/hotspot/test/compiler/compilercontrol/directives/LogTest.java b/hotspot/test/compiler/compilercontrol/directives/LogTest.java index d5cef20565b..5e32238cd98 100644 --- a/hotspot/test/compiler/compilercontrol/directives/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/LogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests directives to be able to turn on LogCompilation * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.directives.LogTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.LogTest diff --git a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java index 41326546b8e..83c613680ef 100644 --- a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests directives to be able to turn on print_assembly * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.directives.PrintTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.PrintTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java index 55674ebfcaa..96e8599d14e 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests directives to be able to add and remove directives * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.AddAndRemoveTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddAndRemoveTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java index 598a2ea4a76..5cb7069838f 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddCompileOnlyTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java index c8be85dddaa..dc57aa2e82f 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to exclude only specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.AddExcludeTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddExcludeTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java index c4ffd001dc9..91b8c934d88 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to log only specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.AddLogTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddLogTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java index 5d817895dcc..d719df0eb9b 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,14 +27,9 @@ * @summary Tests jcmd to be able to add a directive to print assembly * only for specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddPrintAssemblyTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java index bd01ba11857..ed76061b2cd 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,15 +26,10 @@ * @bug 8137167 * @summary Tests jcmd to be able to clear directives added via options * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * * @ignore 8140405 - * @build compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java index d8c8c81d49e..8514afd083d 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests clear JCMD command * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.ClearDirectivesStackTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.ClearDirectivesStackTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java index 297ad1abb8a..335e89c6668 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,15 +26,10 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * @requires vm.flavor != "minimal" * - * @build compiler.compilercontrol.jcmd.PrintDirectivesTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.PrintDirectivesTest diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java index 4f8dd0fa14c..30baaed7684 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,8 +28,8 @@ import compiler.compilercontrol.share.AbstractTestBase; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.Executor; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.TimeLimitedRunner; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.wrappers.TimeLimitedRunner; import jdk.test.lib.Utils; import java.util.ArrayList; diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java index 2fbe53616c8..e5c277ae624 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,14 +27,9 @@ * @summary Tests jcmd to be able to add a lot of huge directive files with * parallel executed jcmds until timeout has reached * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.jcmd.StressAddMultiThreadedTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.StressAddMultiThreadedTest diff --git a/hotspot/test/compiler/compilercontrol/logcompilation/LogTest.java b/hotspot/test/compiler/compilercontrol/logcompilation/LogTest.java index 1535d3e3d55..b681029061a 100644 --- a/hotspot/test/compiler/compilercontrol/logcompilation/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/logcompilation/LogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Tests LogCompilation executed standalone without log commands or directives * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.logcompilation.LogTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.logcompilation.LogTest diff --git a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java index 91c7fa73768..cff49828bd8 100644 --- a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java +++ b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,9 +26,9 @@ * @bug 8135068 * @summary Tests CompilerCommand's method matcher * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.matcher.MethodMatcherTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -40,7 +40,7 @@ package compiler.compilercontrol.matcher; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import sun.hotspot.WhiteBox; import java.lang.reflect.Executable; diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java index 85cb8c6a7fd..b7fd9030663 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Randomly generates commands with random types * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.mixed.RandomCommandsTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver/timeout=600 compiler.compilercontrol.mixed.RandomCommandsTest diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 4b1b6f692cb..9a1e9ce50c3 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,9 @@ * @bug 8137167 * @summary Randomly generates valid commands with random types * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.compilercontrol.mixed.RandomValidCommandsTest - * compiler.compilercontrol.share.pool.sub.* - * compiler.compilercontrol.share.pool.subpack.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils - * compiler.compilercontrol.share.actions.* + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver/timeout=600 compiler.compilercontrol.mixed.RandomValidCommandsTest diff --git a/hotspot/test/compiler/compilercontrol/parser/DirectiveParserTest.java b/hotspot/test/compiler/compilercontrol/parser/DirectiveParserTest.java index a362e02c1a8..b230b1d72ab 100644 --- a/hotspot/test/compiler/compilercontrol/parser/DirectiveParserTest.java +++ b/hotspot/test/compiler/compilercontrol/parser/DirectiveParserTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @bug 8137167 * @summary Tests directive json parser * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * * @run driver compiler.compilercontrol.parser.DirectiveParserTest */ @@ -35,7 +35,7 @@ package compiler.compilercontrol.parser; import compiler.compilercontrol.share.JSONFile; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; public class DirectiveParserTest { diff --git a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java index fa95072b725..2cf7dbe6e91 100644 --- a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java +++ b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @bug 8137167 * @summary Stress directive json parser * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * * @run driver compiler.compilercontrol.parser.DirectiveStressTest */ @@ -38,7 +38,7 @@ import compiler.compilercontrol.share.JSONFile; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.DirectiveWriter; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.util.List; import java.util.stream.Collectors; diff --git a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java index 6bf59324810..9cd25bb420f 100644 --- a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java +++ b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,8 +27,8 @@ import compiler.compilercontrol.share.JSONFile; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.scenario.DirectiveWriter; import compiler.compilercontrol.share.scenario.Scenario; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import java.util.EnumSet; diff --git a/hotspot/test/compiler/compilercontrol/share/AbstractTestBase.java b/hotspot/test/compiler/compilercontrol/share/AbstractTestBase.java index 0baf937326a..2bec3f9290a 100644 --- a/hotspot/test/compiler/compilercontrol/share/AbstractTestBase.java +++ b/hotspot/test/compiler/compilercontrol/share/AbstractTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ package compiler.compilercontrol.share; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.List; diff --git a/hotspot/test/compiler/compilercontrol/share/actions/BaseAction.java b/hotspot/test/compiler/compilercontrol/share/actions/BaseAction.java index d8a5bd13452..424e7e80ad0 100644 --- a/hotspot/test/compiler/compilercontrol/share/actions/BaseAction.java +++ b/hotspot/test/compiler/compilercontrol/share/actions/BaseAction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,8 +25,8 @@ package compiler.compilercontrol.share.actions; import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; -import jdk.test.lib.Pair; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.util.Pair; +import jdk.test.lib.process.ProcessTools; import java.io.BufferedReader; import java.io.IOException; diff --git a/hotspot/test/compiler/compilercontrol/share/actions/CompileAction.java b/hotspot/test/compiler/compilercontrol/share/actions/CompileAction.java index e01c53395a8..515aced38ba 100644 --- a/hotspot/test/compiler/compilercontrol/share/actions/CompileAction.java +++ b/hotspot/test/compiler/compilercontrol/share/actions/CompileAction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,7 +27,7 @@ import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; import compiler.testlibrary.CompilerUtils; import jdk.test.lib.Asserts; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/compiler/compilercontrol/share/method/MethodDescriptor.java b/hotspot/test/compiler/compilercontrol/share/method/MethodDescriptor.java index 11848d8b1b6..30c9a4d78bb 100644 --- a/hotspot/test/compiler/compilercontrol/share/method/MethodDescriptor.java +++ b/hotspot/test/compiler/compilercontrol/share/method/MethodDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package compiler.compilercontrol.share.method; -import jdk.test.lib.Triple; +import jdk.test.lib.util.Triple; import java.lang.reflect.Executable; import java.util.function.Function; diff --git a/hotspot/test/compiler/compilercontrol/share/method/MethodGenerator.java b/hotspot/test/compiler/compilercontrol/share/method/MethodGenerator.java index 50f51366dd7..43f53bc38bb 100644 --- a/hotspot/test/compiler/compilercontrol/share/method/MethodGenerator.java +++ b/hotspot/test/compiler/compilercontrol/share/method/MethodGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,8 +26,8 @@ package compiler.compilercontrol.share.method; import compiler.compilercontrol.share.method.MethodDescriptor.PatternType; import compiler.compilercontrol.share.method.MethodDescriptor.Separator; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; -import jdk.test.lib.Triple; +import jdk.test.lib.util.Pair; +import jdk.test.lib.util.Triple; import jdk.test.lib.Utils; import java.lang.reflect.Executable; diff --git a/hotspot/test/compiler/compilercontrol/share/pool/MethodHolder.java b/hotspot/test/compiler/compilercontrol/share/pool/MethodHolder.java index a7b367a0383..4c3e01054b7 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/MethodHolder.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/MethodHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package compiler.compilercontrol.share.pool; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.lang.reflect.Method; diff --git a/hotspot/test/compiler/compilercontrol/share/pool/PoolHelper.java b/hotspot/test/compiler/compilercontrol/share/pool/PoolHelper.java index ed06e1b98a6..4dccdff412e 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/PoolHelper.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/PoolHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package compiler.compilercontrol.share.pool; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java index e9f23fcc546..9b7fc4c445c 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java @@ -1,6 +1,6 @@ package compiler.compilercontrol.share.pool; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Constructor; import java.lang.reflect.Executable; diff --git a/hotspot/test/compiler/compilercontrol/share/processors/CommandProcessor.java b/hotspot/test/compiler/compilercontrol/share/processors/CommandProcessor.java index 6d28e1eaed3..947f0a4ad96 100644 --- a/hotspot/test/compiler/compilercontrol/share/processors/CommandProcessor.java +++ b/hotspot/test/compiler/compilercontrol/share/processors/CommandProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ package compiler.compilercontrol.share.processors; import compiler.compilercontrol.share.scenario.CompileCommand; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.util.Iterator; import java.util.List; diff --git a/hotspot/test/compiler/compilercontrol/share/processors/LogProcessor.java b/hotspot/test/compiler/compilercontrol/share/processors/LogProcessor.java index 0cfc7d6b5ce..98fce874cb1 100644 --- a/hotspot/test/compiler/compilercontrol/share/processors/LogProcessor.java +++ b/hotspot/test/compiler/compilercontrol/share/processors/LogProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,7 +28,7 @@ import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; import java.io.FileNotFoundException; diff --git a/hotspot/test/compiler/compilercontrol/share/processors/PrintDirectivesProcessor.java b/hotspot/test/compiler/compilercontrol/share/processors/PrintDirectivesProcessor.java index 6abc192c435..51b28353277 100644 --- a/hotspot/test/compiler/compilercontrol/share/processors/PrintDirectivesProcessor.java +++ b/hotspot/test/compiler/compilercontrol/share/processors/PrintDirectivesProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ package compiler.compilercontrol.share.processors; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.scenario.CompileCommand; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.util.ArrayList; import java.util.Iterator; diff --git a/hotspot/test/compiler/compilercontrol/share/processors/PrintProcessor.java b/hotspot/test/compiler/compilercontrol/share/processors/PrintProcessor.java index 9fa00c10500..c023d013770 100644 --- a/hotspot/test/compiler/compilercontrol/share/processors/PrintProcessor.java +++ b/hotspot/test/compiler/compilercontrol/share/processors/PrintProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,7 +28,7 @@ import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.lang.management.ManagementFactory; import java.lang.reflect.Executable; diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java index 21731287943..6d550c9d779 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java index 124c265a342..3797d1f2810 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,7 +27,7 @@ import compiler.compilercontrol.share.JSONFile; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java b/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java index bd387d9829e..fbd3f13259b 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,8 +25,8 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.actions.BaseAction; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java index bf12f9911bf..f36d5fb7f71 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; import compiler.compilercontrol.share.pool.PoolHelper; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/Scenario.java b/hotspot/test/compiler/compilercontrol/share/scenario/Scenario.java index 8a1723f44c0..8c860de787a 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/Scenario.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/Scenario.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -30,8 +30,8 @@ import compiler.compilercontrol.share.processors.LogProcessor; import compiler.compilercontrol.share.processors.PrintDirectivesProcessor; import compiler.compilercontrol.share.processors.PrintProcessor; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.Pair; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.util.Pair; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/hotspot/test/compiler/cpuflags/RestoreMXCSR.java b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java index b0df3892de0..68138af1ff7 100644 --- a/hotspot/test/compiler/cpuflags/RestoreMXCSR.java +++ b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8020433 * @summary Crash when using -XX:+RestoreMXCSROnJNICalls - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -34,8 +34,8 @@ package compiler.cpuflags; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class RestoreMXCSR { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index c5c4db0febd..5f3b533c39d 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,12 +24,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * @ignore 8146128 - * @build compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig - * compiler.codegen.aes.TestAESMain + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,9 +38,9 @@ package compiler.cpuflags; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase { diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java index caef413636e..4defa877afb 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,12 +24,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig - * compiler.codegen.aes.TestAESMain + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,8 +38,8 @@ package compiler.cpuflags; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.cli.predicate.NotPredicate; public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase { diff --git a/hotspot/test/compiler/debug/VerifyAdapterSharing.java b/hotspot/test/compiler/debug/VerifyAdapterSharing.java index 263f263e9b8..00ec0291131 100644 --- a/hotspot/test/compiler/debug/VerifyAdapterSharing.java +++ b/hotspot/test/compiler/debug/VerifyAdapterSharing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8030783 * @summary Regression test for 8026478 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -34,8 +34,8 @@ package compiler.debug; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class VerifyAdapterSharing { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java b/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java index e5dbe6a2532..a54e03002b0 100644 --- a/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java +++ b/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox * -XX:CompileOnly=::valueOf,::byteValue,::shortValue,::testUnsignedByte,::testUnsignedShort diff --git a/hotspot/test/compiler/floatingpoint/TestPow2.java b/hotspot/test/compiler/floatingpoint/TestPow2.java index 28e4f4c34e9..5cf0aeed751 100644 --- a/hotspot/test/compiler/floatingpoint/TestPow2.java +++ b/hotspot/test/compiler/floatingpoint/TestPow2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8063086 * @summary X^2 special case for C2 yields different result than interpreter - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.floatingpoint.TestPow2 + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/gcbarriers/PreserveFPRegistersTest.java b/hotspot/test/compiler/gcbarriers/PreserveFPRegistersTest.java index 483f99d7df5..7884673f148 100644 --- a/hotspot/test/compiler/gcbarriers/PreserveFPRegistersTest.java +++ b/hotspot/test/compiler/gcbarriers/PreserveFPRegistersTest.java @@ -26,7 +26,7 @@ * @test * @bug 8148175 * @requires vm.gc=="G1" | vm.gc=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xmx300m -XX:+UseG1GC * compiler.gcbarriers.PreserveFPRegistersTest diff --git a/hotspot/test/compiler/inlining/InlineAccessors.java b/hotspot/test/compiler/inlining/InlineAccessors.java index 10d9f8eea9e..df2c66d197d 100644 --- a/hotspot/test/compiler/inlining/InlineAccessors.java +++ b/hotspot/test/compiler/inlining/InlineAccessors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,15 +26,15 @@ * @bug 8140650 * @summary Method::is_accessor should cover getters and setters for all types * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run driver compiler.inlining.InlineAccessors */ package compiler.inlining; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class InlineAccessors { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/interpreter/DisableOSRTest.java b/hotspot/test/compiler/interpreter/DisableOSRTest.java index 8bdd1ce368b..6676c29f2a3 100644 --- a/hotspot/test/compiler/interpreter/DisableOSRTest.java +++ b/hotspot/test/compiler/interpreter/DisableOSRTest.java @@ -26,7 +26,7 @@ * @bug 8159620 * @summary testing that -XX:-UseOnStackReplacement works with both -XX:(+/-)TieredCompilation * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java index ddc5bd04f8a..2be9bf6aca4 100644 --- a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java +++ b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java @@ -25,9 +25,9 @@ * @test * @bug 8130832 * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * - * @build compiler.intrinsics.IntrinsicAvailableTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java index 53cf827602f..3523aa66ce4 100644 --- a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java +++ b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,9 +25,9 @@ * @test * @bug 8138651 * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.intrinsics.IntrinsicDisabledTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java b/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java index 01f3ce72203..b524ca47b08 100644 --- a/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java +++ b/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,9 +28,9 @@ * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments. * @requires vm.flavor == "server" * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * - * @build compiler.intrinsics.bigInteger.MontgomeryMultiplyTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java b/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java index 7ca7784b319..bda3b5e2b05 100644 --- a/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java +++ b/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,8 +25,8 @@ package compiler.intrinsics.bmi; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import java.io.IOException; diff --git a/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java b/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java index bb8f971c4c9..cee9666c781 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,12 +27,10 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of ANDN instruction - * @library /testlibrary /test/lib + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.intrinsics.bmi.TestAndnI - * compiler.intrinsics.bmi.BMITestRunner - * compiler.intrinsics.bmi.Expr + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java b/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java index 9409510a595..2516e144441 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of ANDN instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestAndnL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java index a7bad9e3543..a7b37efc4b6 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSI instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsiI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java index 90254f5e14b..42b358168a0 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSI instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsiL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java index 818c141194a..78e7e76a7ac 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSMSK instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsmskI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java index 8c5c6b5a052..657bd042420 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSMSK instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsmskL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java index 1d759d6974b..0f24d4a2c7b 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSR instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsrI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java b/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java index f299a779042..592e37ec8d6 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of BLSR instruction - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestBlsrL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java b/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java index 31ac4ea2fc0..d2bdada5416 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of intrinsic - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestLzcntI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java b/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java index f27f8457a99..c1750400de7 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of intrinsic - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestLzcntL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java b/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java index c75e28dc329..a679efa2fdc 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of intrinsic - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestTzcntI BMITestRunner Expr + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java b/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java index f56168198a6..040d08166f0 100644 --- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java +++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031321 * @summary Verify that results of computations are the same w/ * and w/o usage of intrinsic - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.TestTzcntL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java index ae940d793f7..f307a3ec555 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.AndnTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java index cf2729e39b1..dd1bc571787 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.AndnTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java index 944d8745bec..a5e34b5f6a8 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsiTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java index 5d98755b03c..72eb85a322f 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsiTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java index 0ed1d9d9791..a5829a7e931 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsmskTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java index 9554c5ef6e1..9198bc734fd 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsmskTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java index b11e27580c6..2ab1c78dfba 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsrTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java index 08038e17cef..3addea222c1 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.BlsrTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java index e2ba6930058..886d4623032 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.LZcntTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java index d68a32fe680..b6bf6b5c48f 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.LZcntTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java index 4ab25be7b78..8a5e86187b9 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.TZcntTestI + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java index 02359f6c4ac..44f79d03012 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8031321 * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.bmi.verifycode.TZcntTestL + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java b/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java index cb6d70c03f6..b2a9554060d 100644 --- a/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java +++ b/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,15 +26,13 @@ * @bug 8054492 * @summary Casting can result in redundant null checks in generated code * @requires vm.flavor == "server" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * - * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.* - * @build compiler.intrinsics.klass.CastNullCheckDroppingsTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * jdk.test.lib.Platform * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000 * -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java index c8f3c1a07b4..ab9f731fec6 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8024924 * @summary Test constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java index 517abe27163..1c14f1cb83f 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8024924 * @summary Test non constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java index a655e1e8d4f..b1f84f538ad 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8024924 * @summary Test non constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java index d1f0d42eac5..82aba8ebde1 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8024924 * @summary Test non constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java index 649962d2089..7cc4f522bc0 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8025657 * @summary Test repeating addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java index 10cf900db1a..eb8c24e5231 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java index 32765a52a3e..86f2d86a5c4 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant addExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java index 2f771747229..3ba628e3c99 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test decrementExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java index a24db225f35..0a7225005a1 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test decrementExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java index 8d38cf46ad6..6fa2588ff44 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test incrementExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java index 36347647a0c..52f6ba13f6b 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test incrementExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java index d30cb0d3f8a..1f3d9098e4a 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant multiplyExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java index 7db6a1d14fd..49f909d8558 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test multiplyExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java index 086b530e1d9..f948e3994b4 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test loop dependent multiplyExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java index 2ef12eaf433..9079d1cb3a3 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant multiplyExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java index f1174d70400..b638542f132 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test repeating multiplyExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java index b340670fe09..8a60b42dceb 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant mulExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java index ef6acaea38d..9668f09240b 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant mulExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java index 85ef97aeb38..c979713d16e 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant negExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java index 9b00f835d06..1a561309b0c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test negExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java index 48b02c05814..0ab86d34924 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test negExact loop dependent - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java index 34a20d6643c..e751a21d4d4 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant negExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java index b1d086a7872..c36917e6037 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant negExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java index f28d2983327..68dcacfe5d9 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant negExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java index 95a177f4885..3ca4f72d859 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test subtractExact as condition - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java index bcb9a1a1964..a0a2726f221 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java index 186f6295335..0ee861e587c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java index 880425e5efe..4bb55a20cc7 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java index 222649d5137..72d754cb610 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test non constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java index 49631cf076b..61db69fd534 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026844 * @summary Test repeating subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java index 996dab70e95..040f3eb00ae 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @bug 8026844 * @bug 8027353 * @summary Test constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java index d1d11735d11..6ebe6fd4d4c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @bug 8026844 * @bug 8027353 * @summary Test non constant subtractExact - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java index 5b701af0ab8..cc95c6e712c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.AddExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java index 48dfddda317..1ef33c42458 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.AddExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java index ff178062918..6c996230c31 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.DecrementExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java index 2683a594eba..c1fad956ec1 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.DecrementExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java index 4c6569a9dd9..98133d758ae 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.IncrementExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java index fa67b740e8f..e5c4c3ca13c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.IncrementExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java index 38838688db4..86a432bcce4 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.MultiplyExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java index 5000ea8df31..65cc2842419 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.MultiplyExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java index a67b4999f7d..f6ea0168066 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.NegateExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java index 038f0149c83..50e5095be1c 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.NegateExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java index c74b7f752b3..d64757dec5d 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,11 +23,11 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.mathexact.sanity.SubtractExactIntTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java index 263059d2dfb..f3a024ac471 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,10 +23,10 @@ /* * @test - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.intrinsics.mathexact.sanity.SubtractExactLongTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/object/TestClone.java b/hotspot/test/compiler/intrinsics/object/TestClone.java index 1e966322a70..8bd3e882f29 100644 --- a/hotspot/test/compiler/intrinsics/object/TestClone.java +++ b/hotspot/test/compiler/intrinsics/object/TestClone.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,7 +27,7 @@ * @bug 8033626 * @summary assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -XX:-TieredCompilation -Xbatch * -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestClone::f diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java index 44fd2f3ab4f..7602829ce3b 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA1Intrinsics option processing on supported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java index a4d7f2a1694..558b4218f0b 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA1Intrinsics option processing on unsupported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java index 33e19ec322f..92e4c33eef9 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA256Intrinsics option processing on supported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java index c9f5ec5507a..3ed72bf0a99 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA256Intrinsics option processing on unsupported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java index b5f2ac242a3..d06494613fb 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA512Intrinsics option processing on supported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java index 26c989e256e..c05cf309dae 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA512Intrinsics option processing on unsupported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java index 7938712eca9..cc95d3c29ae 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,11 +25,11 @@ * @test * @bug 8035968 * @summary Verify UseSHA option processing on supported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java index 4a5a34c7ed0..58ce5366bae 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ * @test * @bug 8035968 * @summary Verify UseSHA option processing on unsupported CPU. - * @library /testlibrary /test/lib testcases / + * @library /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java index 24487f8a424..9d894947cdc 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.NotPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java index de67a394777..f072a2d60e8 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java index 64e60e84a95..0c8543341d8 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java index 469816055c6..196c23a3218 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java index 2b90bed816c..3f94cdf2e6b 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java @@ -24,7 +24,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java index 3618147de2e..e8b16e66056 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; import compiler.testlibrary.sha.predicate.IntrinsicPredicates; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java index 0a13cdb8c5e..63636149a13 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.Asserts; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java index 55e0f5b3ae8..4cb1a062e13 100644 --- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java +++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ package compiler.intrinsics.sha.cli.testcases; import compiler.intrinsics.sha.cli.SHAOptionsBase; import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.Asserts; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java index 71fd922ccf1..facfb7a4c8c 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-1 intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA1Intrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java index ffc81850f2a..001dd7f7def 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-1 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java index 85aa415fb7f..9a3c64397c5 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-256 intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java index 292e0d07ae6..6d8592d59aa 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-256 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java index de8be87349b..26cce563dc3 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-512 intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java index 0086412db82..29151dd5d7a 100644 --- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java +++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8035968 * @summary Verify that SHA-512 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.testlibrary.intrinsics.Verifier - * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/intrinsics/string/TestHasNegatives.java b/hotspot/test/compiler/intrinsics/string/TestHasNegatives.java index df75e4d8a0d..df8dd7a04c1 100644 --- a/hotspot/test/compiler/intrinsics/string/TestHasNegatives.java +++ b/hotspot/test/compiler/intrinsics/string/TestHasNegatives.java @@ -30,7 +30,6 @@ * @library /compiler/patches * * @build java.base/java.lang.Helper - * @build compiler.intrinsics.string.TestHasNegatives * @run main compiler.intrinsics.string.TestHasNegatives */ diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java index 6918b52d441..053445d505e 100644 --- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java @@ -26,7 +26,7 @@ * @bug 8144212 * @summary Check for correct memory flow with the String compress/inflate intrinsics. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main compiler.intrinsics.string.TestStringIntrinsicMemoryFlow */ diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java index c5ed25ca29a..3486950413e 100644 --- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java @@ -27,9 +27,8 @@ * @test * @bug 8155608 * @summary Verifies that string intrinsics throw array out of bounds exceptions. - * @library /compiler/patches /testlibrary /test/lib + * @library /compiler/patches /test/lib * @build java.base/java.lang.Helper - * @build compiler.intrinsics.string.TestStringIntrinsicRangeChecks * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation compiler.intrinsics.string.TestStringIntrinsicRangeChecks */ package compiler.intrinsics.string; diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java index ef3ffe14ce5..5c4f334afb4 100644 --- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -27,7 +27,7 @@ * @bug 8145336 * @summary PPC64: fix string intrinsics after CompactStrings change * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java b/hotspot/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java index 5c2765378a3..e35a5d70ea6 100644 --- a/hotspot/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java +++ b/hotspot/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java @@ -26,7 +26,7 @@ * @test * @bug 8026049 8151163 * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 DirectByteBufferTest * @run main/othervm -Djdk.test.lib.random.seed=0 DirectByteBufferTest * @summary Verify that direct byte buffers are correctly accessed. diff --git a/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java b/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java index e09fa47fa2f..d548a69440a 100644 --- a/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java +++ b/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java @@ -27,7 +27,7 @@ * @bug 8026049 8151163 * @summary Verify that byte buffers are correctly accessed. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 * HeapByteBufferTest diff --git a/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java b/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java index 7830744feb5..973b213e221 100644 --- a/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java +++ b/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,7 +27,7 @@ * @bug 8142386 * @summary Unsafe access to an array is wrongly marked as mismatched * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation * compiler.intrinsics.unsafe.TestUnsafeMismatchedArrayFieldAccess diff --git a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java index c1f92ef097c..ad4815add3d 100644 --- a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java +++ b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8022595 * @summary JSR292: deadlock during class loading of MethodHandles, MethodHandleImpl & MethodHandleNatives - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java index f932b627186..d9f2ddb1721 100644 --- a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java +++ b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java @@ -24,15 +24,15 @@ /** * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary / + * @library /test/lib / * * @run driver compiler.jsr292.ContinuousCallSiteTargetChange */ package compiler.jsr292; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandle; diff --git a/hotspot/test/compiler/jsr292/MHInlineTest.java b/hotspot/test/compiler/jsr292/MHInlineTest.java index 150b79e9ec2..df73ea9d9db 100644 --- a/hotspot/test/compiler/jsr292/MHInlineTest.java +++ b/hotspot/test/compiler/jsr292/MHInlineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,15 +26,15 @@ * @bug 8062280 * @summary C2: inlining failure due to access checks being too strict * @modules java.base/jdk.internal.misc - * @library /testlibrary / + * @library /test/lib / * * @run main/othervm compiler.jsr292.MHInlineTest */ package compiler.jsr292; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java index 93540ea0eab..32f29dff973 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ package compiler.jsr292.NonInlinedCall; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; import java.io.PrintStream; diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java index 02b06fa78d4..8ae54321848 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8072008 - * @library /testlibrary /test/lib ../patches + * @library /test/lib ../patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.vm.annotation * diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 15ca369a2bb..c9569d09f54 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,12 @@ /* * @test * @bug 8072008 - * @library /testlibrary /test/lib / ../patches + * @library /test/lib / ../patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.vm.annotation * * @build java.base/java.lang.invoke.MethodHandleHelper * sun.hotspot.WhiteBox - * compiler.jsr292.NonInlinedCall.InvokeTest * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index dbd9f927478..806b7490893 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -27,7 +27,7 @@ * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.base/jdk.internal.vm.annotation - * @library /testlibrary /test/lib / ../patches + * @library /test/lib / ../patches * @requires vm.flavor != "minimal" * * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jsr292/PollutedTrapCounts.java b/hotspot/test/compiler/jsr292/PollutedTrapCounts.java index 9090513567b..438cefd8d78 100644 --- a/hotspot/test/compiler/jsr292/PollutedTrapCounts.java +++ b/hotspot/test/compiler/jsr292/PollutedTrapCounts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,15 +25,15 @@ * @test * @bug 8074551 * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * * @run driver compiler.jsr292.PollutedTrapCounts */ package compiler.jsr292; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; diff --git a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java index 28036f361a9..8abfeb20d92 100644 --- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java +++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.runtime * @run main/othervm -XX:+UnlockExperimentalVMOptions diff --git a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java index 529f7acc6c1..5284fd2c4f4 100644 --- a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java +++ b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java index e9608ee4817..b6e9f7e73ca 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -33,9 +33,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.AllocateCompileIdTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. @@ -49,7 +47,7 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; import jdk.test.lib.Asserts; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java index dea8cb2d7f4..9fdb7c7589d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,9 +34,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.CanInlineMethodTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java index 46beea77080..b3627b73387 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib/ + * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.CollectCountersTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run main/othervm -XX:+UnlockExperimentalVMOptions * -XX:+EnableJVMCI * -XX:JVMCICounterSize=0 diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java b/hotspot/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java index 697aee29904..7bc8b99c9ef 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; import compiler.testlibrary.CompilerUtils; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.Utils; import jdk.vm.ci.code.InstalledCode; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java index b2477b73639..13caa191f7d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.DebugOutputTest * @run main/othervm compiler.jvmci.compilerToVM.DebugOutputTest */ @@ -38,8 +37,8 @@ package compiler.jvmci.compilerToVM; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.vm.ci.hotspot.CompilerToVMHelper; import java.util.Arrays; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 8bb3820593d..317ce0b6859 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -35,9 +35,7 @@ * jdk.vm.ci/jdk.vm.ci.code * * @ignore 8139700 - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.DisassembleCodeBlobTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java index 2390557a8ad..e9e1622a3da 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,9 +34,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.DoNotInlineOrCompileTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index c6a36fc969a..90113dc5577 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -1,7 +1,7 @@ package compiler.jvmci.compilerToVM; import jdk.test.lib.Asserts; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.Utils; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; @@ -17,7 +17,7 @@ import java.util.List; * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @ignore 8139383 * @modules java.base/jdk.internal.misc @@ -25,9 +25,7 @@ import java.util.List; * java.base/jdk.internal.org.objectweb.asm.tree * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java index 5eccc6d1164..32959f2dd86 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -35,7 +35,6 @@ * jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java index 6bd182bc293..ecfdc11bd1c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,7 +34,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetBytecodeTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetBytecodeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java index c20b668f17a..8204043b223 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetClassInitializerTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetClassInitializerTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java index 097d42e5235..3d8ab325044 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -36,7 +36,6 @@ * jdk.vm.ci/jdk.vm.ci.code * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetConstantPoolTest * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java index 3e5ada1383a..a479ba4401f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,7 +34,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetExceptionTableTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetExceptionTableTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java index dd0841d5995..d9dd305aaf7 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib/ + * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetImplementorTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetImplementorTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java index ac99a5c21f4..e86d2ab7675 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @library ../common/patches * @modules java.base/jdk.internal.misc @@ -35,7 +35,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetLineNumberTableTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetLineNumberTableTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java index 7d3b0971679..5c551360ca7 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -38,7 +38,6 @@ * @compile -g DummyAbstractClass.java * @compile -g DummyClass.java * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetLocalVariableTableTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetLocalVariableTableTest * @clean compiler.jvmci.compilerToVM.* diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java index fcdf29e3073..438eab27d05 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib/ + * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java index b0c0d50a202..110c2cbe1bb 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,7 +34,6 @@ * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.meta * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetNextStackFrameTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetNextStackFrameTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java index c8633398381..49a6e3826bf 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -35,7 +35,6 @@ * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.meta * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetNextStackFrameTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetResolvedJavaMethodAtSlotTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java index a893c714eac..c04196acf5b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,14 +25,14 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject - * @build compiler.jvmci.compilerToVM.GetResolvedJavaMethodTest + * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java index 2ed3686d321..4d0d5b84445 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot @@ -34,8 +34,7 @@ * @ignore 8158860 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject - * @build compiler.jvmci.compilerToVM.GetResolvedJavaTypeTest - * @build sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java index ec4458a657c..6f647dc06fe 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,7 +34,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetStackTraceElementTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetStackTraceElementTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java index 78922fa4ecf..d8f256f0b52 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,7 +34,6 @@ * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.meta * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetSymbolTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetSymbolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java index a8a83d1e8aa..50c66cc7cbc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -33,7 +33,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java index 734964722bd..91c12f6b733 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,9 +34,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java index dfb0d78b88a..3c924901b59 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.HasFinalizableSubclassTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.HasFinalizableSubclassTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java index c4626d26264..5e8c75aee1a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.InitializeConfigurationTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.InitializeConfigurationTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java index 23ff0b9685a..5c245a07714 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * * @ignore 8139700 - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java index 1855ca27398..9668ec48c40 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,13 +25,12 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * ../common/patches * @modules java.base/jdk.internal.misc * jdk.vm.ci/jdk.vm.ci.hotspot * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * compiler.jvmci.compilerToVM.IsMatureTest * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java index ef32f138dd9..91645ac6304 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.runtime diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java index f036f0e2770..645871fad70 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java @@ -27,7 +27,7 @@ * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -37,9 +37,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupKlassInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java index 6e1729689b9..5b47f4f51dc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java index 4b4c498de05..bf6e66e946a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupMethodInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java index 88cc6944444..d88031530db 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java index a43a45347d4..de25e244060 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -38,7 +38,6 @@ * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupNameInPoolTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java index d5afc82d7a6..9eba654e77c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -38,7 +38,6 @@ * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.LookupSignatureInPoolTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java index 437b5616f2a..20d57babd97 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.LookupTypeTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.LookupTypeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java index 7607d39a6aa..c4068a1254d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,7 +27,7 @@ * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") * & (vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true) * @summary no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xmixed -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java index e732faa5bdb..41579035464 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.reflect @@ -35,7 +35,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java index d9aa0b17aff..70f9d5fe259 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 3) - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -35,9 +35,7 @@ * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * @build compiler.jvmci.compilerToVM.ReprofileTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java index ba23d6a432d..ca82575fe96 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -35,9 +35,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.ResolveConstantInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java index 6d6035438aa..a7307936124 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.ResolveFieldInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java index 389f5583c01..b6164e0c4d2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -33,7 +33,6 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.ResolveMethodTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.ResolveMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java index 49a3cbd1986..45c32d93c0c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java @@ -26,7 +26,7 @@ * @test * @bug 8138708 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java index 26fc8f86b85..3f7b85745a2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java @@ -27,7 +27,7 @@ * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect @@ -36,9 +36,7 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build sun.hotspot.WhiteBox - * compiler.jvmci.compilerToVM.ResolveTypeInPoolTest + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java index cbca06a757b..2e66c2eefec 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary /test/lib/ + * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.ShouldDebugNonSafepointsTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockDiagnosticVMOptions * -XX:+DebugNonSafepoints diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java index c86ff4d7faa..61b702902a2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -34,9 +34,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @build compiler.jvmci.compilerToVM.ShouldInlineMethodTest - * @build sun.hotspot.WhiteBox + * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index 1f696dfa341..4cc352451dc 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -31,7 +31,6 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.common * @compile CodeInstallerTest.java - * @build compiler.jvmci.errors.TestInvalidCompilationResult * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult */ diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java index bcfc52f64b7..276ca0a9975 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java @@ -25,7 +25,7 @@ * @test * @bug 8156034 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm @@ -37,7 +37,6 @@ * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.common.JVMCIHelpers - * compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/ * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config * ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener @@ -46,9 +45,6 @@ * compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory * compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult * compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener - * compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest - * jdk.test.lib.Asserts - * jdk.test.lib.Utils * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. * -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index 6f5c83ab068..59ea3637691 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library / /testlibrary + * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm @@ -38,7 +38,6 @@ * * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.common.JVMCIHelpers - * compiler.jvmci.events.JvmciNotifyInstallEventTest * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/ * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyInstallEventTest.config * ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener @@ -46,12 +45,7 @@ * compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler * compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory * compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult - * compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener - * compiler.jvmci.events.JvmciNotifyInstallEventTest - * compiler.jvmci.common.CTVMUtilities - * compiler.jvmci.common.testcases.SimpleClass - * jdk.test.lib.Asserts - * jdk.test.lib.Utils + * compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Xbootclasspath/a:. -Xmixed * -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI diff --git a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java index d01d2784195..da60be0f3ff 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java @@ -25,7 +25,7 @@ * @test * @bug 8136421 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code @@ -34,7 +34,6 @@ * * @build compiler.jvmci.common.JVMCIHelpers * compiler.jvmci.events.JvmciShutdownEventListener - * compiler.jvmci.events.JvmciShutdownEventTest * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/ * @run driver jdk.test.lib.FileInstaller ./JvmciShutdownEventTest.config * ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener @@ -49,7 +48,7 @@ package compiler.jvmci.events; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; public class JvmciShutdownEventTest { diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java index c7bb20568d8..ccbc9d981a3 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java @@ -24,7 +24,7 @@ /** * @test * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" - * @library /test/lib /testlibrary / + * @library /test/lib / * @modules jdk.vm.ci/jdk.vm.ci.hotspot * jdk.vm.ci/jdk.vm.ci.code * jdk.vm.ci/jdk.vm.ci.code.site diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java index 5c9c7c68ce1..c820b7ede33 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java @@ -29,7 +29,7 @@ * jdk.vm.ci/jdk.vm.ci.hotspot * java.base/jdk.internal.vm.annotation * java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src + * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @build jdk.vm.ci.hotspot.test.DummyClass * @run driver ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass * @run testng/othervm/timeout=300 -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java index 03e7f68c273..e99f7bbf9a5 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java @@ -25,7 +25,7 @@ * @test * @bug 8152341 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src + * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.common * jdk.vm.ci/jdk.vm.ci.runtime diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java index c94d47a2bca..601b1925bea 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java @@ -26,7 +26,7 @@ * @bug 8152343 * @bug 8161068 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src + * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.hotspot diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java index f345bad4277..69323c14ab0 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.ConstantTest * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java index a93f934ebc5..f56aa751d5f 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.RedefineClassTest * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java index ab66c985554..5d91756350e 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestConstantReflectionProvider * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java index 15e4959e043..622c25e0624 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestJavaField * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java index a7a2e748cf2..5af25f8057a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestJavaMethod * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java index 4b38875b9fd..66e50693f9a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestJavaType * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java index cae386efa47..4352654767d 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestMetaAccessProvider * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 50857482f1d..3c15295d277 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestResolvedJavaField * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index 3333734e64e..7805d193ec1 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -28,7 +28,6 @@ * @modules jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestResolvedJavaMethod * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java index 42d340fb1b9..84a6b0f0414 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -31,7 +31,6 @@ * jdk.vm.ci/jdk.vm.ci.runtime * jdk.vm.ci/jdk.vm.ci.common * java.base/jdk.internal.misc - * @build jdk.vm.ci.runtime.test.TestResolvedJavaType * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType */ diff --git a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java index d06278e3923..25bc2a905db 100644 --- a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java +++ b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java @@ -25,7 +25,7 @@ * @test * @bug 8151664 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * jdk.vm.ci/jdk.vm.ci.hotspot diff --git a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java index 77a9445642a..0bf9185f7f5 100644 --- a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 6869327 * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @ignore 8146096 * @run driver compiler.loopopts.UseCountedLoopSafepoints @@ -34,8 +34,8 @@ package compiler.loopopts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.util.concurrent.atomic.AtomicLong; diff --git a/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java b/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java index 8ef4cde5806..02361b9719c 100644 --- a/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java +++ b/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,7 +27,7 @@ * @bug 8078497 * @summary Tests correct alignment of vectors with loop invariant offset. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main compiler.loopopts.superword.TestVectorizationWithInvariant */ diff --git a/hotspot/test/compiler/onSpinWait/TestOnSpinWait.java b/hotspot/test/compiler/onSpinWait/TestOnSpinWait.java index 97c3ab63dcf..903bc5fe1c8 100644 --- a/hotspot/test/compiler/onSpinWait/TestOnSpinWait.java +++ b/hotspot/test/compiler/onSpinWait/TestOnSpinWait.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -26,7 +26,7 @@ * @test TestOnSpinWait * @summary (x86 only) checks that java.lang.Thread.onSpinWait is intrinsified * @bug 8147844 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @requires os.arch=="x86" | os.arch=="amd64" | os.arch=="x86_64" * @run driver compiler.onSpinWait.TestOnSpinWait @@ -34,8 +34,8 @@ package compiler.onSpinWait; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestOnSpinWait { diff --git a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java index 10e71b43b11..39aaf59daf2 100644 --- a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java +++ b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test CheckCompileCommandOption * @summary Checks parsing of -XX:CompileCommand=option * @bug 8055286 8056964 8059847 8069035 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver compiler.oracle.CheckCompileCommandOption @@ -33,8 +33,8 @@ package compiler.oracle; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; diff --git a/hotspot/test/compiler/oracle/GetMethodOptionTest.java b/hotspot/test/compiler/oracle/GetMethodOptionTest.java index 2da784c41c7..dad9e8952fd 100644 --- a/hotspot/test/compiler/oracle/GetMethodOptionTest.java +++ b/hotspot/test/compiler/oracle/GetMethodOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,9 +24,9 @@ /* * @test * @bug 8074980 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts compiler.oracle.GetMethodOptionTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/oracle/MethodMatcherTest.java b/hotspot/test/compiler/oracle/MethodMatcherTest.java index 3e7f1a09471..6855429d823 100644 --- a/hotspot/test/compiler/oracle/MethodMatcherTest.java +++ b/hotspot/test/compiler/oracle/MethodMatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test MethodMatcherTest * @summary Testing of compiler/MethodMatcher * @bug 8135068 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/oracle/TestCompileCommand.java b/hotspot/test/compiler/oracle/TestCompileCommand.java index d8ba4aa2987..7308e18f007 100644 --- a/hotspot/test/compiler/oracle/TestCompileCommand.java +++ b/hotspot/test/compiler/oracle/TestCompileCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test TestCompileCommand * @bug 8069389 * @summary Regression tests of -XX:CompileCommand - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver compiler.oracle.TestCompileCommand @@ -33,8 +33,8 @@ package compiler.oracle; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestCompileCommand { diff --git a/hotspot/test/compiler/print/TestProfileReturnTypePrinting.java b/hotspot/test/compiler/print/TestProfileReturnTypePrinting.java index a09d9d35268..15f60ac3e77 100644 --- a/hotspot/test/compiler/print/TestProfileReturnTypePrinting.java +++ b/hotspot/test/compiler/print/TestProfileReturnTypePrinting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,6 @@ /** * @test * @bug 8073154 - * @build compiler.print.TestProfileReturnTypePrinting * @run main/othervm -XX:TypeProfileLevel=020 * -XX:CompileCommand=compileonly,compiler.print.TestProfileReturnTypePrinting::testMethod * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintLIR diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java index 95593898201..68cd5f23e89 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8038636 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.instrument * java.management diff --git a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java index 328c5bc468e..81778997993 100644 --- a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java +++ b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8040237 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.instrument * java.management diff --git a/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java index d712535fb03..232134d9fcd 100644 --- a/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java +++ b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java @@ -25,11 +25,10 @@ * @test * @bug 8073480 * @summary explicit range checks should be recognized by C2 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc - * @build compiler.rangechecks.TestExplicitRangeChecks + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * jdk.test.lib.Platform * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement * -XX:CompileCommand=compileonly,compiler.rangechecks.TestExplicitRangeChecks::test* diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java index 17c43270c51..85fd007b41d 100644 --- a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,10 @@ * @test * @bug 8066103 * @summary C2's range check smearing allows out of bound array accesses - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rangechecks.TestRangeCheckSmearing * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * jdk.test.lib.Platform * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement * compiler.rangechecks.TestRangeCheckSmearing diff --git a/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java index 50784c5cc48..7fa09b885f8 100644 --- a/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java +++ b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java @@ -24,7 +24,7 @@ package compiler.rtm.cli; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java index aad6397e8fc..6fcc2799aa9 100644 --- a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java +++ b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java index e8c9d17d8f6..b1dbafe95d4 100644 --- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java +++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ package compiler.rtm.cli; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java index e48cfecdb9d..02f8acdc356 100644 --- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify PrintPreciseRTMLockingStatistics on CPUs with * rtm support and on VM with rtm locking support, - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java index aeec5262805..3efcbf54eaa 100644 --- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,7 +27,7 @@ * @bug 8031320 * @summary Verify PrintPreciseRTMLockingStatistics on CPUs without * rtm support and/or unsupported VM. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java index 2d16a62c387..3a1e2ccc8da 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify RTMAbortRatio option processing on CPU with rtm * support and on VM with rtm locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java index 5921ae7e657..1fec34e405f 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify RTMAbortRatio option processing on CPU without rtm * support or on VM that does not support rtm locking. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnUnsupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java index 7444280bf4a..10b87c2d9ad 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of RTMAbortThreshold option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMAbortThresholdOption * @run main/othervm compiler.rtm.cli.TestRTMAbortThresholdOption */ diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java index 35213b46ec6..161573a2076 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of RTMLockingCalculationDelay option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMLockingCalculationDelayOption * @run main/othervm compiler.rtm.cli.TestRTMLockingCalculationDelayOption */ diff --git a/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java index 91a5bff7ee0..dab87dca926 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of RTMLockingThreshold option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMLockingThresholdOption * @run main/othervm compiler.rtm.cli.TestRTMLockingThresholdOption */ diff --git a/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java index d77c0013a78..50b200a870b 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMRetryCountOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of RTMRetryCount option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMRetryCountOption * @run main/othervm compiler.rtm.cli.TestRTMRetryCountOption */ diff --git a/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java index dc9ebf759ff..f8e0e64e470 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of RTMSpinLoopCount option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMSpinLoopCountOption * @run main/othervm compiler.rtm.cli.TestRTMSpinLoopCountOption */ diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java index b21aac408a2..60336331cb5 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify RTMTotalCountIncrRate option processing on CPU with * rtm support and on VM with rtm locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java index 886d0c339c2..fcbbfe7882e 100644 --- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify RTMTotalCountIncrRate option processing on CPU without * rtm support and/or on VM without rtm locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnUnsupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java index 001a826ab88..e674b46ebd6 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMDeopt option processing on CPUs with rtm support * when rtm locking is supported by VM. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java index 385a7c70d3a..e6397317e8f 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMDeopt option processing on CPUs without rtm support * or on VMs without rtm locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnUnsupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java index 532e68dd5b4..9e2163bb26f 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMForStackLocks option processing on CPU with * rtm support when VM supports rtm locking. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java index 563fec15126..84251d57807 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMForStackLocks option processing on CPUs without * rtm support and/or on VMs without rtm locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnUnsupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java index b82badc2858..b0694e7508d 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMLocking option processing on CPU with rtm support and * on VM with rtm-locking support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java index 25e173e12f3..3df10408910 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMLocking option processing on CPU without * rtm support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java index f042a9d3b64..510ede5c934 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify UseRTMLocking option processing on CPU with rtm support * in case when VM should not support this option. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedVM + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java index cc004bd0aac..3aeab02004d 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,11 @@ * @bug 8031320 * @summary Verify processing of UseRTMLocking and UseBiasedLocking * options combination on CPU and VM with rtm support. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMLockingOptionWithBiasedLocking + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -43,7 +43,7 @@ package compiler.rtm.cli; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java index 5d365b7e7b3..ec8f3fec04a 100644 --- a/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @test * @bug 8031320 * @summary Verify processing of UseRTMXendForLockBusy option. - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.rtm.cli.TestUseRTMXendForLockBusyOption * @run main/othervm compiler.rtm.cli.TestUseRTMXendForLockBusyOption */ diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java index 893fbc80bc2..6605ef1adcf 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMAbortRatio affects amount of aborts before * deoptimization. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMAbortRatio + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -48,7 +48,7 @@ import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java index 2d8492ec8e9..6090fa19592 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMAbortThreshold option affects * amount of aborts after which abort ratio is calculated. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMAbortThreshold + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java index 606ed8cf7f8..4f43be68d4f 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,10 +29,10 @@ * caused by reason other then rtm_state_change will reset * method's RTM state. And if we don't use RTMDeopt, then * RTM state remain the same after such deoptimization. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMAfterNonRTMDeopt + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -50,7 +50,7 @@ import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java index f53a32c9f58..0633d8ab016 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that on high abort ratio method will be recompiled * without rtm locking. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMDeoptOnHighAbortRatio + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java index 567ec6278a1..9386321d7d0 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test * @bug 8031320 * @summary Verify that on low abort ratio method will be recompiled. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMDeoptOnLowAbortRatio + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java index 7c6ee4658bc..33e263cb940 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMLockingCalculationDelay affect when * abort ratio calculation is started. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMLockingCalculationDelay + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -46,7 +46,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java index d3ce56ca214..0f6ccbf591e 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMLockingThreshold affects rtm state transition * ProfileRTM => UseRTM. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMLockingThreshold + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -48,7 +48,7 @@ import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java index 2a1fc7d8871..5526e096c91 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test * @bug 8031320 * @summary Verify that RTMRetryCount affects actual amount of retries. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMRetryCount + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -46,7 +46,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java index f6e849e76eb..61dc2bcccb7 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMSpinLoopCount affects time spent * between locking attempts. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMSpinLoopCount + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java index 6ae82df25d4..29f560d39f0 100644 --- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java +++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that RTMTotalCountIncrRate option affects * RTM locking statistics. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestRTMTotalCountIncrRate + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -48,7 +48,7 @@ import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java index be13c8096e3..f7a752f87fa 100644 --- a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java +++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that rtm locking is used for stack locks before * inflation and after it used for inflated locks. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestUseRTMAfterLockInflation + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java index 05578b60d72..d9cf61552e4 100644 --- a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java +++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that UseRTMDeopt affects uncommon trap installation in * copmpiled methods with synchronized block. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestUseRTMDeopt + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -46,7 +46,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java index 94c4978d1f2..038496e310a 100644 --- a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java +++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test * @bug 8031320 * @summary Verify that rtm locking is used for inflated locks. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestUseRTMForInflatedLocks + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -45,7 +45,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java index 6bb2646b745..cdb854a8dcc 100644 --- a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java +++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test * @bug 8031320 * @summary Verify that rtm locking is used for stack locks. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestUseRTMForStackLocks + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -46,7 +46,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java index d8dc7ca8f98..936e7c970b3 100644 --- a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java +++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that UseRTMXendForLockBusy option affects * method behaviour if lock is busy. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.locking.TestUseRTMXendForLockBusy + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -48,7 +48,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java index 30d747e0fe0..d92cb70bff8 100644 --- a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java +++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,10 +27,10 @@ * @bug 8031320 * @summary Verify that NoRTMLockEliding option could be applied to * specified method and that such method will not use rtm. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.method_options.TestNoRTMLockElidingOption + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -47,7 +47,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java index 50808348c0e..b649715510f 100644 --- a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java +++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,10 +28,10 @@ * @summary Verify that UseRTMLockEliding option could be applied to * specified method and that such method will not be deoptimized * on high abort ratio. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.method_options.TestUseRTMLockElidingOption + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -48,7 +48,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java index adeed6d3ec5..e9ec090799b 100644 --- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java +++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,10 +29,10 @@ * on overall aborts and locks count and count of aborts of * different types. Test also verify that VM output does not * contain rtm locking statistics when it should not. - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.rtm.print.TestPrintPreciseRTMLockingStatistics + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -50,7 +50,7 @@ import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; diff --git a/hotspot/test/compiler/runtime/Test8010927.java b/hotspot/test/compiler/runtime/Test8010927.java index 64dc5cab142..ba50aeb9647 100644 --- a/hotspot/test/compiler/runtime/Test8010927.java +++ b/hotspot/test/compiler/runtime/Test8010927.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,9 +25,9 @@ * @test * @bug 8010927 * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy - * @library /test/lib /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build compiler.runtime.Test8010927 + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions diff --git a/hotspot/test/compiler/runtime/cr8015436/Test8015436.java b/hotspot/test/compiler/runtime/cr8015436/Test8015436.java index 256f352b87e..0e44c7e8fcd 100644 --- a/hotspot/test/compiler/runtime/cr8015436/Test8015436.java +++ b/hotspot/test/compiler/runtime/cr8015436/Test8015436.java @@ -25,10 +25,9 @@ * @test * @bug 8015436 * @summary the IK _initial_method_idnum value must be adjusted if overpass methods are added - * @library /test/lib/share/classes / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @build compiler.runtime.cr8015436.Test8015436 - * compiler.runtime.cr8015436.Driver8015436 * * @run driver compiler.runtime.cr8015436.Driver8015436 */ diff --git a/hotspot/test/compiler/stable/TestStableBoolean.java b/hotspot/test/compiler/stable/TestStableBoolean.java index dbb9705e0dd..505d0e3f643 100644 --- a/hotspot/test/compiler/stable/TestStableBoolean.java +++ b/hotspot/test/compiler/stable/TestStableBoolean.java @@ -26,11 +26,10 @@ /* * @test TestStableBoolean * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableBoolean * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableByte.java b/hotspot/test/compiler/stable/TestStableByte.java index 5561b4b34e6..b0d703fe89f 100644 --- a/hotspot/test/compiler/stable/TestStableByte.java +++ b/hotspot/test/compiler/stable/TestStableByte.java @@ -26,11 +26,10 @@ /* * @test TestStableByte * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableByte * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableChar.java b/hotspot/test/compiler/stable/TestStableChar.java index 8a1f51ec78e..bcd3154e89f 100644 --- a/hotspot/test/compiler/stable/TestStableChar.java +++ b/hotspot/test/compiler/stable/TestStableChar.java @@ -26,11 +26,10 @@ /* * @test TestStableChar * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableChar * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableDouble.java b/hotspot/test/compiler/stable/TestStableDouble.java index ff96b2c7c6a..6bc5644c78a 100644 --- a/hotspot/test/compiler/stable/TestStableDouble.java +++ b/hotspot/test/compiler/stable/TestStableDouble.java @@ -26,11 +26,10 @@ /* * @test TestStableDouble * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableDouble * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableFloat.java b/hotspot/test/compiler/stable/TestStableFloat.java index ab879c5c242..82696a5e56f 100644 --- a/hotspot/test/compiler/stable/TestStableFloat.java +++ b/hotspot/test/compiler/stable/TestStableFloat.java @@ -26,11 +26,10 @@ /* * @test TestStableFloat * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableFloat * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableInt.java b/hotspot/test/compiler/stable/TestStableInt.java index e203a269421..35a7ad5274a 100644 --- a/hotspot/test/compiler/stable/TestStableInt.java +++ b/hotspot/test/compiler/stable/TestStableInt.java @@ -26,11 +26,10 @@ /* * @test TestStableInt * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableInt * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableLong.java b/hotspot/test/compiler/stable/TestStableLong.java index 11e6a95416c..dd3cd8290b4 100644 --- a/hotspot/test/compiler/stable/TestStableLong.java +++ b/hotspot/test/compiler/stable/TestStableLong.java @@ -26,11 +26,10 @@ /* * @test TestStableLong * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableLong * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableObject.java b/hotspot/test/compiler/stable/TestStableObject.java index 58affb9a76b..70a3c8fce21 100644 --- a/hotspot/test/compiler/stable/TestStableObject.java +++ b/hotspot/test/compiler/stable/TestStableObject.java @@ -26,11 +26,10 @@ /* * @test TestStableObject * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableObject * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableShort.java b/hotspot/test/compiler/stable/TestStableShort.java index d893f8d56be..66825505e81 100644 --- a/hotspot/test/compiler/stable/TestStableShort.java +++ b/hotspot/test/compiler/stable/TestStableShort.java @@ -26,11 +26,10 @@ /* * @test TestStableShort * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableShort * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4 diff --git a/hotspot/test/compiler/stable/TestStableUByte.java b/hotspot/test/compiler/stable/TestStableUByte.java index 5431345f757..6a6135f58f0 100644 --- a/hotspot/test/compiler/stable/TestStableUByte.java +++ b/hotspot/test/compiler/stable/TestStableUByte.java @@ -26,11 +26,10 @@ /* * @test TestStableUByte * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableUByte * * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp diff --git a/hotspot/test/compiler/stable/TestStableUShort.java b/hotspot/test/compiler/stable/TestStableUShort.java index 88f5cb46119..28b12a23144 100644 --- a/hotspot/test/compiler/stable/TestStableUShort.java +++ b/hotspot/test/compiler/stable/TestStableUShort.java @@ -26,11 +26,10 @@ /* * @test TestStableUShort * @summary tests on stable fields and arrays - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * @build sun.hotspot.WhiteBox - * @build compiler.stable.TestStableUShort * * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp diff --git a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java index 7abfc6314cb..0491e1c69fd 100644 --- a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java +++ b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test * @bug 8034775 * @summary Ensures correct minimal number of compiler threads (provided by -XX:CICompilerCount=) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -34,9 +34,9 @@ package compiler.startup; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class NumCompilerThreadsCheck { diff --git a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java index 2ff643765ab..a361baa1920 100644 --- a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java +++ b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,7 +27,7 @@ * @summary Test ensures that there is no crash if there is not enough ReservedCodeCacheSize * to initialize all compiler threads. The option -Xcomp gives the VM more time to * trigger the old bug. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -37,8 +37,8 @@ package compiler.startup; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import static jdk.test.lib.Asserts.assertTrue; diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java index b8cd3157d59..d2525625d57 100644 --- a/hotspot/test/compiler/startup/StartupOutput.java +++ b/hotspot/test/compiler/startup/StartupOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 8026949 * @summary Test ensures correct VM output during startup - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @@ -34,8 +34,8 @@ package compiler.startup; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class StartupOutput { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java b/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java index 65cbf0a65d7..5fde3f21753 100644 --- a/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java +++ b/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,8 +24,8 @@ package compiler.testlibrary.rtm; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java b/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java index 6393f5c9268..37288d50ee3 100644 --- a/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java +++ b/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,11 +24,11 @@ /** * @test ConstantGettersTransitionsTest * @summary Test the correctness of compilation level transitions for constant getters methods - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.tiered.TransitionsTestExecutor + * @build sun.hotspot.WhiteBox * compiler.tiered.ConstantGettersTransitionsTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/tiered/LevelTransitionTest.java b/hotspot/test/compiler/tiered/LevelTransitionTest.java index d49d995ef33..6730c181242 100644 --- a/hotspot/test/compiler/tiered/LevelTransitionTest.java +++ b/hotspot/test/compiler/tiered/LevelTransitionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,12 +24,12 @@ /** * @test LevelTransitionTest * @summary Test the correctness of compilation level transitions for different methods - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * * @ignore 8067651 - * @build compiler.tiered.TransitionsTestExecutor compiler.tiered.LevelTransitionTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java index 3973bdc5d3a..45d039f7551 100644 --- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,11 +24,11 @@ /** * @test NonTieredLevelsTest * @summary Verify that only one level can be used - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * @requires vm.opt.TieredStopAtLevel==null - * @build compiler.tiered.NonTieredLevelsTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java index 768022ba3a0..1e23648f907 100644 --- a/hotspot/test/compiler/tiered/TieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,11 +24,11 @@ /** * @test TieredLevelsTest * @summary Verify that all levels < 'TieredStopAtLevel' can be used - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build compiler.tiered.TieredLevelsTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation diff --git a/hotspot/test/compiler/tiered/TransitionsTestExecutor.java b/hotspot/test/compiler/tiered/TransitionsTestExecutor.java index 832678bd862..1869842a860 100644 --- a/hotspot/test/compiler/tiered/TransitionsTestExecutor.java +++ b/hotspot/test/compiler/tiered/TransitionsTestExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,8 +24,8 @@ package compiler.tiered; import compiler.whitebox.CompilerWhiteBoxTest; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; diff --git a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java index a5cf25d090b..180508664ce 100644 --- a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java +++ b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java @@ -27,7 +27,7 @@ * @summary C2 can not handle returns with inccompatible interface arrays * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/types/correctness/CorrectnessTest.java b/hotspot/test/compiler/types/correctness/CorrectnessTest.java index 15a5bba240b..9198a3ea2f4 100644 --- a/hotspot/test/compiler/types/correctness/CorrectnessTest.java +++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,12 +26,12 @@ * @bug 8038418 * @summary Tests correctness of type usage with type profiling and speculations * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * * @ignore 8066173 - * @build compiler.types.correctness.CorrectnessTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions diff --git a/hotspot/test/compiler/types/correctness/OffTest.java b/hotspot/test/compiler/types/correctness/OffTest.java index ad623fe2cb5..a88387e71c3 100644 --- a/hotspot/test/compiler/types/correctness/OffTest.java +++ b/hotspot/test/compiler/types/correctness/OffTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,12 +24,12 @@ /* * @test CorrectnessTest * @bug 8038418 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * * @ignore 8066173 - * @build compiler.types.correctness.OffTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=1200 compiler.types.correctness.OffTest @@ -38,8 +38,8 @@ package compiler.types.correctness; import compiler.types.correctness.scenarios.ProfilingType; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import java.util.Random; diff --git a/hotspot/test/compiler/uncommontrap/DeoptReallocFailure.java b/hotspot/test/compiler/uncommontrap/DeoptReallocFailure.java index 03636892492..218eb2e3656 100644 --- a/hotspot/test/compiler/uncommontrap/DeoptReallocFailure.java +++ b/hotspot/test/compiler/uncommontrap/DeoptReallocFailure.java @@ -24,7 +24,7 @@ /* * @test * @bug 8146416 - * @library /test/lib /testlibrary / + * @library /test/lib / * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/uncommontrap/Test8009761.java b/hotspot/test/compiler/uncommontrap/Test8009761.java index df9141e3db6..c9f4897c401 100644 --- a/hotspot/test/compiler/uncommontrap/Test8009761.java +++ b/hotspot/test/compiler/uncommontrap/Test8009761.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test * @bug 8009761 * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * - * @build compiler.uncommontrap.Test8009761 + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java index 25e4413949a..84f53c89246 100644 --- a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java +++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,16 +24,14 @@ /* * @test * @bug 8030976 8059226 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * - * @build compiler.uncommontrap.TestUnstableIfTrap - * jdk.test.lib.* - * compiler.testlibrary.uncommontrap.Verifier + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java index 82661b28271..e2e315818c9 100644 --- a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java +++ b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java @@ -26,7 +26,7 @@ /* * @test * @summary tests on constant folding of unsafe get operations - * @library /testlibrary + * @library /test/lib * * @requires vm.flavor == "server" * diff --git a/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java b/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java index 956e993e2ce..bc321049b1d 100644 --- a/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java +++ b/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java @@ -26,7 +26,7 @@ /* * @test * @summary tests on constant folding of unsafe get operations from stable arrays - * @library /testlibrary + * @library /test/lib * * @requires vm.flavor == "server" * diff --git a/hotspot/test/compiler/unsafe/UnsafeRaw.java b/hotspot/test/compiler/unsafe/UnsafeRaw.java index af1a1cd0b96..269ca5483e9 100644 --- a/hotspot/test/compiler/unsafe/UnsafeRaw.java +++ b/hotspot/test/compiler/unsafe/UnsafeRaw.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test * @bug 8058744 * @summary Invalid pattern-matching of address computations in raw unsafe - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -Xbatch compiler.unsafe.UnsafeRaw diff --git a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java index 8f6517621cf..def44007470 100644 --- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java +++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test AllocationCodeBlobTest * @summary testing of WB::allocate/freeCodeBlob() * @bug 8059624 8064669 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.AllocationCodeBlobTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -45,7 +45,7 @@ package compiler.whitebox; import jdk.test.lib.Asserts; -import jdk.test.lib.InfiniteLoop; +import jdk.test.lib.wrappers.InfiniteLoop; import sun.hotspot.WhiteBox; import sun.hotspot.code.BlobType; diff --git a/hotspot/test/compiler/whitebox/BlockingCompilation.java b/hotspot/test/compiler/whitebox/BlockingCompilation.java index a89ab057e3d..d645352a7ae 100644 --- a/hotspot/test/compiler/whitebox/BlockingCompilation.java +++ b/hotspot/test/compiler/whitebox/BlockingCompilation.java @@ -26,9 +26,8 @@ * @bug 8150646 8153013 * @summary Add support for blocking compiles through whitebox API * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / + * @library /test/lib / * @build sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java index d0a06f99c56..55a0eaec92f 100644 --- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java +++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test ClearMethodStateTest * @bug 8006683 8007288 8022832 * @summary testing of WB::clearMethodState() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.ClearMethodStateTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index 2a718fcc3e2..3025b1e332b 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test DeoptimizeAllTest * @bug 8006683 8007288 8022832 * @summary testing of WB::deoptimizeAll() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.DeoptimizeAllTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java index 62f4154fb42..87c66ceb39e 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ * @test DeoptimizeFramesTest * @bug 8028595 * @summary testing of WB::deoptimizeFrames() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.DeoptimizeFramesTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index f505bbd5897..7331faeca0b 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test DeoptimizeMethodTest * @bug 8006683 8007288 8022832 * @summary testing of WB::deoptimizeMethod() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.DeoptimizeMethodTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java index c5ec0286171..c3653b598dd 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,10 +26,10 @@ * @test DeoptimizeMultipleOSRTest * @bug 8061817 * @summary testing of WB::deoptimizeMethod() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.DeoptimizeMultipleOSRTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java index ccb8ab0675e..b2817b39660 100644 --- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test EnqueueMethodForCompilationTest * @bug 8006683 8007288 8022832 * @summary testing of WB::enqueueMethodForCompilation() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.EnqueueMethodForCompilationTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java index f9b7cda0dbb..04ac558d9f5 100644 --- a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java +++ b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test * @bug 8059624 8064669 8153265 * @summary testing of WB::forceNMethodSweep - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.ForceNMethodSweepTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java index c6493c0abfa..305c888b7da 100644 --- a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java +++ b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test GetCodeHeapEntriesTest * @bug 8059624 * @summary testing of WB::getCodeHeapEntries() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.GetCodeHeapEntriesTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java index 4b64a6c5236..91d8cb7342d 100644 --- a/hotspot/test/compiler/whitebox/GetNMethodTest.java +++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @test GetNMethodTest * @bug 8038240 * @summary testing of WB::getNMethod() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.GetNMethodTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java index 6b806574407..c5f4687ffa9 100644 --- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java +++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,16 +26,13 @@ * @bug 8007270 8006683 8007288 8022832 * @summary testing of WB::isMethodCompilable() * @requires vm.flavor == "server" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management * - * @build jdk.test.lib.* - * sun.hotspot.WhiteBox - * @build compiler.whitebox.IsMethodCompilableTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * jdk.test.lib.Platform * @run main/othervm/timeout=2400 -XX:-TieredCompilation -Xmixed * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:PerMethodRecompilationCutoff=3 -XX:-UseCounterDecay diff --git a/hotspot/test/compiler/whitebox/LockCompilationTest.java b/hotspot/test/compiler/whitebox/LockCompilationTest.java index e3b86823424..077cbf54e5c 100644 --- a/hotspot/test/compiler/whitebox/LockCompilationTest.java +++ b/hotspot/test/compiler/whitebox/LockCompilationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ * @test LockCompilationTest * @bug 8059624 8152169 * @summary testing of WB::lock/unlockCompilation() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.LockCompilationTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index 6722acecc22..8afec557e0d 100644 --- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test MakeMethodNotCompilableTest * @bug 8012322 8006683 8007288 8022832 * @summary testing of WB::makeMethodNotCompilable() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.MakeMethodNotCompilableTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java index 5a8c7c33eeb..92d30221634 100644 --- a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java +++ b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test SetDontInlineMethodTest * @bug 8006683 8007288 8022832 * @summary testing of WB::testSetDontInlineMethod() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.SetDontInlineMethodTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java index f3e27e94827..5b346b55c5a 100644 --- a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java +++ b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,10 @@ * @test SetForceInlineMethodTest * @bug 8006683 8007288 8022832 * @summary testing of WB::testSetForceInlineMethod() - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build compiler.whitebox.SetForceInlineMethodTest + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/gc/CondCardMark/Basic.java b/hotspot/test/gc/CondCardMark/Basic.java index a6cc3a02cbf..765584122a8 100644 --- a/hotspot/test/gc/CondCardMark/Basic.java +++ b/hotspot/test/gc/CondCardMark/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,8 +27,6 @@ * @bug 8078438 * @summary Verify UseCondCardMark works * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build Basic * @run main/othervm -Xint Basic * @run main/othervm -Xint -XX:+UseCondCardMark Basic * @run main/othervm -XX:TieredStopAtLevel=1 Basic diff --git a/hotspot/test/gc/TestCardTablePageCommits.java b/hotspot/test/gc/TestCardTablePageCommits.java index 3577ebfe8fa..fe50587d95a 100644 --- a/hotspot/test/gc/TestCardTablePageCommits.java +++ b/hotspot/test/gc/TestCardTablePageCommits.java @@ -22,8 +22,8 @@ */ import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; /* @@ -32,7 +32,7 @@ import jdk.test.lib.Platform; * @bug 8059066 * @summary Tests that the card table does not commit the same page twice * @requires vm.gc.Parallel - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestCardTablePageCommits diff --git a/hotspot/test/gc/TestDisableExplicitGC.java b/hotspot/test/gc/TestDisableExplicitGC.java index 316f50c4314..6789df472fc 100644 --- a/hotspot/test/gc/TestDisableExplicitGC.java +++ b/hotspot/test/gc/TestDisableExplicitGC.java @@ -25,7 +25,7 @@ * @test TestDisableExplicitGC * @requires vm.opt.DisableExplicitGC == null * @summary Verify GC behavior with DisableExplicitGC flag. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules jdk.management/com.sun.management.internal * @run main/othervm -Xlog:gc=debug TestDisableExplicitGC diff --git a/hotspot/test/gc/TestObjectAlignment.java b/hotspot/test/gc/TestObjectAlignment.java index 2feaf63ba2b..9c6be10bd3f 100644 --- a/hotspot/test/gc/TestObjectAlignment.java +++ b/hotspot/test/gc/TestObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @key gc * @bug 8021823 * @summary G1: Concurrent marking crashes with -XX:ObjectAlignmentInBytes>=32 in 64bit VMs - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm TestObjectAlignment -Xmx20M -XX:+ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=8 @@ -43,8 +43,8 @@ * @run main/othervm TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256 */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestObjectAlignment { diff --git a/hotspot/test/gc/TestSmallHeap.java b/hotspot/test/gc/TestSmallHeap.java index 9b791a54eb6..f604a4c5a06 100644 --- a/hotspot/test/gc/TestSmallHeap.java +++ b/hotspot/test/gc/TestSmallHeap.java @@ -26,10 +26,10 @@ * @bug 8067438 8152239 * @requires vm.gc=="null" * @summary Verify that starting the VM with a small heap works - * @library /testlibrary /test/lib /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build TestSmallHeap + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestSmallHeap */ diff --git a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java index 380c9b882d4..6ea205757e7 100644 --- a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java +++ b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,9 @@ * @test TestSoftReferencesBehaviorOnOOME * @key gc * @summary Tests that all SoftReferences has been cleared at time of OOM. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestSoftReferencesBehaviorOnOOME * @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 512 2k * @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 128k 256k * @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 2k 32k diff --git a/hotspot/test/gc/TestVerifyDuringStartup.java b/hotspot/test/gc/TestVerifyDuringStartup.java index 3ac4cddb35e..7439e40c04e 100644 --- a/hotspot/test/gc/TestVerifyDuringStartup.java +++ b/hotspot/test/gc/TestVerifyDuringStartup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,14 +25,14 @@ * @key gc * @bug 8010463 8011343 8011898 * @summary Simple test run with -XX:+VerifyDuringStartup -XX:-UseTLAB to verify 8010463 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.ArrayList; import java.util.Collections; diff --git a/hotspot/test/gc/TestVerifySilently.java b/hotspot/test/gc/TestVerifySilently.java index a387ae4df41..7d11c44c7c3 100644 --- a/hotspot/test/gc/TestVerifySilently.java +++ b/hotspot/test/gc/TestVerifySilently.java @@ -25,13 +25,13 @@ * @key gc * @bug 8032771 * @summary Test silent verification. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.ArrayList; import java.util.Collections; import jdk.test.lib.Utils; diff --git a/hotspot/test/gc/TestVerifySubSet.java b/hotspot/test/gc/TestVerifySubSet.java index 9208d478247..c43079475bc 100644 --- a/hotspot/test/gc/TestVerifySubSet.java +++ b/hotspot/test/gc/TestVerifySubSet.java @@ -25,13 +25,13 @@ * @key gc * @bug 8072725 * @summary Test VerifySubSet option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.ArrayList; import java.util.Collections; import jdk.test.lib.Utils; diff --git a/hotspot/test/testlibrary/jdk/test/lib/AllocationHelper.java b/hotspot/test/gc/arguments/AllocationHelper.java similarity index 97% rename from hotspot/test/testlibrary/jdk/test/lib/AllocationHelper.java rename to hotspot/test/gc/arguments/AllocationHelper.java index c8366e7a275..bd4a77111be 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/AllocationHelper.java +++ b/hotspot/test/gc/arguments/AllocationHelper.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -21,8 +21,6 @@ * questions. */ -package jdk.test.lib; - import java.util.LinkedList; import java.util.concurrent.Callable; diff --git a/hotspot/test/testlibrary/jdk/test/lib/HeapRegionUsageTool.java b/hotspot/test/gc/arguments/HeapRegionUsageTool.java similarity index 96% rename from hotspot/test/testlibrary/jdk/test/lib/HeapRegionUsageTool.java rename to hotspot/test/gc/arguments/HeapRegionUsageTool.java index b89b77d5a33..1030012cf1a 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/HeapRegionUsageTool.java +++ b/hotspot/test/gc/arguments/HeapRegionUsageTool.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -21,8 +21,6 @@ * questions. */ -package jdk.test.lib; - import java.lang.management.ManagementFactory; import java.lang.management.MemoryPoolMXBean; import java.lang.management.MemoryUsage; diff --git a/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java b/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java index d06d3eec51c..1daa6d7128b 100644 --- a/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java +++ b/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,15 +27,15 @@ * The test helps verifying that size_t flags can be set/read. * @bug 8054823 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestArrayAllocatorMallocLimit */ import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.math.BigInteger; public class TestArrayAllocatorMallocLimit { diff --git a/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java b/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java index 4e5fa74818c..50782ab3725 100644 --- a/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java +++ b/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java @@ -27,10 +27,10 @@ * @bug 8006088 * @requires vm.gc.ConcMarkSweep * @summary Tests argument processing for initial and maximum heap size for the CMS collector - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestCMSHeapSizeFlags TestMaxHeapSizeTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestCMSHeapSizeFlags diff --git a/hotspot/test/gc/arguments/TestCompressedClassFlags.java b/hotspot/test/gc/arguments/TestCompressedClassFlags.java index 3cc50ad5741..9d09084b254 100644 --- a/hotspot/test/gc/arguments/TestCompressedClassFlags.java +++ b/hotspot/test/gc/arguments/TestCompressedClassFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -21,14 +21,16 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Platform; /* * @test * @bug 8015107 * @summary Tests that VM prints a warning when -XX:CompressedClassSpaceSize * is used together with -XX:-UseCompressedClassPointers - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/arguments/TestDisableDefaultGC.java b/hotspot/test/gc/arguments/TestDisableDefaultGC.java index 73ac9d446c2..4bbc4695531 100644 --- a/hotspot/test/gc/arguments/TestDisableDefaultGC.java +++ b/hotspot/test/gc/arguments/TestDisableDefaultGC.java @@ -26,15 +26,15 @@ * @summary Test that the VM complains when the default GC is disabled and no other GC is specified * @bug 8068579 * @key gc - * @library /testlibrary + * @library /test/lib * @requires vm.gc=="null" * @modules java.base/jdk.internal.misc * java.management * @run driver TestDisableDefaultGC */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestDisableDefaultGC { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java index 91935810e6d..c6d2b547357 100644 --- a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java +++ b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,7 @@ import jdk.test.lib.DynamicVMOption; * @test TestDynMaxHeapFreeRatio * @bug 8028391 * @summary Verify that MaxHeapFreeRatio flag is manageable - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management * @run main TestDynMaxHeapFreeRatio diff --git a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java index f8dca9b8223..e21f066b0a0 100644 --- a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java +++ b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test TestDynMinHeapFreeRatio * @bug 8028391 * @summary Verify that MinHeapFreeRatio flag is manageable - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management * @run main TestDynMinHeapFreeRatio diff --git a/hotspot/test/gc/arguments/TestG1ConcMarkStepDurationMillis.java b/hotspot/test/gc/arguments/TestG1ConcMarkStepDurationMillis.java index bd9e73a6b49..65536d5880f 100644 --- a/hotspot/test/gc/arguments/TestG1ConcMarkStepDurationMillis.java +++ b/hotspot/test/gc/arguments/TestG1ConcMarkStepDurationMillis.java @@ -26,12 +26,13 @@ * @key gc * @requires vm.gc.G1 * @summary Tests argument processing for double type flag, G1ConcMarkStepDurationMillis - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.*; import java.util.regex.*; diff --git a/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java b/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java index fb91b9e4154..523994bccf5 100644 --- a/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java +++ b/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java @@ -27,12 +27,13 @@ * @bug 8047976 * @requires vm.gc.G1 * @summary Tests argument processing for G1ConcRefinementThreads - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.util.*; import java.util.regex.*; diff --git a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java index 7dd0fc5aa54..d69c2f066b7 100644 --- a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java +++ b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java @@ -29,7 +29,7 @@ * @summary Verify that the flag G1HeapRegionSize is updated properly * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @library /testlibrary + * @library /test/lib * @run main TestG1HeapRegionSize */ @@ -39,7 +39,8 @@ import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Arrays; -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestG1HeapRegionSize { diff --git a/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java b/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java index 034938862ec..73e600e5cf1 100644 --- a/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java +++ b/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java @@ -27,10 +27,10 @@ * @bug 8006088 * @requires vm.gc.G1 * @summary Tests argument processing for initial and maximum heap size for the G1 collector - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestG1HeapSizeFlags TestMaxHeapSizeTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestG1HeapSizeFlags diff --git a/hotspot/test/gc/arguments/TestG1PercentageOptions.java b/hotspot/test/gc/arguments/TestG1PercentageOptions.java index db193ef7184..3314e42e998 100644 --- a/hotspot/test/gc/arguments/TestG1PercentageOptions.java +++ b/hotspot/test/gc/arguments/TestG1PercentageOptions.java @@ -27,13 +27,14 @@ * @bug 8068942 * @requires vm.gc.G1 * @summary Test argument processing of various percentage options - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestG1PercentageOptions */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestG1PercentageOptions { diff --git a/hotspot/test/gc/arguments/TestHeapFreeRatio.java b/hotspot/test/gc/arguments/TestHeapFreeRatio.java index 4f97a7ce383..fd6df97535a 100644 --- a/hotspot/test/gc/arguments/TestHeapFreeRatio.java +++ b/hotspot/test/gc/arguments/TestHeapFreeRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,13 +26,14 @@ * @key gc * @bug 8025661 * @summary Test parsing of -Xminf and -Xmaxf - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm TestHeapFreeRatio */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestHeapFreeRatio { diff --git a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java index a25e19e88b1..6fc2246488b 100644 --- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java +++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java @@ -27,14 +27,15 @@ * @bug 8014765 * @requires vm.gc.Parallel * @summary Tests argument processing for initial tenuring threshold - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm TestInitialTenuringThreshold * @author thomas.schatzl@oracle.com */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestInitialTenuringThreshold { diff --git a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java index 69bb75d00fe..98768c09469 100644 --- a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java +++ b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java @@ -26,7 +26,8 @@ import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Arrays; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; class ErgoArgsPrinter { diff --git a/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java b/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java index 3d26f946937..08a5b16fc3b 100644 --- a/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java +++ b/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java @@ -25,20 +25,18 @@ * @test TestMaxMinHeapFreeRatioFlags * @key gc * @summary Verify that heap size changes according to max and min heap free ratios. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestMaxMinHeapFreeRatioFlags * @run driver/timeout=240 TestMaxMinHeapFreeRatioFlags */ import java.util.LinkedList; import java.util.Arrays; import java.util.Collections; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -import jdk.test.lib.HeapRegionUsageTool; import jdk.internal.misc.Unsafe; public class TestMaxMinHeapFreeRatioFlags { diff --git a/hotspot/test/gc/arguments/TestMaxNewSize.java b/hotspot/test/gc/arguments/TestMaxNewSize.java index 25eb279f455..1a5bd980f4b 100644 --- a/hotspot/test/gc/arguments/TestMaxNewSize.java +++ b/hotspot/test/gc/arguments/TestMaxNewSize.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -27,10 +27,9 @@ * @bug 7057939 * @summary Make sure that MaxNewSize always has a useful value after argument * processing. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestMaxNewSize * @run main TestMaxNewSize -XX:+UseSerialGC * @run main TestMaxNewSize -XX:+UseParallelGC * @run main TestMaxNewSize -XX:+UseConcMarkSweepGC @@ -46,7 +45,8 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestMaxNewSize { diff --git a/hotspot/test/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java b/hotspot/test/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java index d58040bca0a..892426a29cd 100644 --- a/hotspot/test/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java +++ b/hotspot/test/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -25,22 +25,20 @@ * @test TestMinAndInitialSurvivorRatioFlags * @key gc * @summary Verify that MinSurvivorRatio and InitialSurvivorRatio flags work - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestMinAndInitialSurvivorRatioFlags + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestMinAndInitialSurvivorRatioFlags */ -import jdk.test.lib.AllocationHelper; import java.lang.management.MemoryUsage; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; -import jdk.test.lib.HeapRegionUsageTool; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestMinInitialErgonomics.java b/hotspot/test/gc/arguments/TestMinInitialErgonomics.java index 784860a834d..ca354ba91a2 100644 --- a/hotspot/test/gc/arguments/TestMinInitialErgonomics.java +++ b/hotspot/test/gc/arguments/TestMinInitialErgonomics.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,10 +26,10 @@ * @key gc * @bug 8006088 * @summary Test ergonomics decisions related to minimum and initial heap size. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestMinInitialErgonomics TestMaxHeapSizeTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestMinInitialErgonomics diff --git a/hotspot/test/gc/arguments/TestNewRatioFlag.java b/hotspot/test/gc/arguments/TestNewRatioFlag.java index 1f8cfb8dd4e..d95374a328c 100644 --- a/hotspot/test/gc/arguments/TestNewRatioFlag.java +++ b/hotspot/test/gc/arguments/TestNewRatioFlag.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -26,10 +26,10 @@ * @key gc * @bug 8025166 * @summary Verify that heap devided among generations according to NewRatio - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestNewRatioFlag + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestNewRatioFlag */ @@ -37,9 +37,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; -import jdk.test.lib.HeapRegionUsageTool; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestNewSizeFlags.java b/hotspot/test/gc/arguments/TestNewSizeFlags.java index df016560e8e..a871361dbe6 100644 --- a/hotspot/test/gc/arguments/TestNewSizeFlags.java +++ b/hotspot/test/gc/arguments/TestNewSizeFlags.java @@ -26,23 +26,21 @@ * @key gc * @bug 8025166 * @summary Verify that young gen size conforms values specified by NewSize, MaxNewSize and Xmn options - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestNewSizeFlags + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver/timeout=240 TestNewSizeFlags */ -import jdk.test.lib.AllocationHelper; import java.io.IOException; import java.lang.management.MemoryUsage; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; -import jdk.test.lib.HeapRegionUsageTool; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java index d10dcf69660..fc487c2dd94 100644 --- a/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java +++ b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java @@ -26,14 +26,17 @@ * @key gc * @bug 8144527 * @summary Tests argument processing for NewSizeThreadIncrease - * @library /testlibrary + * @library /test/lib * @requires vm.gc.Serial * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + // Range of NewSizeThreadIncrease is 0 ~ max_uintx. // Total of 5 threads will be created (1 GCTest thread and 4 TestThread). diff --git a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java index b30b365b95d..ed25dd8f6b9 100644 --- a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java +++ b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java @@ -28,14 +28,14 @@ * @requires vm.gc.Parallel * @summary Tests argument processing for NeverTenure, AlwaysTenure, * and MaxTenuringThreshold - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestObjectTenuringFlags FlagsValue * @run main/othervm TestObjectTenuringFlags */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.util.*; diff --git a/hotspot/test/gc/arguments/TestParallelGCThreads.java b/hotspot/test/gc/arguments/TestParallelGCThreads.java index 44d24171128..f18aa43a8b2 100644 --- a/hotspot/test/gc/arguments/TestParallelGCThreads.java +++ b/hotspot/test/gc/arguments/TestParallelGCThreads.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +* 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 @@ -26,13 +26,15 @@ * @key gc * @bug 8059527 8081382 * @summary Tests argument processing for ParallelGCThreads - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestParallelGCThreads */ -import jdk.test.lib.*; +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestParallelGCThreads { diff --git a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java index af0b2a7922c..f9e4816ace2 100644 --- a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java +++ b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java @@ -28,10 +28,10 @@ * @summary Tests argument processing for initial and maximum heap size for the * parallel collectors. * @requires vm.gc=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestParallelHeapSizeFlags TestMaxHeapSizeTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestParallelHeapSizeFlags diff --git a/hotspot/test/gc/arguments/TestSelectDefaultGC.java b/hotspot/test/gc/arguments/TestSelectDefaultGC.java index 0c39a6ba874..de770b283b8 100644 --- a/hotspot/test/gc/arguments/TestSelectDefaultGC.java +++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java @@ -26,14 +26,17 @@ * @summary Test selection of GC when no GC option is specified * @bug 8068582 * @key gc - * @library /testlibrary + * @library /test/lib * @requires vm.gc=="null" * @modules java.base/jdk.internal.misc * java.management * @run driver TestSelectDefaultGC */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + import java.util.regex.*; public class TestSelectDefaultGC { diff --git a/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java b/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java index 3ffd729d5cb..32533afd609 100644 --- a/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java +++ b/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,10 +26,10 @@ * @key gc * @bug 8006088 * @summary Tests argument processing for initial and maximum heap size for the Serial collector - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestSerialHeapSizeFlags TestMaxHeapSizeTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestSerialHeapSizeFlags diff --git a/hotspot/test/gc/arguments/TestShrinkHeapInSteps.java b/hotspot/test/gc/arguments/TestShrinkHeapInSteps.java index 82dd54af734..de75055a560 100644 --- a/hotspot/test/gc/arguments/TestShrinkHeapInSteps.java +++ b/hotspot/test/gc/arguments/TestShrinkHeapInSteps.java @@ -25,10 +25,9 @@ * @test TestShrinkHeapInSteps * @key gc * @summary Verify that -XX:-ShrinkHeapInSteps works properly. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestMaxMinHeapFreeRatioFlags TestShrinkHeapInSteps * @run driver/timeout=240 TestShrinkHeapInSteps */ diff --git a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java index e275e6b8799..332acf39026 100644 --- a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java +++ b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,14 +21,14 @@ * questions. */ -import jdk.test.lib.ExitCode; +import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; /** * @test * @bug 8031323 * @summary Verify SurvivorAlignmentInBytes option processing. - * @library /testlibrary + * @library /test/lib * @requires vm.opt.SurvivorAlignmentInBytes == null * & vm.opt.ObjectAlignmentInBytes == null * & vm.opt.UnlockExperimentalVMOptions == null diff --git a/hotspot/test/gc/arguments/TestSurvivorRatioFlag.java b/hotspot/test/gc/arguments/TestSurvivorRatioFlag.java index b18da4b3cf6..d33d7733b68 100644 --- a/hotspot/test/gc/arguments/TestSurvivorRatioFlag.java +++ b/hotspot/test/gc/arguments/TestSurvivorRatioFlag.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -25,22 +25,20 @@ * @test TestSurvivorRatioFlag * @key gc * @summary Verify that actual survivor ratio is equal to specified SurvivorRatio value - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestSurvivorRatioFlag + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestSurvivorRatioFlag */ -import jdk.test.lib.AllocationHelper; import java.lang.management.MemoryUsage; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; -import jdk.test.lib.HeapRegionUsageTool; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java index dd254e0e7a2..af91d12ddd3 100644 --- a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java +++ b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java @@ -27,15 +27,14 @@ * @summary Verify that option TargetSurvivorRatio affects survivor space occupancy after minor GC. * @requires (vm.opt.ExplicitGCInvokesConcurrent == null) | (vm.opt.ExplicitGCInvokesConcurrent == false) * @requires (vm.opt.UseJVMCICompiler == null) | (vm.opt.UseJVMCICompiler == false) - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestTargetSurvivorRatioFlag + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestTargetSurvivorRatioFlag */ -import jdk.test.lib.AllocationHelper; import java.lang.management.GarbageCollectorMXBean; import java.util.Arrays; import java.util.Collections; @@ -43,10 +42,9 @@ import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.HeapRegionUsageTool; import jdk.internal.misc.Unsafe; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java index 3b33466ee96..f10bd70c465 100644 --- a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java +++ b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,14 @@ * @key gc * @bug 8017611 * @summary Tests handling unrecognized VM options - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm TestUnrecognizedVMOptionsHandling */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestUnrecognizedVMOptionsHandling { diff --git a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java index effbfa5cbe5..218ee051c6c 100644 --- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java +++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,10 +26,10 @@ * @key gc * @bug 8010722 * @summary Tests ergonomics for UseCompressedOops. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management - * @build TestUseCompressedOopsErgo TestUseCompressedOopsErgoTools + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm TestUseCompressedOopsErgo -XX:+UseG1GC diff --git a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java index 09072229b3f..d599fe3ce7e 100644 --- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java +++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java @@ -29,7 +29,9 @@ import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Arrays; -import jdk.test.lib.*; +import jdk.test.lib.Asserts; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.lang.management.ManagementFactory; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java b/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java index 85bb1de4cac..4eb11c57044 100644 --- a/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java +++ b/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,13 +27,13 @@ * ergonomics, on all platforms when UseNUMA feature is enabled. * @bug 8059614 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestUseNUMAInterleaving */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestUseNUMAInterleaving { diff --git a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java index d092c11dbca..f2291ee7a49 100644 --- a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java +++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2015, 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 @@ -30,7 +30,7 @@ output contain or doesn't contain expected patterns * @modules java.base/jdk.internal.misc * @modules java.management - * @library /testlibrary + * @library /test/lib * @run driver TestVerifyBeforeAndAfterGCFlags */ @@ -38,8 +38,8 @@ import java.util.ArrayList; import java.util.Collections; import jdk.test.lib.Utils; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestVerifyBeforeAndAfterGCFlags { diff --git a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java index 732f0a74a3d..6b798256ab4 100644 --- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java +++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,18 +25,18 @@ * @test * @key gc * @bug 8049831 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestCMSClassUnloadingEnabledHWM + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver TestCMSClassUnloadingEnabledHWM * @summary Test that -XX:-CMSClassUnloadingEnabled will trigger a Full GC when more than MetaspaceSize metadata is allocated. */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; import java.util.ArrayList; diff --git a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java index 6b99caf7531..ad0ef23dbbf 100644 --- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java +++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,18 +25,18 @@ * @test * @key gc * @bug 8049831 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestG1ClassUnloadingHWM + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver TestG1ClassUnloadingHWM * @summary Test that -XX:-ClassUnloadingWithConcurrentMark will trigger a Full GC when more than MetaspaceSize metadata is allocated. */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.util.ArrayList; import java.util.Arrays; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/cms/GuardShrinkWarning.java b/hotspot/test/gc/cms/GuardShrinkWarning.java index 58182678159..5790ba1dea6 100644 --- a/hotspot/test/gc/cms/GuardShrinkWarning.java +++ b/hotspot/test/gc/cms/GuardShrinkWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,14 +27,15 @@ * @bug 8012111 * @key gc * @key regression - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm GuardShrinkWarning * @author jon.masamitsu@oracle.com */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class GuardShrinkWarning { public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java index 7b262fd3723..5040a9370a8 100644 --- a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -28,11 +28,11 @@ * @requires vm.gc=="null" * @key gc * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestDynamicNumberOfGCThreads { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/ergonomics/TestInitialGCThreadLogging.java b/hotspot/test/gc/ergonomics/TestInitialGCThreadLogging.java index 29a7602f83f..f68e8fa842b 100644 --- a/hotspot/test/gc/ergonomics/TestInitialGCThreadLogging.java +++ b/hotspot/test/gc/ergonomics/TestInitialGCThreadLogging.java @@ -28,11 +28,11 @@ * @requires vm.gc=="null" * @key gc * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestInitialGCThreadLogging { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/g1/Test2GbHeap.java b/hotspot/test/gc/g1/Test2GbHeap.java index 66bc2c74604..55e9927cbe4 100644 --- a/hotspot/test/gc/g1/Test2GbHeap.java +++ b/hotspot/test/gc/g1/Test2GbHeap.java @@ -30,15 +30,15 @@ * @requires vm.bits != "32" * @key gc * @key regression - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.util.ArrayList; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class Test2GbHeap { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java index b29d9328cbd..71ec43de6ff 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,7 +27,7 @@ * @summary Test to make sure that eager reclaim of humongous objects work. We simply try to fill * up the heap with humongous objects that should be eagerly reclaimable to avoid Full GC. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ @@ -36,8 +36,8 @@ import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.LinkedList; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Asserts; class ReclaimRegionFast { diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java index 3e835bb49b7..a516e02185a 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,7 +27,7 @@ * @summary Test to make sure that eager reclaim of humongous objects correctly clears * mark bitmaps at reclaim. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ @@ -36,8 +36,8 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.Random; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; // An object that has a few references to other instances to slow down marking. class ObjectWithSomeRefs { diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java index ecd016451ac..6bfa89b00bf 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,7 @@ * referencing that we know is in the old gen. After changing this reference, the object * should still be eagerly reclaimable to avoid Full GC. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ @@ -39,8 +39,8 @@ import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.LinkedList; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import static jdk.test.lib.Asserts.*; class RefHolder { diff --git a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java index 57fcf2ce7a3..2c27eb276ab 100644 --- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java +++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java @@ -27,13 +27,13 @@ * @summary Ensure that the output for a G1TraceEagerReclaimHumongousObjects * includes the expected necessary messages. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.util.LinkedList; public class TestG1TraceEagerReclaimHumongousObjects { diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java index ec9250c14fa..776ef7d826a 100644 --- a/hotspot/test/gc/g1/TestGCLogMessages.java +++ b/hotspot/test/gc/g1/TestGCLogMessages.java @@ -27,13 +27,13 @@ * @summary Ensure the output for a minor GC with G1 * includes the expected necessary messages. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestGCLogMessages { diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java index cd43193c3a1..c760c36db48 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java +++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -25,12 +25,13 @@ * @test TestHumongousAllocInitialMark * @bug 7168848 * @summary G1: humongous object allocations should initiate marking cycles when necessary - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestHumongousAllocInitialMark { // Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to diff --git a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java index a7a34442814..7c0d7a170c3 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java +++ b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -27,11 +27,12 @@ * @summary G1: humongous object allocations should work even when there is * not enough space in the heapRegion to fit a filler object. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run driver TestHumongousAllocNearlyFullRegion */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestHumongousAllocNearlyFullRegion { // Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to diff --git a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java index 00950cc188d..955474c99e6 100644 --- a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java +++ b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,17 +26,18 @@ * @key regression * @key gc * @bug 8027756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestHumongousCodeCacheRoots + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @summary Humongous objects may have references from the code cache * @run main TestHumongousCodeCacheRoots */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; import java.util.ArrayList; diff --git a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java index 62c452a715d..53bcbe077b8 100644 --- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java +++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java @@ -27,7 +27,7 @@ * @requires vm.gc.G1 * @summary Verify that heap shrinks after GC in the presence of fragmentation * due to humongous objects - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10 diff --git a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java index 844e1524db5..3f173c355a7 100644 --- a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java +++ b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java @@ -27,10 +27,9 @@ * @bug 8058354 8079208 * @key gc * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @requires vm.gc.G1 - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestLargePageUseForAuxMemory + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory @@ -40,8 +39,10 @@ import java.lang.Math; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Asserts; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; public class TestLargePageUseForAuxMemory { diff --git a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java index 5a1eefe7309..d8a6e29ea48 100644 --- a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java +++ b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java @@ -29,9 +29,9 @@ * might pass even if there are problems in the code, but it will never crash unless there is a problem. * @requires vm.gc.G1 * @key gc - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build TestNoEagerReclaimOfHumongousRegions + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions diff --git a/hotspot/test/gc/g1/TestPLABOutput.java b/hotspot/test/gc/g1/TestPLABOutput.java index 2f53c5c8a8b..53519fa9c05 100644 --- a/hotspot/test/gc/g1/TestPLABOutput.java +++ b/hotspot/test/gc/g1/TestPLABOutput.java @@ -28,7 +28,7 @@ * @requires vm.gc.G1 * @key gc * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestPLABOutput @@ -39,9 +39,9 @@ import sun.hotspot.WhiteBox; import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/gc/g1/TestPLABSizeBounds.java b/hotspot/test/gc/g1/TestPLABSizeBounds.java index e4faca68e44..0b29eb54eef 100644 --- a/hotspot/test/gc/g1/TestPLABSizeBounds.java +++ b/hotspot/test/gc/g1/TestPLABSizeBounds.java @@ -27,16 +27,16 @@ * @summary Regression test to ensure that G1 supports PLAB sizes of half a region size. * @requires vm.gc.G1 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.util.ArrayList; -import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestPLABSizeBounds { diff --git a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java index b0482083628..79b797b4286 100644 --- a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java +++ b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,14 +26,15 @@ * @key gc * @bug 8014240 * @summary Test output of G1PrintRegionRememberedSetInfo - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main TestPrintRegionRememberedSetInfo * @author thomas.schatzl@oracle.com */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.Thread; import java.util.ArrayList; import java.util.Arrays; diff --git a/hotspot/test/gc/g1/TestRegionLivenessPrint.java b/hotspot/test/gc/g1/TestRegionLivenessPrint.java index 8e79b1efe32..3e0f3e2c7ad 100644 --- a/hotspot/test/gc/g1/TestRegionLivenessPrint.java +++ b/hotspot/test/gc/g1/TestRegionLivenessPrint.java @@ -27,9 +27,9 @@ * @requires vm.gc.G1 * @summary Make sure that G1 does not assert when printing region liveness data on a humongous continues region. * @key gc - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build TestRegionLivenessPrint + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC -Xmx128M -XX:G1HeapRegionSize=1m -Xlog:gc+liveness=trace TestRegionLivenessPrint diff --git a/hotspot/test/gc/g1/TestRemsetLogging.java b/hotspot/test/gc/g1/TestRemsetLogging.java index 146a16f9a87..f4e829603dd 100644 --- a/hotspot/test/gc/g1/TestRemsetLogging.java +++ b/hotspot/test/gc/g1/TestRemsetLogging.java @@ -25,10 +25,10 @@ * @test TestRemsetLogging.java * @requires vm.gc.G1 * @bug 8013895 8129977 8145534 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management - * @build TestRemsetLoggingTools TestRemsetLogging + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @summary Verify output of -Xlog:gc+remset*=trace diff --git a/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java index e60d191940c..123f6166a66 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java @@ -25,10 +25,10 @@ * @test TestRemsetLoggingPerRegion.java * @requires vm.gc.G1 * @bug 8014078 8129977 8145534 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management - * @build TestRemsetLoggingTools TestRemsetLoggingPerRegion + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @summary Verify output of -Xlog:gc+remset*=trace in regards to per-region type output diff --git a/hotspot/test/gc/g1/TestRemsetLoggingThreads.java b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java index 2f0c712a87c..18b1f0536b6 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingThreads.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java @@ -26,7 +26,7 @@ * @requires vm.gc.G1 * @bug 8025441 8145534 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management * @summary Ensure that various values of worker threads/concurrent @@ -36,8 +36,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestRemsetLoggingThreads { diff --git a/hotspot/test/gc/g1/TestRemsetLoggingTools.java b/hotspot/test/gc/g1/TestRemsetLoggingTools.java index e58eb9e8b14..6fdc4e51206 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingTools.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -29,7 +29,8 @@ import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; import sun.hotspot.WhiteBox; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.Arrays; diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java index 3b0907c6663..cb25eac90d8 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java @@ -22,9 +22,9 @@ */ import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import java.io.IOException; import java.lang.management.ManagementFactory; diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java index baed161da93..9f3b580952d 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * TestShrinkAuxiliaryData TestShrinkAuxiliaryData00 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData00 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java index 846f91de654..1fa2ca5c873 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * TestShrinkAuxiliaryData TestShrinkAuxiliaryData05 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData05 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java index 05b041da715..694e35f9c5a 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData10 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java index ec0623bdf58..1bfbe489f2b 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData15 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java index a89eb284a9d..0d037d2b661 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData20 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java index 50d5d912169..a24111f977a 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData25 diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java index 6432cdad2e0..5572a011ab8 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java @@ -28,11 +28,10 @@ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values * @requires vm.gc.G1 * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.* sun.hotspot.WhiteBox - * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=720 TestShrinkAuxiliaryData30 diff --git a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java index 34948e9797e..fa3126f2498 100644 --- a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java +++ b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,7 +31,7 @@ * "..................................H" * 3. invoke gc and check that memory returned to the system (amount of committed memory got down) * - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management */ @@ -40,8 +40,8 @@ import java.lang.management.MemoryUsage; import java.util.ArrayList; import java.util.List; import static jdk.test.lib.Asserts.*; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import com.sun.management.HotSpotDiagnosticMXBean; public class TestShrinkDefragmentedHeap { diff --git a/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java b/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java index b09a32a6956..25e6a12ff5e 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationAgeThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication age threshold * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java b/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java index b725acbf8de..1c2ab7389c4 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationFullGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication during full GC * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationInterned.java b/hotspot/test/gc/g1/TestStringDeduplicationInterned.java index 3abe32d80ec..766c9f821b0 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationInterned.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationInterned.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication of interned strings * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java b/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java index 62146e176d8..43940962f9b 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationPrintOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication print options * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java b/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java index d7c2f12c77b..5f466f3681d 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationTableRehash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication table rehash * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java b/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java index 204efb5a4ce..1259869e4e5 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationTableResize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication table resize * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTools.java b/hotspot/test/gc/g1/TestStringDeduplicationTools.java index 3e725f78132..b4760317a12 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationTools.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,7 +29,8 @@ import java.lang.management.*; import java.lang.reflect.*; import java.security.*; import java.util.*; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.misc.*; class TestStringDeduplicationTools { diff --git a/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java b/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java index 15ab52f67e5..a65e4ab3ce2 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationYoungGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ * @summary Test string deduplication during young GC * @bug 8029075 * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/g1/TestStringSymbolTableStats.java b/hotspot/test/gc/g1/TestStringSymbolTableStats.java index e86187988b3..62994fa2d55 100644 --- a/hotspot/test/gc/g1/TestStringSymbolTableStats.java +++ b/hotspot/test/gc/g1/TestStringSymbolTableStats.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @bug 8027476 8027455 * @summary Ensure that the G1TraceStringSymbolTableScrubbing prints the expected message. * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestStringSymbolTableStats { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java b/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java index 28bc484f4a2..86405e1c738 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java @@ -38,12 +38,10 @@ import java.util.List; * @test TestHeapCounters * @summary Checks that heap counters work as expected after humongous allocations/deallocations * @requires vm.gc.G1 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.TestHeapCounters * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java index 86bc2d22c9f..1db6259f8ca 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java @@ -41,15 +41,10 @@ import java.nio.file.Paths; * @requires vm.gc.G1 * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M" * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.G1SampleClass - * gc.g1.humongousObjects.ClassLoaderGenerator - * gc.g1.humongousObjects.TestHumongousClassLoader - * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java index a90c98d6953..755516c92bc 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java @@ -40,12 +40,10 @@ import java.util.stream.Collectors; * @test TestHumongousMovement * @summary Checks that Humongous objects are not moved during GC * @requires vm.gc.G1 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.TestHumongousMovement * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java index fcc9d7dedd3..2abcf4883e9 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java @@ -39,14 +39,10 @@ import java.nio.file.Paths; * @summary Checks that huge class' instances (ie with huge amount of fields) are allocated successfully * @requires vm.gc.G1 * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.G1SampleClass - * gc.g1.humongousObjects.TestHumongousNonArrayAllocation - * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java index cc1660e540e..76b35ab0055 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java @@ -32,12 +32,10 @@ import sun.hotspot.WhiteBox; * @test TestHumongousThreshold * @summary Checks that objects larger than half a region are allocated as humongous * @requires vm.gc.G1 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.TestHumongousThreshold * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java b/hotspot/test/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java index bbd15683324..893b895a8f5 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java +++ b/hotspot/test/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java @@ -36,12 +36,9 @@ import java.util.stream.Collectors; * @test TestNoAllocationsInHRegions * @summary Checks that no additional allocations are made in humongous regions * @requires vm.gc.G1 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.management java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.TestNoAllocationsInHRegions - * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/TestObjectCollected.java b/hotspot/test/gc/g1/humongousObjects/TestObjectCollected.java index 0cf5e2ce8d3..10ffe50f28f 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestObjectCollected.java +++ b/hotspot/test/gc/g1/humongousObjects/TestObjectCollected.java @@ -38,13 +38,10 @@ import java.lang.ref.WeakReference; * @summary checks that after different type of GCs weak/soft references to humongous object behave correspondingly to * actual object behavior * @requires vm.gc.G1 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.TestObjectCollected - * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * diff --git a/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java b/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java index 07f7a3bc89d..bb7f3d29a60 100644 --- a/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java +++ b/hotspot/test/gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java @@ -24,7 +24,7 @@ package gc.g1.humongousObjects.objectGraphTest; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; import java.io.File; @@ -50,16 +50,9 @@ import java.util.stream.Collectors; * @summary Checks that objects' graph behave as expected after gc * @requires vm.gc.G1 * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.management java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox - * gc.testlibrary.Helpers - * gc.g1.humongousObjects.objectGraphTest.GCTokens - * gc.g1.humongousObjects.objectGraphTest.ReferenceInfo - * gc.g1.humongousObjects.objectGraphTest.GC - * gc.g1.humongousObjects.objectGraphTest.ObjectGraph - * gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC - * * @ignore 8156755 * * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/gc/g1/ihop/TestIHOPErgo.java b/hotspot/test/gc/g1/ihop/TestIHOPErgo.java index d70c926e298..af46c523e2f 100644 --- a/hotspot/test/gc/g1/ihop/TestIHOPErgo.java +++ b/hotspot/test/gc/g1/ihop/TestIHOPErgo.java @@ -30,11 +30,9 @@ * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @requires vm.opt.MaxGCPauseMillis == "null" - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management - * @build gc.g1.ihop.TestIHOPErgo - * gc.g1.ihop.lib.IhopUtils * @run driver/timeout=480 gc.g1.ihop.TestIHOPErgo */ package gc.g1.ihop; @@ -44,8 +42,8 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import gc.g1.ihop.lib.IhopUtils; diff --git a/hotspot/test/gc/g1/ihop/TestIHOPStatic.java b/hotspot/test/gc/g1/ihop/TestIHOPStatic.java index 0529af84206..0fcafaf6634 100644 --- a/hotspot/test/gc/g1/ihop/TestIHOPStatic.java +++ b/hotspot/test/gc/g1/ihop/TestIHOPStatic.java @@ -28,11 +28,9 @@ * @requires vm.gc.G1 * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management - * @build gc.g1.ihop.TestIHOPStatic - * gc.g1.ihop.lib.IhopUtils * @run driver/timeout=240 gc.g1.ihop.TestIHOPStatic */ package gc.g1.ihop; @@ -41,8 +39,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import gc.g1.ihop.lib.IhopUtils; diff --git a/hotspot/test/gc/g1/ihop/lib/IhopUtils.java b/hotspot/test/gc/g1/ihop/lib/IhopUtils.java index 0ca571b2a12..0cd25ea4c67 100644 --- a/hotspot/test/gc/g1/ihop/lib/IhopUtils.java +++ b/hotspot/test/gc/g1/ihop/lib/IhopUtils.java @@ -27,7 +27,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; /** diff --git a/hotspot/test/gc/g1/mixedgc/TestLogging.java b/hotspot/test/gc/g1/mixedgc/TestLogging.java index 29fd37f3201..d3231302c95 100644 --- a/hotspot/test/gc/g1/mixedgc/TestLogging.java +++ b/hotspot/test/gc/g1/mixedgc/TestLogging.java @@ -26,18 +26,18 @@ * @summary Check that a mixed GC is reflected in the gc logs * @requires vm.gc.G1 * @requires vm.opt.MaxGCPauseMillis == "null" - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management - * @build sun.hotspot.WhiteBox gc.g1.mixedgc.TestLogging + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver gc.g1.mixedgc.TestLogging */ package gc.g1.mixedgc; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/gc/g1/plab/TestPLABEvacuationFailure.java b/hotspot/test/gc/g1/plab/TestPLABEvacuationFailure.java index 77f43d254a8..09d32865664 100644 --- a/hotspot/test/gc/g1/plab/TestPLABEvacuationFailure.java +++ b/hotspot/test/gc/g1/plab/TestPLABEvacuationFailure.java @@ -26,11 +26,9 @@ * @bug 8148376 * @summary Checks PLAB statistics on evacuation failure * @requires vm.gc.G1 - * @library /testlibrary / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management - * @build gc.g1.plab.lib.LogParser - * gc.g1.plab.lib.AppPLABEvacuationFailure * @run main gc.g1.plab.TestPLABEvacuationFailure */ package gc.g1.plab; @@ -43,8 +41,8 @@ import java.util.Collections; import java.util.regex.Pattern; import java.util.stream.Collectors; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import gc.g1.plab.lib.LogParser; diff --git a/hotspot/test/gc/g1/plab/TestPLABPromotion.java b/hotspot/test/gc/g1/plab/TestPLABPromotion.java index 95177e8b876..926ee806252 100644 --- a/hotspot/test/gc/g1/plab/TestPLABPromotion.java +++ b/hotspot/test/gc/g1/plab/TestPLABPromotion.java @@ -27,14 +27,10 @@ * @summary Test PLAB promotion * @requires vm.gc.G1 * @requires !vm.flightRecorder - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management - * @build ClassFileInstaller - * sun.hotspot.WhiteBox - * gc.g1.plab.lib.MemoryConsumer - * gc.g1.plab.lib.LogParser - * gc.g1.plab.lib.AppPLABPromotion + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/timeout=240 gc.g1.plab.TestPLABPromotion @@ -50,8 +46,8 @@ import gc.g1.plab.lib.LogParser; import gc.g1.plab.lib.PLABUtils; import gc.g1.plab.lib.PlabInfo; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /** * Test checks PLAB promotion of different size objects. diff --git a/hotspot/test/gc/g1/plab/TestPLABResize.java b/hotspot/test/gc/g1/plab/TestPLABResize.java index 7b45914c1b9..9a4cfdbd2c4 100644 --- a/hotspot/test/gc/g1/plab/TestPLABResize.java +++ b/hotspot/test/gc/g1/plab/TestPLABResize.java @@ -27,15 +27,10 @@ * @summary Test for PLAB resizing * @requires vm.gc.G1 * @requires !vm.flightRecorder - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management - * @build ClassFileInstaller - * sun.hotspot.WhiteBox - * gc.g1.plab.lib.LogParser - * gc.g1.plab.lib.MemoryConsumer - * gc.g1.plab.lib.PLABUtils - * gc.g1.plab.lib.AppPLABResize + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main gc.g1.plab.TestPLABResize @@ -52,8 +47,8 @@ import gc.g1.plab.lib.PLABUtils; import gc.g1.plab.lib.AppPLABResize; import gc.g1.plab.lib.PlabReport; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /** * Test for PLAB resizing. diff --git a/hotspot/test/gc/g1/plab/lib/PLABUtils.java b/hotspot/test/gc/g1/plab/lib/PLABUtils.java index 096441c14cb..0ae28ab9d55 100644 --- a/hotspot/test/gc/g1/plab/lib/PLABUtils.java +++ b/hotspot/test/gc/g1/plab/lib/PLABUtils.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; /** diff --git a/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java b/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java index fe2a8d71041..09ed8a0661c 100644 --- a/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java +++ b/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java @@ -26,12 +26,13 @@ * @bug 8145180 * @summary Verify PrintGC, PrintGCDetails and -Xloggc * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; diff --git a/hotspot/test/gc/logging/TestGCId.java b/hotspot/test/gc/logging/TestGCId.java index 1f89a33a0df..c2b134e1a3d 100644 --- a/hotspot/test/gc/logging/TestGCId.java +++ b/hotspot/test/gc/logging/TestGCId.java @@ -27,13 +27,13 @@ * @summary Ensure that the GCId is logged * @requires vm.gc=="null" * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestGCId { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/logging/TestPrintReferences.java b/hotspot/test/gc/logging/TestPrintReferences.java index 8181e0ca3aa..193263493be 100644 --- a/hotspot/test/gc/logging/TestPrintReferences.java +++ b/hotspot/test/gc/logging/TestPrintReferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,13 +26,13 @@ * @bug 8136991 * @summary Validate the reference processing logging * @key gc - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestPrintReferences { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/logging/TestUnifiedLoggingSwitchStress.java b/hotspot/test/gc/logging/TestUnifiedLoggingSwitchStress.java index 37fd5b251db..4c7838ec277 100644 --- a/hotspot/test/gc/logging/TestUnifiedLoggingSwitchStress.java +++ b/hotspot/test/gc/logging/TestUnifiedLoggingSwitchStress.java @@ -44,7 +44,7 @@ import java.util.Random; * @key gc * @key stress * @requires !vm.flightRecorder - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.management java.base/jdk.internal.misc * * @run main/othervm -Xmx256M -Xms256M diff --git a/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java b/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java index ebe90eebae0..ea9ae05eb12 100644 --- a/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java +++ b/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,16 @@ * @test CompressedClassSpaceSizeInJmapHeap * @bug 8004924 * @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap */ -import jdk.test.lib.*; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.nio.file.*; import java.io.File; import java.nio.charset.Charset; diff --git a/hotspot/test/testlibrary/jdk/test/lib/InputArguments.java b/hotspot/test/gc/metaspace/InputArguments.java similarity index 96% rename from hotspot/test/testlibrary/jdk/test/lib/InputArguments.java rename to hotspot/test/gc/metaspace/InputArguments.java index 7963b0a7037..35edb815bd8 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/InputArguments.java +++ b/hotspot/test/gc/metaspace/InputArguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -21,8 +21,6 @@ * questions. */ -package jdk.test.lib; - import java.lang.management.RuntimeMXBean; import java.lang.management.ManagementFactory; import java.util.List; diff --git a/hotspot/test/gc/metaspace/PerfCounters.java b/hotspot/test/gc/metaspace/PerfCounters.java index 9dce3bd4e70..c1242b1bee5 100644 --- a/hotspot/test/gc/metaspace/PerfCounters.java +++ b/hotspot/test/gc/metaspace/PerfCounters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ import sun.jvmstat.monitor.MonitorException; import sun.jvmstat.monitor.MonitoredHost; import sun.jvmstat.monitor.MonitoredVm; import sun.jvmstat.monitor.VmIdentifier; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; /** * PerfCounters can be used to get a performance counter from the currently diff --git a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java index 827aff5946e..0b748a25296 100644 --- a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java +++ b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ * @test * @key gc * @bug 8049831 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestCapacityUntilGCWrapAround + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestCapacityUntilGCWrapAround diff --git a/hotspot/test/gc/metaspace/TestMetaspaceCMSCancel.java b/hotspot/test/gc/metaspace/TestMetaspaceCMSCancel.java index 42357ff03dd..62e8fdfc509 100644 --- a/hotspot/test/gc/metaspace/TestMetaspaceCMSCancel.java +++ b/hotspot/test/gc/metaspace/TestMetaspaceCMSCancel.java @@ -28,9 +28,9 @@ import sun.hotspot.WhiteBox; /* @test TestMetaspaceCMSCancel * @bug 8026752 * @summary Tests cancel of CMS concurrent cycle for Metaspace after a full GC - * @library /testlibrary /test/lib /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build TestMetaspaceCMSCancel + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm TestMetaspaceCMSCancel */ diff --git a/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java b/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java index f6ac4141e81..418ea3c0940 100644 --- a/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java +++ b/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java @@ -27,7 +27,6 @@ import java.util.ArrayList; * @bug 8024945 * @summary Tests to initialize metaspace with a very low MetaspaceSize * @modules java.base/jdk.internal.misc - * @library /testlibrary * @run main/othervm -XX:MetaspaceSize=0 TestMetaspaceInitialization */ public class TestMetaspaceInitialization { diff --git a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java index 64066ee2b62..370537992f6 100644 --- a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java +++ b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,14 +23,16 @@ import java.util.List; import java.lang.management.*; -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import static jdk.test.lib.Asserts.*; /* @test TestMetaspaceMemoryPool * @bug 8000754 * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a * MemoryManagerMXBean is created. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool diff --git a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java index f76d457a004..e86819c75b4 100644 --- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java +++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,13 +24,16 @@ import java.util.List; import java.util.ArrayList; -import jdk.test.lib.*; +import jdk.test.lib.ByteCodeLoader; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.Platform; + import static jdk.test.lib.Asserts.*; /* @test TestMetaspacePerfCounters * @bug 8014659 * @requires vm.gc=="null" - * @library /testlibrary + * @library /test/lib * @summary Tests that performance counters for metaspace and compressed class * space exists and works. * @modules java.base/jdk.internal.misc diff --git a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java index 639694c4547..b5ed60b50fb 100644 --- a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java +++ b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java @@ -22,15 +22,15 @@ */ import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test TestMetaspaceSizeFlags * @key gc * @bug 8024650 * @summary Test that metaspace size flags can be set correctly - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ diff --git a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java index d42e51afdd8..cfdc4ff6cfd 100644 --- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java +++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java @@ -24,12 +24,12 @@ import java.util.List; import java.lang.management.*; -import jdk.test.lib.*; +import jdk.test.lib.Platform; import static jdk.test.lib.Asserts.*; /* @test TestPerfCountersAndMemoryPools * @bug 8023476 - * @library /testlibrary + * @library /test/lib * @requires vm.gc.Serial * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace * report the same data. diff --git a/hotspot/test/gc/parallel/AdaptiveGCBoundary.java b/hotspot/test/gc/parallel/AdaptiveGCBoundary.java index 91ad282f1ea..23215afd679 100644 --- a/hotspot/test/gc/parallel/AdaptiveGCBoundary.java +++ b/hotspot/test/gc/parallel/AdaptiveGCBoundary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,14 +27,15 @@ * @bug 8014546 * @key gc * @key regression - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm AdaptiveGCBoundary * @author jon.masamitsu@oracle.com */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class AdaptiveGCBoundary { public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/parallel/TestDynShrinkHeap.java b/hotspot/test/gc/parallel/TestDynShrinkHeap.java index 06534328c7c..4b6e7d21d24 100644 --- a/hotspot/test/gc/parallel/TestDynShrinkHeap.java +++ b/hotspot/test/gc/parallel/TestDynShrinkHeap.java @@ -28,7 +28,7 @@ * @summary Verify that the heap shrinks after full GC according to the current values of the Min/MaxHeapFreeRatio flags * @modules java.base/jdk.internal.misc * @modules jdk.management - * @library /testlibrary + * @library /test/lib * @run main/othervm -XX:+UseAdaptiveSizePolicyWithSystemGC -XX:+UseParallelGC -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 -Xmx1g -verbose:gc TestDynShrinkHeap */ import jdk.test.lib.DynamicVMOption; diff --git a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java index e25e0cebc6b..1069b417d47 100644 --- a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java +++ b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java @@ -28,7 +28,6 @@ * @key gc * @requires vm.gc.Parallel * @modules java.base/jdk.internal.misc - * @library /testlibrary * @run main/othervm -Xmx50m -XX:+UseParallelGC -Xlog:gc*=trace TestPrintGCDetailsVerbose */ public class TestPrintGCDetailsVerbose { diff --git a/hotspot/test/gc/serial/HeapChangeLogging.java b/hotspot/test/gc/serial/HeapChangeLogging.java index f3d0c0180a3..a8ef6f64464 100644 --- a/hotspot/test/gc/serial/HeapChangeLogging.java +++ b/hotspot/test/gc/serial/HeapChangeLogging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,10 +24,9 @@ /* * @test HeapChangeLogging.java * @bug 8027440 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build HeapChangeLogging * @summary Allocate to get a promotion failure and verify that that heap change logging is present. * @run main HeapChangeLogging */ @@ -35,7 +34,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class HeapChangeLogging { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/startup_warnings/TestCMS.java b/hotspot/test/gc/startup_warnings/TestCMS.java index 23e0c85e4d4..6ea63dabcaf 100644 --- a/hotspot/test/gc/startup_warnings/TestCMS.java +++ b/hotspot/test/gc/startup_warnings/TestCMS.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8006398 * @summary Test that CMS does not print a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestCMS { diff --git a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java index 1821464ce2f..f6aaacec0bf 100644 --- a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java +++ b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8065972 * @summary Test that the unsupported DefNew+CMS combination does not start -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestDefNewCMS { diff --git a/hotspot/test/gc/startup_warnings/TestG1.java b/hotspot/test/gc/startup_warnings/TestG1.java index 68bd4796166..253a16c0274 100644 --- a/hotspot/test/gc/startup_warnings/TestG1.java +++ b/hotspot/test/gc/startup_warnings/TestG1.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8006398 * @summary Test that the G1 collector does not print a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestG1 { diff --git a/hotspot/test/gc/startup_warnings/TestParNewCMS.java b/hotspot/test/gc/startup_warnings/TestParNewCMS.java index 7a332d985b0..82830abdc8d 100644 --- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java +++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8065972 * @summary Test that specifying -XX:+UseParNewGC on the command line logs a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestParNewCMS { diff --git a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java index 18455c7f9ea..30843bf389a 100644 --- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java +++ b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8065972 * @summary Test that the unsupported ParNew+SerialOld combination does not start -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestParNewSerialOld { diff --git a/hotspot/test/gc/startup_warnings/TestParallelGC.java b/hotspot/test/gc/startup_warnings/TestParallelGC.java index 6af5f762ddc..0a31ca9d1c1 100644 --- a/hotspot/test/gc/startup_warnings/TestParallelGC.java +++ b/hotspot/test/gc/startup_warnings/TestParallelGC.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8006398 * @summary Test that ParallelGC does not print a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestParallelGC { diff --git a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java index e748b0ef7e1..9e404d1c36f 100644 --- a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java +++ b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8006398 * @summary Test that the ParallelScavenge+SerialOld combination does not print a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestParallelScavengeSerialOld { diff --git a/hotspot/test/gc/startup_warnings/TestSerialGC.java b/hotspot/test/gc/startup_warnings/TestSerialGC.java index 2010980699a..35f69813c42 100644 --- a/hotspot/test/gc/startup_warnings/TestSerialGC.java +++ b/hotspot/test/gc/startup_warnings/TestSerialGC.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 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 @@ -26,13 +26,13 @@ * @key gc * @bug 8006398 * @summary Test that SerialGC does not print a warning message -* @library /testlibrary +* @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestSerialGC { diff --git a/hotspot/test/gc/stress/TestMultiThreadStressRSet.java b/hotspot/test/gc/stress/TestMultiThreadStressRSet.java index dcfdb6c29e8..048762c6455 100644 --- a/hotspot/test/gc/stress/TestMultiThreadStressRSet.java +++ b/hotspot/test/gc/stress/TestMultiThreadStressRSet.java @@ -37,7 +37,7 @@ import sun.hotspot.WhiteBox; * * @summary Stress G1 Remembered Set using multiple threads * @modules java.base/jdk.internal.misc - * @library /test/lib /testlibrary + * @library /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/gc/stress/TestStressRSetCoarsening.java b/hotspot/test/gc/stress/TestStressRSetCoarsening.java index bb621bb28ff..36f775f59ee 100644 --- a/hotspot/test/gc/stress/TestStressRSetCoarsening.java +++ b/hotspot/test/gc/stress/TestStressRSetCoarsening.java @@ -34,7 +34,7 @@ import sun.hotspot.WhiteBox; * * @summary Stress G1 Remembered Set by creating a lot of cross region links * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java b/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java index 4ba5ae2c749..a6b1e2e2444 100644 --- a/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java +++ b/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @bug 8031323 * @summary Verify that object's alignment in eden space is not affected by * SurvivorAlignmentInBytes option. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestAllocationInEden SurvivorAlignmentTestMain AlignmentHelper + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java index 92dcacd488c..44eddf9f603 100644 --- a/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java +++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @bug 8031323 * @summary Verify that objects promoted from eden space to tenured space during * full GC are not aligned to SurvivorAlignmentInBytes value. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestPromotionFromEdenToTenured SurvivorAlignmentTestMain - * AlignmentHelper + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java index 0fec465cade..5596294e387 100644 --- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java +++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @bug 8031323 * @summary Verify that objects promoted from survivor space to tenured space * during full GC are not aligned to SurvivorAlignmentInBytes value. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestPromotionFromSurvivorToTenuredAfterFullGC - * SurvivorAlignmentTestMain AlignmentHelper + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java index 488207d18e3..45c22827eda 100644 --- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java +++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,11 +27,10 @@ * @summary Verify that objects promoted from survivor space to tenured space * when their age exceeded tenuring threshold are not aligned to * SurvivorAlignmentInBytes value. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestPromotionFromSurvivorToTenuredAfterMinorGC - * SurvivorAlignmentTestMain AlignmentHelper + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java b/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java index f5b2dc293f8..5c6dd81cafb 100644 --- a/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java +++ b/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,11 +26,10 @@ * @bug 8031323 * @summary Verify that objects promoted from eden space to survivor space after * minor GC are aligned to SurvivorAlignmentInBytes. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestPromotionToSurvivor - * SurvivorAlignmentTestMain AlignmentHelper + * @build sun.hotspot.WhiteBox * @ignore 8129886 * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/gc/testlibrary/Helpers.java b/hotspot/test/gc/testlibrary/Helpers.java index b28d92dd406..e97d4a03ea9 100644 --- a/hotspot/test/gc/testlibrary/Helpers.java +++ b/hotspot/test/gc/testlibrary/Helpers.java @@ -25,7 +25,7 @@ package gc.testlibrary; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; import java.io.File; diff --git a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java index ea3b30af1b6..c1d4b959327 100644 --- a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java +++ b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java @@ -25,12 +25,12 @@ * @test TestConMarkCycleWB * @bug 8065579 * @requires vm.gc.G1 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.WhiteBox TestConcMarkCycleWB + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC TestConcMarkCycleWB diff --git a/hotspot/test/gc/whitebox/TestWBGC.java b/hotspot/test/gc/whitebox/TestWBGC.java index 56eae949b63..acc75c9f921 100644 --- a/hotspot/test/gc/whitebox/TestWBGC.java +++ b/hotspot/test/gc/whitebox/TestWBGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,14 +25,16 @@ * @test TestWBGC * @bug 8055098 * @summary Test verify that WB methods isObjectInOldGen and youngGC works correctly. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestWBGC + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestWBGC */ -import jdk.test.lib.*; +import jdk.test.lib.Asserts; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; public class TestWBGC { diff --git a/hotspot/test/native/GTestWrapper.java b/hotspot/test/native/GTestWrapper.java index cedf63e4aa4..da90f816855 100644 --- a/hotspot/test/native/GTestWrapper.java +++ b/hotspot/test/native/GTestWrapper.java @@ -24,7 +24,7 @@ /* @test * @summary a jtreg wrapper for gtest tests - * @library /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc * @run main/native GTestWrapper */ diff --git a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java index a9f69d60f38..341b2a6ea8a 100644 --- a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java +++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @bug 8026365 * @summary Test invokespecial of host class method from an anonymous class * @author Robert Field - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * @compile -XDignore.symbol.file InvokeSpecialAnonTest.java diff --git a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java index fe77452c4a5..186b235f0de 100644 --- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java +++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java @@ -25,13 +25,15 @@ * @test * @bug 6583051 * @summary Give error if java.lang.Object has been incompatibly overridden on the bootpath - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main BootstrapRedefine */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class BootstrapRedefine { diff --git a/hotspot/test/runtime/BoolReturn/NativeSmallIntCallsTest.java b/hotspot/test/runtime/BoolReturn/NativeSmallIntCallsTest.java index 6ce8cb1252c..7a85ad27433 100644 --- a/hotspot/test/runtime/BoolReturn/NativeSmallIntCallsTest.java +++ b/hotspot/test/runtime/BoolReturn/NativeSmallIntCallsTest.java @@ -25,7 +25,7 @@ * @bug 8149170 * @summary Test native functions return booleans as 0/1 but differently than java functions * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile BoolConstructor.java * @run main/native NativeSmallIntCallsTest */ diff --git a/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppend.java b/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppend.java index 28371979be0..a463f492d8b 100644 --- a/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppend.java +++ b/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppend.java @@ -25,11 +25,12 @@ * @test * @bug 8087154 * @summary Uninitialized system property jdk.boot.class.path.append causes SIGSEGV - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; // Test that system property jdk.boot.class.path.append is initialized. Otherwise, // -XX:+PrintCompilation does causes a SIGSEGV. diff --git a/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppendProp.java b/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppendProp.java index 0fd7830f46a..458b5ceda03 100644 --- a/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppendProp.java +++ b/hotspot/test/runtime/BootClassAppendProp/BootClassPathAppendProp.java @@ -25,7 +25,6 @@ import java.io.File; /* * @test - * @build BootClassPathAppendProp * @run main/othervm -Xbootclasspath/a:/usr/lib -showversion -Xbootclasspath/a:/i/dont/exist BootClassPathAppendProp * @run main/othervm --patch-module=no_module=/not/here -Xbootclasspath/a:/i/may/exist BootClassPathAppendProp * @run main/othervm -Djdk.boot.class.path.append=newdir BootClassPathAppendProp diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java index 34a417e54bc..5e5031c8df5 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @bug 8003424 * @summary Testing UseCompressedClassPointers with CDS - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main CDSCompressedKPtrs */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CDSCompressedKPtrs { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java index b9242e17e75..885427cc265 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @bug 8003424 * @summary Test that cannot use CDS if UseCompressedClassPointers is turned off. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main CDSCompressedKPtrsError */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CDSCompressedKPtrsError { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java index 9694382001a..425a2e5ba4e 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @bug 8005933 * @summary Test that -Xshare:auto uses CDS when explicitly specified with -server. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main XShareAuto */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class XShareAuto { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/ClassFile/JsrRewriting.java b/hotspot/test/runtime/ClassFile/JsrRewriting.java index 4d9a3e6238f..55d56c6361b 100644 --- a/hotspot/test/runtime/ClassFile/JsrRewriting.java +++ b/hotspot/test/runtime/ClassFile/JsrRewriting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -33,14 +33,17 @@ * @bug 7185550 * @bug 7149464 * @key cte_test - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.desktop * java.management * @run main JsrRewriting */ -import jdk.test.lib.*; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; public class JsrRewriting { diff --git a/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java b/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java index 9ab684a4b4b..a87aebb1434 100644 --- a/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java +++ b/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -33,15 +33,17 @@ * @bug 7037122 * @bug 7123945 * @bug 8016029 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.desktop * java.management * @run main OomWhileParsingRepeatedJsr */ -import jdk.test.lib.*; - +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class OomWhileParsingRepeatedJsr { diff --git a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java index c3ca4676582..486bba9717c 100644 --- a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java +++ b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,7 +23,7 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management @@ -36,7 +36,8 @@ import java.io.FileOutputStream; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class UnsupportedClassFileVersion implements Opcodes { public static void main(String... args) throws Exception { diff --git a/hotspot/test/runtime/ClassUnload/KeepAliveClass.java b/hotspot/test/runtime/ClassUnload/KeepAliveClass.java index 9c0b50cbe7e..0d1d51a1f5a 100644 --- a/hotspot/test/runtime/ClassUnload/KeepAliveClass.java +++ b/hotspot/test/runtime/ClassUnload/KeepAliveClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,9 @@ * @test KeepAliveClass * @summary This test case uses a java.lang.Class instance to keep a class alive. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /runtime/testlibrary + * @library /test/lib /runtime/testlibrary * @library classes - * @build KeepAliveClass test.Empty - * @build ClassUnloadCommon + * @build sun.hotspot.WhiteBox test.Empty * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClass diff --git a/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java b/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java index ec8fa0d621b..e519f674856 100644 --- a/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java +++ b/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,9 @@ * @test KeepAliveClassLoader * @summary This test case uses a java.lang.ClassLoader instance to keep a class alive. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /runtime/testlibrary + * @library /test/lib /runtime/testlibrary * @library classes - * @build KeepAliveClassLoader test.Empty - * @build ClassUnloadCommon + * @build sun.hotspot.WhiteBox test.Empty * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveClassLoader diff --git a/hotspot/test/runtime/ClassUnload/KeepAliveObject.java b/hotspot/test/runtime/ClassUnload/KeepAliveObject.java index aca13b0ea0f..2ccdab8b42c 100644 --- a/hotspot/test/runtime/ClassUnload/KeepAliveObject.java +++ b/hotspot/test/runtime/ClassUnload/KeepAliveObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,9 @@ * @test KeepAliveObject * @summary This test case uses a class instance to keep the class alive. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /runtime/testlibrary + * @library /test/lib /runtime/testlibrary * @library classes - * @build KeepAliveObject test.Empty - * @build ClassUnloadCommon + * @build sun.hotspot.WhiteBox test.Empty * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveObject diff --git a/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java b/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java index e6321a5ff5f..d28babb5fff 100644 --- a/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java +++ b/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,10 +25,9 @@ * @test KeepAliveSoftReference * @summary This test case uses a java.lang.ref.SoftReference referencing a class instance to keep a class alive. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /runtime/testlibrary + * @library /test/lib /runtime/testlibrary * @library classes - * @build KeepAliveSoftReference test.Empty - * @build ClassUnloadCommon + * @build sun.hotspot.WhiteBox test.Empty * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI KeepAliveSoftReference diff --git a/hotspot/test/runtime/ClassUnload/UnloadTest.java b/hotspot/test/runtime/ClassUnload/UnloadTest.java index eada2704506..e995f7ebd58 100644 --- a/hotspot/test/runtime/ClassUnload/UnloadTest.java +++ b/hotspot/test/runtime/ClassUnload/UnloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,10 +24,9 @@ /* * @test UnloadTest * @modules java.base/jdk.internal.misc - * @library /runtime/testlibrary /testlibrary /test/lib + * @library /runtime/testlibrary /test/lib * @library classes - * @build ClassUnloadCommon test.Empty - * @build UnloadTest + * @build sun.hotspot.WhiteBox test.Empty * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI UnloadTest diff --git a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java index 218b014e3ea..7728db2cc6a 100644 --- a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java +++ b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @bug 8006298 * @summary Setting an invalid value for a bool argument should result in a useful error message - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class BooleanFlagWithInvalidValue { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java index de46967d7e5..75466353982 100644 --- a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java +++ b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_compiler file is present - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.io.PrintWriter; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class CompilerConfigFileWarning { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/ConfigFileParsing.java b/hotspot/test/runtime/CommandLine/ConfigFileParsing.java index 870240a1876..3b08bf1a1a9 100644 --- a/hotspot/test/runtime/CommandLine/ConfigFileParsing.java +++ b/hotspot/test/runtime/CommandLine/ConfigFileParsing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,14 @@ * @test ConfigFileParsing * @bug 7158804 * @summary Improve config file parsing - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.io.PrintWriter; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ConfigFileParsing { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java index 6fcbde3651c..a189b95c0e4 100644 --- a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java +++ b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_rc file is present - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.io.PrintWriter; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class ConfigFileWarning { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java index 336ebaf98ef..c7b605832c1 100644 --- a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java +++ b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @bug 8006298 * @summary Setting a flag to an invalid value should print a useful error message - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class FlagWithInvalidValue { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java b/hotspot/test/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java index 20766a2db03..9c73503995d 100644 --- a/hotspot/test/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java +++ b/hotspot/test/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,14 +21,16 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; /* * @test * @bug 8129855 * @summary -XX:+IgnoreUnrecognizedVMOptions should work according to the spec from JDK-8129855 * - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main IgnoreUnrecognizedVMOptions diff --git a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java index 1f0ed1539ec..b10f021cbe0 100644 --- a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java +++ b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @bug 8006298 * @summary Using a bool (+/-) prefix on non-bool flag should result in a useful error message - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class NonBooleanFlagWithInvalidBooleanPrefix { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java index f2401c778d4..0362f0a8c8f 100644 --- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -26,10 +26,11 @@ * @bug 8060449 8073989 * @summary Newly obsolete command line options should still give useful error messages when used improperly. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ObsoleteFlagErrorMessage { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java b/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java index b1ff1eabedf..d15d536b751 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @summary Verify jcmd error message for out-of-range value and for * value which is not allowed by constraint. Also check that * jcmd does not print an error message to the target process output. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * jdk.management @@ -35,8 +35,8 @@ import jdk.test.lib.Asserts; import jdk.test.lib.DynamicVMOption; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.dcmd.PidJcmdExecutor; public class TestJcmdOutput { diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index 890ac26463d..303912d4e20 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -24,12 +24,11 @@ /* * @test * @summary Test VM Options with ranges - * @library /testlibrary /runtime/CommandLine/OptionsValidation/common + * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management * jdk.attach/sun.tools.attach * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* TestOptionsWithRanges * @run main/othervm/timeout=900 TestOptionsWithRanges */ diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java index 3c8453c7ab2..d5f20b5d4d2 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ /* * @test * @summary Test writeable VM Options with ranges. - * @library /testlibrary /runtime/CommandLine/OptionsValidation/common + * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * jdk.attach/sun.tools.attach * java.management diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java index 031d6a2cc64..b10ac75c56e 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java @@ -30,8 +30,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import jdk.test.lib.DynamicVMOption; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import sun.tools.attach.HotSpotVirtualMachine; diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java index cfde0ee0e3d..3c694560e76 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java @@ -37,9 +37,9 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.StringTokenizer; import java.util.function.Predicate; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class JVMOptionsUtils { diff --git a/hotspot/test/runtime/CommandLine/PrintTouchedMethods.java b/hotspot/test/runtime/CommandLine/PrintTouchedMethods.java index 2fd472e2af7..d855a16ab67 100644 --- a/hotspot/test/runtime/CommandLine/PrintTouchedMethods.java +++ b/hotspot/test/runtime/CommandLine/PrintTouchedMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,14 +26,16 @@ * @bug 8025692 * @modules java.base/jdk.internal.misc * java.management - * @library /testlibrary + * @library /test/lib * @compile TestLogTouchedMethods.java PrintTouchedMethods.java * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+LogTouchedMethods PrintTouchedMethods */ import java.io.File; import java.util.List; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class PrintTouchedMethods { diff --git a/hotspot/test/runtime/CommandLine/TestHexArguments.java b/hotspot/test/runtime/CommandLine/TestHexArguments.java index 43f63c8c0f5..9b22fdd5a33 100644 --- a/hotspot/test/runtime/CommandLine/TestHexArguments.java +++ b/hotspot/test/runtime/CommandLine/TestHexArguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,13 +26,14 @@ * @bug 8042885 * @summary Make sure there is no error using hexadecimal format in vm options * @author Yumin Qi - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestHexArguments { public static void main(String args[]) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/TestLongUnrecognizedVMOption.java b/hotspot/test/runtime/CommandLine/TestLongUnrecognizedVMOption.java index 3566e5936e2..dfca97c552c 100644 --- a/hotspot/test/runtime/CommandLine/TestLongUnrecognizedVMOption.java +++ b/hotspot/test/runtime/CommandLine/TestLongUnrecognizedVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,14 +25,14 @@ * @test * @bug 8129786 * @summary Verify that JVM correctly processes very long unrecognized VM option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management * @run main TestLongUnrecognizedVMOption */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestLongUnrecognizedVMOption { diff --git a/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java b/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java index f40f941fedd..c6df7bb3fef 100644 --- a/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java +++ b/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,13 +21,14 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test TestNullTerminatedFlags * @bug 6522873 * @summary Test that the VM don't allow random junk characters at the end of valid command line flags. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestNullTerminatedFlags diff --git a/hotspot/test/runtime/CommandLine/TestVMOptions.java b/hotspot/test/runtime/CommandLine/TestVMOptions.java index f16e744d9f5..5fd7d88aa0c 100644 --- a/hotspot/test/runtime/CommandLine/TestVMOptions.java +++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,14 @@ * @test * @bug 8060256 * @summary Test various command line options - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main TestVMOptions */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; public class TestVMOptions { diff --git a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java index bdffccbc33f..c9d348abab1 100644 --- a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java +++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java @@ -25,12 +25,13 @@ * @test * @bug 8048933 * @summary TraceExceptions output should have the exception message - useful for ClassNotFoundExceptions especially - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TraceExceptionsTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java b/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java index 62477aaa0b2..5f30d752f1f 100644 --- a/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java +++ b/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @bug 8006298 * @summary Using an unrecognized VM option should print the name of the option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class UnrecognizedVMOption { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/VMAliasOptions.java b/hotspot/test/runtime/CommandLine/VMAliasOptions.java index ee516b9e9d2..eae37477c08 100644 --- a/hotspot/test/runtime/CommandLine/VMAliasOptions.java +++ b/hotspot/test/runtime/CommandLine/VMAliasOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,8 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.*; /* @@ -29,7 +30,7 @@ import jdk.test.lib.cli.*; * @bug 8061611 * @summary Test that various alias options correctly set the target options. See aliased_jvm_flags in arguments.cpp. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ public class VMAliasOptions { diff --git a/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java index 5ea7653b7b9..06f73568460 100644 --- a/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java +++ b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java @@ -21,7 +21,8 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.*; /* @@ -29,7 +30,7 @@ import jdk.test.lib.cli.*; * @bug 8066821 * @summary Test that various options are deprecated. See deprecated_jvm_flags in arguments.cpp. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ public class VMDeprecatedOptions { diff --git a/hotspot/test/runtime/CommandLine/VMOptionWarning.java b/hotspot/test/runtime/CommandLine/VMOptionWarning.java index 08d762de219..c9c6f2187bc 100644 --- a/hotspot/test/runtime/CommandLine/VMOptionWarning.java +++ b/hotspot/test/runtime/CommandLine/VMOptionWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,14 @@ * @test * @bug 8027314 * @summary Warn if diagnostic or experimental vm option is used and -XX:+UnlockDiagnosticVMOptions or -XX:+UnlockExperimentalVMOptions, respectively, isn't specified. Warn if develop or notproduct vm option is used with product version of VM. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class VMOptionWarning { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java index 0049548897f..865fb9b8556 100644 --- a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java +++ b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test * @bug 8061999 8135195 8136552 * @summary Test "-XX:VMOptionsFile" VM option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules jdk.management * @run main TestVMOptionsFile @@ -52,8 +52,8 @@ import java.util.Properties; import java.util.Set; import jdk.test.lib.Asserts; import jdk.test.lib.DynamicVMOption; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestVMOptionsFile { diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java index ea0dbc2ec8c..610840033e1 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -25,12 +25,14 @@ * @test * @bug 8024927 * @summary Testing address of compressed class pointer space as best as possible. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CompressedClassPointers { diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java index d53672091b2..b1d9f8b3d72 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,14 @@ * @test * @bug 8022865 * @summary Tests for the -XX:CompressedClassSpaceSize command line option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main CompressedClassSpaceSize */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CompressedClassSpaceSize { diff --git a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java index 2ff8b27f87f..2d2b08dd00a 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java +++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,12 +26,14 @@ * @bug 8000968 * @key regression * @summary NPG: UseCompressedClassPointers asserts with ObjectAlignmentInBytes=32 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CompressedKlassPointerAndOops { diff --git a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java index 00cc071a497..90e0564dd74 100644 --- a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java +++ b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,15 @@ * @test * @bug 8022865 * @summary Tests for the -XX:ObjectAlignmentInBytes command line option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main ObjectAlignment */ -import jdk.test.lib.*; + +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ObjectAlignment { diff --git a/hotspot/test/runtime/CompressedOops/UseCompressedOops.java b/hotspot/test/runtime/CompressedOops/UseCompressedOops.java index 7c43cda4e89..4753dc6f901 100644 --- a/hotspot/test/runtime/CompressedOops/UseCompressedOops.java +++ b/hotspot/test/runtime/CompressedOops/UseCompressedOops.java @@ -25,7 +25,7 @@ * @test * @bug 8022865 * @summary Tests for different combination of UseCompressedOops options - * @library /testlibrary + * @library /test/lib * @ignore 8079353 * @modules java.base/jdk.internal.misc * java.management @@ -33,7 +33,9 @@ */ import java.util.ArrayList; import java.util.Collections; -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class UseCompressedOops { diff --git a/hotspot/test/runtime/ConstantPool/BadMethodHandles.java b/hotspot/test/runtime/ConstantPool/BadMethodHandles.java index 6345166e022..f0eb9b1cc74 100644 --- a/hotspot/test/runtime/ConstantPool/BadMethodHandles.java +++ b/hotspot/test/runtime/ConstantPool/BadMethodHandles.java @@ -25,7 +25,6 @@ * @test * @bug 8087223 * @summary Adding constantTag to keep method call consistent with it. - * @library /testlibrary * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/runtime/ConstantPool/IntfMethod.java b/hotspot/test/runtime/ConstantPool/IntfMethod.java index 9602ff59979..f0a1dacc977 100644 --- a/hotspot/test/runtime/ConstantPool/IntfMethod.java +++ b/hotspot/test/runtime/ConstantPool/IntfMethod.java @@ -25,7 +25,6 @@ * @test * $bug 8087223 * @summary Adding constantTag to keep method call consistent with it. - * @library /testlibrary * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java b/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java index ccd0bd420d7..b5d58911298 100644 --- a/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java +++ b/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8044738 - * @library /testlibrary + * @library /test/lib * @summary Check attribute_length of EnclosingMethod attribute * @modules java.base/jdk.internal.misc * java.management @@ -32,7 +32,8 @@ */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class EnclMethodAttr { diff --git a/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java b/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java index e4f0f94bdb2..b6a7d1311a2 100644 --- a/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java +++ b/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,16 +23,18 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* * @run driver CreateCoredumpOnCrash */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; public class CreateCoredumpOnCrash { diff --git a/hotspot/test/runtime/ErrorHandling/ErrorHandler.java b/hotspot/test/runtime/ErrorHandling/ErrorHandler.java index ba5cdbc7ab9..26882f59d61 100644 --- a/hotspot/test/runtime/ErrorHandling/ErrorHandler.java +++ b/hotspot/test/runtime/ErrorHandling/ErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,11 +28,13 @@ * @summary Exercise HotSpot error handling code by invoking java with * -XX:ErrorHandlerTest option to cause an error report. Check the results. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run driver ErrorHandler */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ErrorHandler { diff --git a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java index 3ee548d2575..768ffae1994 100644 --- a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java +++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java @@ -25,19 +25,19 @@ * @test * @bug 8050167 * @summary Test that error is not occurred during printing problematic frame - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* * @run driver ProblematicFrameTest */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; -import jdk.test.lib.Utils; public class ProblematicFrameTest { private static class Crasher { diff --git a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java index c34e56a49a4..3cfd80166a2 100644 --- a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java +++ b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -27,16 +27,16 @@ import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.regex.Pattern; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; /* * @test * @bug 8074552 * @summary SafeFetch32 and SafeFetchN do not work in error handling * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @author Thomas Stuefe (SAP) */ diff --git a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java index d82274ab3f2..65e1b7218de 100644 --- a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java +++ b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ * @test * @bug 8065896 * @summary Synchronous signals during error reporting may terminate or hang VM process - * @library /testlibrary + * @library /test/lib * @author Thomas Stuefe (SAP) * @modules java.base/jdk.internal.misc * java.management @@ -38,9 +38,9 @@ import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.regex.Pattern; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class SecondaryErrorTest { diff --git a/hotspot/test/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java b/hotspot/test/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java index d658401de68..38d50e488f4 100644 --- a/hotspot/test/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java +++ b/hotspot/test/runtime/ErrorHandling/TestCrashOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,14 +25,13 @@ * @test TestCrashOnOutOfMemoryError * @summary Test using -XX:+CrashOnOutOfMemoryError * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @run driver TestCrashOnOutOfMemoryError * @bug 8138745 */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; diff --git a/hotspot/test/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java b/hotspot/test/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java index 79d064f6df8..34faa87a9d1 100644 --- a/hotspot/test/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java +++ b/hotspot/test/runtime/ErrorHandling/TestExitOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,14 +25,13 @@ * @test TestExitOnOutOfMemoryError * @summary Test using -XX:ExitOnOutOfMemoryError * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @run driver TestExitOnOutOfMemoryError * @bug 8138745 */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestExitOnOutOfMemoryError { diff --git a/hotspot/test/runtime/ErrorHandling/TestOnError.java b/hotspot/test/runtime/ErrorHandling/TestOnError.java index 4fa5c44c32b..e1dcf38714d 100644 --- a/hotspot/test/runtime/ErrorHandling/TestOnError.java +++ b/hotspot/test/runtime/ErrorHandling/TestOnError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,13 +25,14 @@ * @test TestOnError * @summary Test using -XX:OnError= * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build TestOnError + * @library /test/lib * @run main TestOnError * @bug 8078470 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class TestOnError { diff --git a/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java b/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java index c81cab5e699..a2302e25801 100644 --- a/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java +++ b/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,13 +25,13 @@ * @test TestOnOutOfMemoryError * @summary Test using -XX:OnOutOfMemoryError= * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build TestOnOutOfMemoryError + * @library /test/lib * @run main TestOnOutOfMemoryError * @bug 8078470 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestOnOutOfMemoryError { diff --git a/hotspot/test/runtime/Final/TestPutMain.java b/hotspot/test/runtime/Final/TestPutMain.java index 601a6dbad3b..bfdfdda94e6 100644 --- a/hotspot/test/runtime/Final/TestPutMain.java +++ b/hotspot/test/runtime/Final/TestPutMain.java @@ -26,7 +26,7 @@ * @test * @bug 8160527 * @summary The VM does not always perform checks added by 8157181 when updating final instance fields - * @library /testlibrary + * @library /test/lib * @compile TestPutField.jasm * @compile TestPutStatic.jasm * @compile TestPutMain.java diff --git a/hotspot/test/runtime/LoadClass/LoadClassNegative.java b/hotspot/test/runtime/LoadClass/LoadClassNegative.java index 08bd4dad6b5..8282f6a40bc 100644 --- a/hotspot/test/runtime/LoadClass/LoadClassNegative.java +++ b/hotspot/test/runtime/LoadClass/LoadClassNegative.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,16 +26,16 @@ * @key regression * @bug 8020675 * @summary make sure there is no fatal error if a class is loaded from an invalid jar file which is in the bootclasspath - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @build TestForName - * @build LoadClassNegative * @run main LoadClassNegative */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class LoadClassNegative { diff --git a/hotspot/test/runtime/LocalVariableTable/TestLVT.java b/hotspot/test/runtime/LocalVariableTable/TestLVT.java index 42ad0b777c7..7c1ff98e1df 100644 --- a/hotspot/test/runtime/LocalVariableTable/TestLVT.java +++ b/hotspot/test/runtime/LocalVariableTable/TestLVT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,14 +25,15 @@ * @test * @bug 8049632 * @summary Test ClassFileParser::copy_localvariable_table cases - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @compile -g -XDignore.symbol.file TestLVT.java * @run main TestLVT */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.*; public class TestLVT { diff --git a/hotspot/test/runtime/Metaspace/FragmentMetaspace.java b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java index acd64cd3e25..47282a4c7a2 100644 --- a/hotspot/test/runtime/Metaspace/FragmentMetaspace.java +++ b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,6 @@ * @library /runtime/testlibrary * @modules java.base/jdk.internal.misc * @modules java.compiler - * @build GeneratedClassLoader * @run main/othervm/timeout=200 -Xmx300m FragmentMetaspace */ diff --git a/hotspot/test/runtime/NMT/AutoshutdownNMT.java b/hotspot/test/runtime/NMT/AutoshutdownNMT.java index 90a02ff2bd3..d07103e810c 100644 --- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java +++ b/hotspot/test/runtime/NMT/AutoshutdownNMT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Test for deprecated message if -XX:-AutoShutdownNMT is specified - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class AutoshutdownNMT { diff --git a/hotspot/test/runtime/NMT/BaselineWithParameter.java b/hotspot/test/runtime/NMT/BaselineWithParameter.java index b4982116fc2..cc7db563d99 100644 --- a/hotspot/test/runtime/NMT/BaselineWithParameter.java +++ b/hotspot/test/runtime/NMT/BaselineWithParameter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,13 +26,15 @@ * @bug 8004802 * @key nmt jcmd regression * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class BaselineWithParameter { diff --git a/hotspot/test/runtime/NMT/ChangeTrackingLevel.java b/hotspot/test/runtime/NMT/ChangeTrackingLevel.java index e7905480665..f10493a4d13 100644 --- a/hotspot/test/runtime/NMT/ChangeTrackingLevel.java +++ b/hotspot/test/runtime/NMT/ChangeTrackingLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,14 +27,13 @@ * @summary Test that you can decrease NMT tracking level but not increase it. * @key nmt * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build ChangeTrackingLevel + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel */ -import jdk.test.lib.*; import sun.hotspot.WhiteBox; public class ChangeTrackingLevel { diff --git a/hotspot/test/runtime/NMT/CheckForProperDetailStackTrace.java b/hotspot/test/runtime/NMT/CheckForProperDetailStackTrace.java index 7936a9b7253..c053f660e9e 100644 --- a/hotspot/test/runtime/NMT/CheckForProperDetailStackTrace.java +++ b/hotspot/test/runtime/NMT/CheckForProperDetailStackTrace.java @@ -25,12 +25,14 @@ * @test * @key nmt * @summary Running with NMT detail should produce expected stack traces. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/hotspot/test/runtime/NMT/CommandLineDetail.java b/hotspot/test/runtime/NMT/CommandLineDetail.java index 70d914a53b2..9999ed66a5e 100644 --- a/hotspot/test/runtime/NMT/CommandLineDetail.java +++ b/hotspot/test/runtime/NMT/CommandLineDetail.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Running with NMT detail should not result in an error - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CommandLineDetail { diff --git a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java index 510c0024f29..d4cb23f53d5 100644 --- a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java +++ b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Empty argument to NMT should result in an informative error message - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CommandLineEmptyArgument { diff --git a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java index 985e8e49dd1..53e751b5c08 100644 --- a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java +++ b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Invalid argument to NMT should result in an informative error message - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CommandLineInvalidArgument { diff --git a/hotspot/test/runtime/NMT/CommandLineSummary.java b/hotspot/test/runtime/NMT/CommandLineSummary.java index 67198395657..7017a3bb7e3 100644 --- a/hotspot/test/runtime/NMT/CommandLineSummary.java +++ b/hotspot/test/runtime/NMT/CommandLineSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Running with NMT summary should not result in an error - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CommandLineSummary { diff --git a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java index 33893080957..46b219cee99 100644 --- a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java +++ b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Turning off NMT should not result in an error - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CommandLineTurnOffNMT { diff --git a/hotspot/test/runtime/NMT/CommitOverlappingRegions.java b/hotspot/test/runtime/NMT/CommitOverlappingRegions.java index 773378ce7e8..8e1b6ddbbcd 100644 --- a/hotspot/test/runtime/NMT/CommitOverlappingRegions.java +++ b/hotspot/test/runtime/NMT/CommitOverlappingRegions.java @@ -25,16 +25,18 @@ * @test * @summary Test commits of overlapping regions of memory. * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build CommitOverlappingRegions + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail CommitOverlappingRegions */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; public class CommitOverlappingRegions { diff --git a/hotspot/test/runtime/NMT/JcmdBaselineDetail.java b/hotspot/test/runtime/NMT/JcmdBaselineDetail.java index 1318dc339e3..91b033c2fac 100644 --- a/hotspot/test/runtime/NMT/JcmdBaselineDetail.java +++ b/hotspot/test/runtime/NMT/JcmdBaselineDetail.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Verify that jcmd correctly reports that baseline succeeds with NMT enabled with detailed tracking. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=detail JcmdBaselineDetail */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class JcmdBaselineDetail { diff --git a/hotspot/test/runtime/NMT/JcmdDetailDiff.java b/hotspot/test/runtime/NMT/JcmdDetailDiff.java index 962afd155f1..d149a83ae80 100644 --- a/hotspot/test/runtime/NMT/JcmdDetailDiff.java +++ b/hotspot/test/runtime/NMT/JcmdDetailDiff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,15 +25,17 @@ * @test * @summary run NMT baseline, allocate memory and verify output from detail.diff * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build JcmdDetailDiff + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail JcmdDetailDiff */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/JcmdScale.java b/hotspot/test/runtime/NMT/JcmdScale.java index b8d8e5686e2..c155a08e7cd 100644 --- a/hotspot/test/runtime/NMT/JcmdScale.java +++ b/hotspot/test/runtime/NMT/JcmdScale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Test the NMT scale parameter - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class JcmdScale { diff --git a/hotspot/test/runtime/NMT/JcmdScaleDetail.java b/hotspot/test/runtime/NMT/JcmdScaleDetail.java index 27cb8c8dc47..77f44b2c3e6 100644 --- a/hotspot/test/runtime/NMT/JcmdScaleDetail.java +++ b/hotspot/test/runtime/NMT/JcmdScaleDetail.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Test the NMT scale parameter with detail tracking level - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=detail JcmdScaleDetail */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class JcmdScaleDetail { diff --git a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java index 2c0b39cf77d..005f14d5ce6 100644 --- a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java +++ b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,15 +25,17 @@ * @test * @summary run NMT baseline, allocate memory and verify output from summary.diff * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build JcmdSummaryDiff + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary JcmdSummaryDiff */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java index 40818656b8f..8df6da85a89 100644 --- a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java +++ b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Verify that jcmd correctly reports that NMT is not enabled - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main JcmdWithNMTDisabled 1 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class JcmdWithNMTDisabled { static ProcessBuilder pb = new ProcessBuilder(); diff --git a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java index b5ff6dda485..0dbb96fbc0d 100644 --- a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java +++ b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @summary Test consistency of NMT by creating allocations of the Test type with various sizes and verifying visibility with jcmd * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build MallocRoundingReportTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest * */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java b/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java index 3bb39aa0afe..804c7b27f77 100644 --- a/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java +++ b/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,13 +27,15 @@ * @requires sun.arch.data.model == "32" * @key nmt jcmd stress * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build MallocSiteHashOverflow + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocSiteHashOverflow */ -import jdk.test.lib.*; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; public class MallocSiteHashOverflow { diff --git a/hotspot/test/runtime/NMT/MallocStressTest.java b/hotspot/test/runtime/NMT/MallocStressTest.java index 8d7061f7ce2..b63166c0cda 100644 --- a/hotspot/test/runtime/NMT/MallocStressTest.java +++ b/hotspot/test/runtime/NMT/MallocStressTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,10 +25,10 @@ * @test * @summary Stress test for malloc tracking * @key nmt jcmd stress - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build MallocStressTest + * @build sun.hotspot.WhiteBox * @ignore - This test is disabled since it will stress NMT and timeout during normal testing * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocStressTest @@ -38,7 +38,10 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.ArrayList; import java.util.List; import java.util.Random; -import jdk.test.lib.*; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; public class MallocStressTest { diff --git a/hotspot/test/runtime/NMT/MallocTestType.java b/hotspot/test/runtime/NMT/MallocTestType.java index 3ee5e481a01..624ec8dd8ce 100644 --- a/hotspot/test/runtime/NMT/MallocTestType.java +++ b/hotspot/test/runtime/NMT/MallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,16 +25,18 @@ * @test * @summary Test consistency of NMT by leaking a few select allocations of the Test type and then verify visibility with jcmd * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build MallocTestType + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; public class MallocTestType { diff --git a/hotspot/test/runtime/NMT/MallocTrackingVerify.java b/hotspot/test/runtime/NMT/MallocTrackingVerify.java index 0a77bd25bd4..d7ffdd28e31 100644 --- a/hotspot/test/runtime/NMT/MallocTrackingVerify.java +++ b/hotspot/test/runtime/NMT/MallocTrackingVerify.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,10 +26,10 @@ * @bug 8054836 * @summary Test to verify correctness of malloc tracking * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build MallocTrackingVerify + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTrackingVerify * @@ -38,7 +38,9 @@ import java.util.ArrayList; import java.util.Random; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/NMTWithCDS.java b/hotspot/test/runtime/NMT/NMTWithCDS.java index a4a409a0dd5..2df23514610 100644 --- a/hotspot/test/runtime/NMT/NMTWithCDS.java +++ b/hotspot/test/runtime/NMT/NMTWithCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,13 @@ * @test * @bug 8055061 * @key nmt - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main NMTWithCDS */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class NMTWithCDS { diff --git a/hotspot/test/runtime/NMT/PrintNMTStatistics.java b/hotspot/test/runtime/NMT/PrintNMTStatistics.java index 11138ec0d48..93dfd571496 100644 --- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java +++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java @@ -27,10 +27,11 @@ * @bug 8005936 8058606 * @summary Verify PrintNMTStatistics on normal JVM exit for detail and summary tracking level * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class PrintNMTStatistics { diff --git a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java index 311d834bb4c..727085c57b3 100644 --- a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java +++ b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @key nmt * @summary Trying to enable PrintNMTStatistics should result in a warning - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class PrintNMTStatisticsWithNMTDisabled { diff --git a/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java b/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java index c67b6227754..6893c2e432e 100644 --- a/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java +++ b/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,8 +27,8 @@ * @summary Release committed memory and make sure NMT handles it correctly * @key nmt regression * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build ReleaseCommittedMemory + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory diff --git a/hotspot/test/runtime/NMT/ReleaseNoCommit.java b/hotspot/test/runtime/NMT/ReleaseNoCommit.java index 0d354115b06..b5e61e10144 100644 --- a/hotspot/test/runtime/NMT/ReleaseNoCommit.java +++ b/hotspot/test/runtime/NMT/ReleaseNoCommit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,17 +25,17 @@ * @test * @summary Release uncommitted memory and make sure NMT handles it correctly * @key nmt regression - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build ReleaseNoCommit + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary ReleaseNoCommit */ import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/ShutdownTwice.java b/hotspot/test/runtime/NMT/ShutdownTwice.java index d0a7c7777e4..fe312457b8f 100644 --- a/hotspot/test/runtime/NMT/ShutdownTwice.java +++ b/hotspot/test/runtime/NMT/ShutdownTwice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Run shutdown twice - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class ShutdownTwice { diff --git a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java index aec1a808576..42d57da0ffa 100644 --- a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java +++ b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,13 +25,15 @@ * @test * @key nmt jcmd * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class SummaryAfterShutdown { diff --git a/hotspot/test/runtime/NMT/SummarySanityCheck.java b/hotspot/test/runtime/NMT/SummarySanityCheck.java index 511596bb61d..174d710af2c 100644 --- a/hotspot/test/runtime/NMT/SummarySanityCheck.java +++ b/hotspot/test/runtime/NMT/SummarySanityCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,16 +25,18 @@ * @test * @key nmt jcmd * @summary Sanity check the output of NMT - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build SummarySanityCheck + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java index 2fee0c79f73..76050204600 100644 --- a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java +++ b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,16 +24,18 @@ /* * @test * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build ThreadedMallocTestType + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; public class ThreadedMallocTestType { diff --git a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java index 1611b6f345d..5513cddc12a 100644 --- a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java +++ b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,16 +24,18 @@ /* * @test * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build ThreadedVirtualAllocTestType + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; public class ThreadedVirtualAllocTestType { diff --git a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java index dabdcd443a2..f1cc44265fd 100644 --- a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java +++ b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @summary Test reserve/commit/uncommit/release of virtual memory and that we track it correctly * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build VirtualAllocCommitUncommitRecommit + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocCommitUncommitRecommit * */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/NMT/VirtualAllocTestType.java b/hotspot/test/runtime/NMT/VirtualAllocTestType.java index da611ab8b29..31722d3accd 100644 --- a/hotspot/test/runtime/NMT/VirtualAllocTestType.java +++ b/hotspot/test/runtime/NMT/VirtualAllocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,16 +25,18 @@ * @test * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly * @key nmt jcmd - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build VirtualAllocTestType + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import sun.hotspot.WhiteBox; public class VirtualAllocTestType { diff --git a/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java b/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java index 512dbc9914e..e136be8377c 100644 --- a/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java +++ b/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,7 +25,7 @@ * @test * @bug 8030955 * @summary Allow multiple calls to PerfMemory::destroy() without asserting. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main PerfMemDestroy @@ -33,7 +33,8 @@ import java.io.File; import java.util.Map; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class PerfMemDestroy { public static void main(String args[]) throws Throwable { diff --git a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java index 9ebee649217..7479dff7839 100644 --- a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java +++ b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -21,7 +21,10 @@ * questions. */ import java.io.PrintWriter; -import jdk.test.lib.*; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * Test to redefine java/lang/Object and verify that it doesn't crash on vtable @@ -32,7 +35,7 @@ import jdk.test.lib.*; * @test * @bug 8005056 * @bug 8009728 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.instrument * java.management diff --git a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java index cfe4c97fae8..cd2cf685fa1 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java +++ b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java @@ -23,7 +23,7 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @summary Test that type annotations are retained after a retransform * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm diff --git a/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java b/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java index de76aea5b1d..bf40e8de927 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java +++ b/hotspot/test/runtime/RedefineTests/RedefineFinalizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 6904403 * @summary Don't assert if we redefine finalize method - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.compiler * java.instrument * jdk.jartool/sun.tools.jar - * @build RedefineClassHelper * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar RedefineFinalizer */ diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java index 9921afb1809..25aaa16a90d 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java +++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,11 @@ * @test * @bug 8055008 * @summary Redefine EMCP and non-EMCP methods that are running in an infinite loop - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.compiler * java.instrument * jdk.jartool/sun.tools.jar - * @build RedefineClassHelper * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethods */ diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java index 283d08ddc6b..f8e1a26f6fa 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java +++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,11 @@ * @test * @bug 8087315 * @summary Get old method's stack trace elements after GC - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.compiler * java.instrument * jdk.jartool/sun.tools.jar - * @build RedefineClassHelper * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar RedefineRunningMethodsWithBacktrace */ diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java index a56907ae0af..4d068a25711 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java +++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java @@ -25,12 +25,11 @@ * @test * @bug 8076110 * @summary Redefine running methods that have cached resolution errors - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.instrument * jdk.jartool/sun.tools.jar - * @build RedefineClassHelper * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethodsWithResolutionErrors */ diff --git a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java index a608077dfe1..6a095155349 100644 --- a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java +++ b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java @@ -23,10 +23,9 @@ /* * @test ReservedStackTest - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation - * @build jdk.test.lib.* * @run main/othervm -Xint ReservedStackTest * @run main/othervm -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest */ diff --git a/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java b/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java index fa7ba474612..1bc41f61355 100644 --- a/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java +++ b/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java @@ -25,10 +25,9 @@ * @test ReservedStackTestCompiler * @summary Run ReservedStackTest with dedicated compilers C1 and C2. * @requires vm.flavor == "server" - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation - * @build jdk.test.lib.* ReservedStackTest * @run main/othervm -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest * @run main/othervm -XX:-TieredCompilation -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest */ diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java index c05da6b0476..dd559276d40 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @bug 8047290 * @summary Ensure that a Monitor::lock_without_safepoint_check fires an assert when it incorrectly acquires a lock which must always have safepoint checks. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build AssertSafepointCheckConsistency1 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main AssertSafepointCheckConsistency1 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java index 8fc54bd36cb..04da67bea23 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @bug 8047290 * @summary Ensure that a Monitor::lock fires an assert when it incorrectly acquires a lock which must never have safepoint checks. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build AssertSafepointCheckConsistency2 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main AssertSafepointCheckConsistency2 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java index f8bf4973910..7f681b65a38 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @bug 8047290 * @summary Ensure that Monitor::lock_without_safepoint_check does not assert when it correctly acquires a lock which must never have safepoint checks. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build AssertSafepointCheckConsistency3 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main AssertSafepointCheckConsistency3 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java index 383174e0514..89ab9d416c6 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,16 +25,18 @@ * @test * @bug 8047290 * @summary Ensure that Monitor::lock does not assert when it correctly acquires a lock which must always have safepoint checks. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build AssertSafepointCheckConsistency4 + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main AssertSafepointCheckConsistency4 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/SameObject/SameObject.java b/hotspot/test/runtime/SameObject/SameObject.java index 10bb41d1a24..c0eecf51455 100644 --- a/hotspot/test/runtime/SameObject/SameObject.java +++ b/hotspot/test/runtime/SameObject/SameObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -31,7 +31,7 @@ import jdk.test.lib.Asserts; * Fixed in JDK1.3.1_10 * Fixed in JDK1.4.1_07 * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main/othervm/native -Xcheck:jni SameObject */ public class SameObject { diff --git a/hotspot/test/runtime/SelectionResolution/AbstractMethodErrorTest.java b/hotspot/test/runtime/SelectionResolution/AbstractMethodErrorTest.java index 0c2d98c5273..02b292d4287 100644 --- a/hotspot/test/runtime/SelectionResolution/AbstractMethodErrorTest.java +++ b/hotspot/test/runtime/SelectionResolution/AbstractMethodErrorTest.java @@ -27,7 +27,6 @@ * generate AbstractMethodErrorTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies AbstractMethodErrorTest */ diff --git a/hotspot/test/runtime/SelectionResolution/IllegalAccessErrorTest.java b/hotspot/test/runtime/SelectionResolution/IllegalAccessErrorTest.java index 7bc2350ddb1..3af56c50f38 100644 --- a/hotspot/test/runtime/SelectionResolution/IllegalAccessErrorTest.java +++ b/hotspot/test/runtime/SelectionResolution/IllegalAccessErrorTest.java @@ -27,7 +27,6 @@ * generate IllegalAccessErrorTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies IllegalAccessErrorTest */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeInterfaceICCE.java b/hotspot/test/runtime/SelectionResolution/InvokeInterfaceICCE.java index b3bafc6b6b7..a775e857027 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeInterfaceICCE.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeInterfaceICCE.java @@ -27,7 +27,6 @@ * generate IncompatibleClassChangeError * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm/timeout=500 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeInterfaceICCE */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java b/hotspot/test/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java index a4246742387..cf75021fa71 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java @@ -27,7 +27,6 @@ * generate InvokeInterfaceSuccessTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeInterfaceSuccessTest */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeSpecialICCE.java b/hotspot/test/runtime/SelectionResolution/InvokeSpecialICCE.java index 9086689451e..9fee0111263 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeSpecialICCE.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeSpecialICCE.java @@ -27,7 +27,6 @@ * generate IncompatibleClassChangeError * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeSpecialICCE */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeSpecialSuccessTest.java b/hotspot/test/runtime/SelectionResolution/InvokeSpecialSuccessTest.java index 71f266c2f0f..eb60df4148d 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeSpecialSuccessTest.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeSpecialSuccessTest.java @@ -27,7 +27,6 @@ * generate InvokeSpecialSuccessTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeSpecialSuccessTest */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeStaticICCE.java b/hotspot/test/runtime/SelectionResolution/InvokeStaticICCE.java index 54ce64154bd..3ce93c5e03e 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeStaticICCE.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeStaticICCE.java @@ -27,7 +27,6 @@ * generate IncompatibleClassChangeError * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeStaticICCE */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeStaticSuccessTest.java b/hotspot/test/runtime/SelectionResolution/InvokeStaticSuccessTest.java index 367816961b4..b10566694ad 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeStaticSuccessTest.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeStaticSuccessTest.java @@ -27,7 +27,6 @@ * generate InvokeStaticSuccessTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main InvokeStaticSuccessTest */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeVirtualICCE.java b/hotspot/test/runtime/SelectionResolution/InvokeVirtualICCE.java index 8dbe06e498b..59fe0272e5b 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeVirtualICCE.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeVirtualICCE.java @@ -27,7 +27,6 @@ * generate IncompatibleClassChangeError * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm/timeout=1200 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeVirtualICCE */ diff --git a/hotspot/test/runtime/SelectionResolution/InvokeVirtualSuccessTest.java b/hotspot/test/runtime/SelectionResolution/InvokeVirtualSuccessTest.java index 2b4deab2073..359537e5485 100644 --- a/hotspot/test/runtime/SelectionResolution/InvokeVirtualSuccessTest.java +++ b/hotspot/test/runtime/SelectionResolution/InvokeVirtualSuccessTest.java @@ -27,7 +27,6 @@ * generate InvokeVirtualSuccessTest * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main/othervm/timeout=400 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies InvokeVirtualSuccessTest */ diff --git a/hotspot/test/runtime/SelectionResolution/NoSuchMethodErrorTest.java b/hotspot/test/runtime/SelectionResolution/NoSuchMethodErrorTest.java index ec239639db0..cf8055ff0b8 100644 --- a/hotspot/test/runtime/SelectionResolution/NoSuchMethodErrorTest.java +++ b/hotspot/test/runtime/SelectionResolution/NoSuchMethodErrorTest.java @@ -27,7 +27,6 @@ * generate NoSuchMethodError * @modules java.base/jdk.internal.org.objectweb.asm * @library /runtime/SelectionResolution/classes - * @build selectionresolution.* * @run main NoSuchMethodErrorTest */ diff --git a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java index 009f8f4147a..728567a353c 100644 --- a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java +++ b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,13 +27,14 @@ * attempting to use CDS archive. JVM should exit gracefully * when sharing mode is ON, and continue w/o sharing if sharing * mode is AUTO. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main ArchiveDoesNotExist */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; public class ArchiveDoesNotExist { diff --git a/hotspot/test/runtime/SharedArchiveFile/BootAppendTests.java b/hotspot/test/runtime/SharedArchiveFile/BootAppendTests.java index b354fcbf355..6510e605d76 100644 --- a/hotspot/test/runtime/SharedArchiveFile/BootAppendTests.java +++ b/hotspot/test/runtime/SharedArchiveFile/BootAppendTests.java @@ -24,7 +24,7 @@ /** * @test * @summary Testing -Xbootclasspath/a support for CDS - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * jdk.jvmstat/sun.jvmstat.monitor @@ -32,7 +32,7 @@ * @compile javax/sound/sampled/MyClass.jasm * @compile org/omg/CORBA/Context.jasm * @compile nonjdk/myPackage/MyClass.java - * @build jdk.test.lib.* LoadClass ClassFileInstaller + * @build LoadClass * @run main/othervm BootAppendTests */ @@ -44,8 +44,8 @@ import java.io.PrintStream; import java.nio.file.Path; import java.nio.file.Paths; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class BootAppendTests { private static final String APP_CLASS = "LoadClass"; diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentCompactStrings.java b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentCompactStrings.java index 90422d294ab..51a341d0900 100644 --- a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentCompactStrings.java +++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentCompactStrings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test CdsDifferentCompactStrings * @summary CDS (class data sharing) requires the same -XX:[+-]CompactStrings * setting between archive creation time and load time. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class CdsDifferentCompactStrings { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java index 7be3968b28a..7a233965d56 100644 --- a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java +++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -28,13 +28,15 @@ * This is a negative test; using object alignment for loading that * is different from object alignment for creating a CDS file * should fail when loading. - * @library /testlibrary + * @library /test/lib * @bug 8025642 * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class CdsDifferentObjectAlignment { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java index 6dc33f90ceb..83b8fd1fa0e 100644 --- a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java +++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,14 @@ * @test CdsSameObjectAlignment * @summary Testing CDS (class data sharing) using varying object alignment. * Using same object alignment for each dump/load pair - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class CdsSameObjectAlignment { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java index 2fe4753bdbc..397a45f17cf 100644 --- a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java +++ b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test DefaultUseWithClient * @summary Test default behavior of sharing with -client - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @ignore 8154204 @@ -32,7 +32,9 @@ * @bug 8032224 */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import java.io.File; public class DefaultUseWithClient { diff --git a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java index 4d24b549fd4..83ecda87901 100644 --- a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java +++ b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,15 @@ * @test * @bug 8059510 * @summary Test jcmd VM.symboltable and VM.stringtable options - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class DumpSymbolAndStringTable { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java index 47304b4f287..c38b2e3b4b3 100644 --- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java +++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java @@ -23,14 +23,16 @@ /* @test LimitSharedSizes * @summary Test handling of limits on shared space size - * @library /testlibrary /runtime/CommandLine/OptionsValidation/common + * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management * jdk.attach/sun.tools.attach * @run main LimitSharedSizes */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; import optionsvalidation.JVMOptionsUtils; public class LimitSharedSizes { diff --git a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java index 8cef6b787e2..1adb658d6ca 100644 --- a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java +++ b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,12 +25,13 @@ * @test * @bug 8067187 * @summary Testing CDS dumping with the -XX:MaxMetaspaceSize= option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class MaxMetaspaceSize { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java index 24bea75ea6f..0c496909c0e 100644 --- a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java +++ b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,13 @@ * @test * @bug 8066670 * @summary Testing -XX:+PrintSharedArchiveAndExit option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class PrintSharedArchiveAndExit { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java b/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java index 2ba4f6d139d..65cb422adad 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java +++ b/hotspot/test/runtime/SharedArchiveFile/SASymbolTableTest.java @@ -27,18 +27,21 @@ * Started failing on 2016.06.24 due to 8160376 on MacOS X so quarantine * it on that platform: * @requires os.family != "mac" - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot.oops * jdk.hotspot.agent/sun.jvm.hotspot.memory * jdk.hotspot.agent/sun.jvm.hotspot.runtime * jdk.hotspot.agent/sun.jvm.hotspot.tools * java.management - * @build SASymbolTableTestAgent SASymbolTableTestAttachee jdk.test.lib.* + * @build SASymbolTableTestAgent SASymbolTableTestAttachee * @run main SASymbolTableTest */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; /* * The purpose of this test is to validate that we can use SA to diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java index 2b1f03392e3..41cfb9d5a12 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,12 +25,13 @@ * @test * @bug 8014138 * @summary Testing new -XX:SharedArchiveFile= option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class SharedArchiveFile { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java index e5fee961c0f..b9dbf4b3d34 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java @@ -25,13 +25,14 @@ * @test SharedBaseAddress * @summary Test variety of values for SharedBaseAddress, making sure * VM handles normal values as well as edge values w/o a crash. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main SharedBaseAddress */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class SharedBaseAddress { diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedStrings.java b/hotspot/test/runtime/SharedArchiveFile/SharedStrings.java index 06feba0d586..3c82ccbf48d 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedStrings.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedStrings.java @@ -29,14 +29,15 @@ * @requires (sun.arch.data.model != "32") & (os.family != "windows") * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true) * @requires vm.gc.G1 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build SharedStringsWb SharedStrings ClassFileInstaller sun.hotspot.WhiteBox + * @build SharedStringsWb sun.hotspot.WhiteBox * @run main ClassFileInstaller -jar whitebox.jar sun.hotspot.WhiteBox * @run main SharedStrings */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class SharedStrings { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedStringsDedup.java b/hotspot/test/runtime/SharedArchiveFile/SharedStringsDedup.java index 432b36bffd8..fe0d36498f8 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedStringsDedup.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedStringsDedup.java @@ -28,13 +28,14 @@ * @requires (sun.arch.data.model != "32") & (os.family != "windows") * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true) * @requires vm.gc.G1 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main SharedStringsDedup */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; // The main purpose is to test the interaction between shared strings diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedStringsRunAuto.java b/hotspot/test/runtime/SharedArchiveFile/SharedStringsRunAuto.java index d4290fe6568..70467c31bca 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedStringsRunAuto.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedStringsRunAuto.java @@ -28,13 +28,14 @@ * @requires (sun.arch.data.model != "32") & (os.family != "windows") * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true) * @requires vm.gc.G1 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main SharedStringsRunAuto */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.io.File; public class SharedStringsRunAuto { diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java index e99f218ec86..632769d04a9 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,12 +25,13 @@ * @test * @bug 8059510 * @summary Test SharedSymbolTableBucketSize option - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class SharedSymbolTableBucketSize { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java index 665a3aeef94..b8371fef918 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java +++ b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,13 +24,14 @@ /* * @test SpaceUtilizationCheck * @summary Check if the space utilization for shared spaces is adequate - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main SpaceUtilizationCheck */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.regex.Pattern; import java.util.regex.Matcher; diff --git a/hotspot/test/runtime/Thread/Fibonacci.java b/hotspot/test/runtime/Thread/Fibonacci.java index 65ae1c320b1..271295a73cc 100644 --- a/hotspot/test/runtime/Thread/Fibonacci.java +++ b/hotspot/test/runtime/Thread/Fibonacci.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -29,7 +29,7 @@ * make this test inherently unstable on Windows with 32-bit VM data model. * @requires !(os.family == "windows" & sun.arch.data.model == "32") * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main/othervm Fibonacci 15 */ diff --git a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java index 36f351da560..535aedbff79 100644 --- a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java +++ b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,7 @@ * @summary Creates two threads contending for the same lock and checks * whether jstack reports "locked" by more than one thread. * - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm TestThreadDumpMonitorContention @@ -43,7 +43,9 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class TestThreadDumpMonitorContention { // jstack tends to be closely bound to the VM that we are running diff --git a/hotspot/test/runtime/Thread/ThreadPriorities.java b/hotspot/test/runtime/Thread/ThreadPriorities.java index a03d5d4a199..e445f2bb915 100644 --- a/hotspot/test/runtime/Thread/ThreadPriorities.java +++ b/hotspot/test/runtime/Thread/ThreadPriorities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -27,7 +27,7 @@ * @summary Creates several threads with different java priorities and checks * whether jstack reports correct priorities for them. * - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main ThreadPriorities @@ -38,7 +38,9 @@ import java.util.concurrent.CyclicBarrier; import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; import static jdk.test.lib.Asserts.*; public class ThreadPriorities { diff --git a/hotspot/test/runtime/ThreadSignalMask/ThreadSignalMask.java b/hotspot/test/runtime/ThreadSignalMask/ThreadSignalMask.java index 55cee37ae31..fc923a1234a 100644 --- a/hotspot/test/runtime/ThreadSignalMask/ThreadSignalMask.java +++ b/hotspot/test/runtime/ThreadSignalMask/ThreadSignalMask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -37,7 +37,7 @@ import jdk.test.lib.Asserts; * @summary JDK 1.3.0 alters thread signal mask * @requires (vm.simpleArch == "sparcv9") * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile Prog.java * @run main/native ThreadSignalMask */ diff --git a/hotspot/test/runtime/Throwable/StackTraceLogging.java b/hotspot/test/runtime/Throwable/StackTraceLogging.java index 053ab24511b..da2244cd57a 100644 --- a/hotspot/test/runtime/Throwable/StackTraceLogging.java +++ b/hotspot/test/runtime/Throwable/StackTraceLogging.java @@ -25,18 +25,17 @@ * @test * @bug 8150778 * @summary check stacktrace logging - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @compile TestThrowable.java * @run driver StackTraceLogging */ import java.io.File; import java.util.Map; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class StackTraceLogging { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/Throwable/TestThrowable.java b/hotspot/test/runtime/Throwable/TestThrowable.java index 052ed4604ed..fca76e1b927 100644 --- a/hotspot/test/runtime/Throwable/TestThrowable.java +++ b/hotspot/test/runtime/Throwable/TestThrowable.java @@ -26,7 +26,7 @@ * @bug 8150778 * @summary Test exception depths, and code to get stack traces * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main/othervm -XX:MaxJavaStackTraceDepth=1024 TestThrowable */ diff --git a/hotspot/test/runtime/Throwable/ThrowableIntrospectionSegfault.java b/hotspot/test/runtime/Throwable/ThrowableIntrospectionSegfault.java index 71f1dc22d46..ceeca290382 100644 --- a/hotspot/test/runtime/Throwable/ThrowableIntrospectionSegfault.java +++ b/hotspot/test/runtime/Throwable/ThrowableIntrospectionSegfault.java @@ -26,7 +26,6 @@ * @bug 8033735 * @summary check backtrace field introspection * @modules java.base/jdk.internal.misc - * @library /testlibrary * @run main ThrowableIntrospectionSegfault */ diff --git a/hotspot/test/runtime/Unsafe/AllocateInstance.java b/hotspot/test/runtime/Unsafe/AllocateInstance.java index 6b283d3556b..56c7f8f95d0 100644 --- a/hotspot/test/runtime/Unsafe/AllocateInstance.java +++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ /* * @test * @summary Verifies the behaviour of Unsafe.allocateInstance - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main AllocateInstance */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/AllocateMemory.java b/hotspot/test/runtime/Unsafe/AllocateMemory.java index d9f8a122afb..c32ef73664f 100644 --- a/hotspot/test/runtime/Unsafe/AllocateMemory.java +++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java @@ -25,13 +25,13 @@ * @test * @requires vm.compMode != "Xcomp" * @summary Verifies behaviour of Unsafe.allocateMemory - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/CopyMemory.java b/hotspot/test/runtime/Unsafe/CopyMemory.java index e2328d35851..3afe405db3a 100644 --- a/hotspot/test/runtime/Unsafe/CopyMemory.java +++ b/hotspot/test/runtime/Unsafe/CopyMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ /* * @test * @summary Verifies behaviour of Unsafe.copyMemory - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main CopyMemory */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/DefineClass.java b/hotspot/test/runtime/Unsafe/DefineClass.java index fa0d3b64ccd..44f8aeaef27 100644 --- a/hotspot/test/runtime/Unsafe/DefineClass.java +++ b/hotspot/test/runtime/Unsafe/DefineClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ /* * @test * @summary Verifies the behaviour of Unsafe.defineClass - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management @@ -33,7 +33,8 @@ import java.security.ProtectionDomain; import java.io.InputStream; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/FieldOffset.java b/hotspot/test/runtime/Unsafe/FieldOffset.java index abf62fc1adc..43bdf871e5f 100644 --- a/hotspot/test/runtime/Unsafe/FieldOffset.java +++ b/hotspot/test/runtime/Unsafe/FieldOffset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verifies the behaviour of Unsafe.fieldOffset - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main FieldOffset */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import java.lang.reflect.*; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetField.java b/hotspot/test/runtime/Unsafe/GetField.java index f01d5deeb7d..3aa5ede2c0f 100644 --- a/hotspot/test/runtime/Unsafe/GetField.java +++ b/hotspot/test/runtime/Unsafe/GetField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ /* * @test * @summary Verifies behaviour of Unsafe.getField - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetField */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import java.lang.reflect.*; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutAddress.java b/hotspot/test/runtime/Unsafe/GetPutAddress.java index 1dd0a18de83..0b18d4d26c8 100644 --- a/hotspot/test/runtime/Unsafe/GetPutAddress.java +++ b/hotspot/test/runtime/Unsafe/GetPutAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,14 @@ /* * @test * Verify behaviour of Unsafe.get/putAddress and Unsafe.addressSize - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutAddress */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutBoolean.java b/hotspot/test/runtime/Unsafe/GetPutBoolean.java index 51e59cf4069..03bddbfd5dd 100644 --- a/hotspot/test/runtime/Unsafe/GetPutBoolean.java +++ b/hotspot/test/runtime/Unsafe/GetPutBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putBoolean - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutBoolean */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutByte.java b/hotspot/test/runtime/Unsafe/GetPutByte.java index 48f4700d95d..10ccbfdcf59 100644 --- a/hotspot/test/runtime/Unsafe/GetPutByte.java +++ b/hotspot/test/runtime/Unsafe/GetPutByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putByte - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutByte */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutChar.java b/hotspot/test/runtime/Unsafe/GetPutChar.java index 86b5c80cc36..8a05acd7018 100644 --- a/hotspot/test/runtime/Unsafe/GetPutChar.java +++ b/hotspot/test/runtime/Unsafe/GetPutChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putChar - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutChar */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutDouble.java b/hotspot/test/runtime/Unsafe/GetPutDouble.java index 1073c8e1435..f9ccd548873 100644 --- a/hotspot/test/runtime/Unsafe/GetPutDouble.java +++ b/hotspot/test/runtime/Unsafe/GetPutDouble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putDouble - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutDouble */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutFloat.java b/hotspot/test/runtime/Unsafe/GetPutFloat.java index f49ac7541ed..005b2301591 100644 --- a/hotspot/test/runtime/Unsafe/GetPutFloat.java +++ b/hotspot/test/runtime/Unsafe/GetPutFloat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putFloat - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutFloat */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutInt.java b/hotspot/test/runtime/Unsafe/GetPutInt.java index 49f82d5d7b4..a43b7e17ef0 100644 --- a/hotspot/test/runtime/Unsafe/GetPutInt.java +++ b/hotspot/test/runtime/Unsafe/GetPutInt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,14 +23,14 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutInt */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutLong.java b/hotspot/test/runtime/Unsafe/GetPutLong.java index 8336c858f6b..8feef0bce3c 100644 --- a/hotspot/test/runtime/Unsafe/GetPutLong.java +++ b/hotspot/test/runtime/Unsafe/GetPutLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putLong - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutLong */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutObject.java b/hotspot/test/runtime/Unsafe/GetPutObject.java index 6607db3b8f6..aa6c75dbbe0 100644 --- a/hotspot/test/runtime/Unsafe/GetPutObject.java +++ b/hotspot/test/runtime/Unsafe/GetPutObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putObject - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutObject */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetPutShort.java b/hotspot/test/runtime/Unsafe/GetPutShort.java index 2ede76c1402..7a95ec23d61 100644 --- a/hotspot/test/runtime/Unsafe/GetPutShort.java +++ b/hotspot/test/runtime/Unsafe/GetPutShort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Verify behaviour of Unsafe.get/putShort - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main GetPutShort */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/GetUncompressedObject.java b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java index dc72a5e7209..f9a70e65450 100644 --- a/hotspot/test/runtime/Unsafe/GetUncompressedObject.java +++ b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,15 +23,14 @@ /* @test * @bug 8022853 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc - * @build jdk.test.lib.* * @run main GetUncompressedObject */ import static jdk.test.lib.Asserts.*; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; public class GetUncompressedObject { diff --git a/hotspot/test/runtime/Unsafe/NestedUnsafe.java b/hotspot/test/runtime/Unsafe/NestedUnsafe.java index f009d6dddd4..1acd3e505f4 100644 --- a/hotspot/test/runtime/Unsafe/NestedUnsafe.java +++ b/hotspot/test/runtime/Unsafe/NestedUnsafe.java @@ -24,7 +24,7 @@ /* * @test * @summary Creates an anonymous class inside of an anonymous class. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management @@ -34,7 +34,8 @@ import java.security.ProtectionDomain; import java.io.InputStream; import java.lang.*; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/PageSize.java b/hotspot/test/runtime/Unsafe/PageSize.java index 6ce5a1c5f47..39b6c7cf7fa 100644 --- a/hotspot/test/runtime/Unsafe/PageSize.java +++ b/hotspot/test/runtime/Unsafe/PageSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,14 @@ /* * @test * @summary Make sure pageSize() returns a value that is a power of two - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main PageSize */ import java.lang.reflect.Field; -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/PrimitiveHostClass.java b/hotspot/test/runtime/Unsafe/PrimitiveHostClass.java index f081efcaf80..ffe95401556 100644 --- a/hotspot/test/runtime/Unsafe/PrimitiveHostClass.java +++ b/hotspot/test/runtime/Unsafe/PrimitiveHostClass.java @@ -31,7 +31,6 @@ import jdk.internal.misc.Unsafe; * @test PrimitiveHostClass * @bug 8140665 * @summary Throws IllegalArgumentException if host class is a primitive class. - * @library /testlibrary * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * @compile -XDignore.symbol.file PrimitiveHostClass.java diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java index 172af2a467d..76ccea330e5 100644 --- a/hotspot/test/runtime/Unsafe/RangeCheck.java +++ b/hotspot/test/runtime/Unsafe/RangeCheck.java @@ -25,12 +25,16 @@ * @test * @bug 8001071 * @summary Add simple range check into VM implemenation of Unsafe access methods - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + import jdk.internal.misc.Unsafe; public class RangeCheck { diff --git a/hotspot/test/runtime/Unsafe/Reallocate.java b/hotspot/test/runtime/Unsafe/Reallocate.java index b2fe5d939e2..5dec176fa04 100644 --- a/hotspot/test/runtime/Unsafe/Reallocate.java +++ b/hotspot/test/runtime/Unsafe/Reallocate.java @@ -25,13 +25,13 @@ * @test * @requires vm.compMode != "Xcomp" * @bug 8058897 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/SetMemory.java b/hotspot/test/runtime/Unsafe/SetMemory.java index 8ff36cc788b..a426c741a3d 100644 --- a/hotspot/test/runtime/Unsafe/SetMemory.java +++ b/hotspot/test/runtime/Unsafe/SetMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ /* * @test * @summary Verifies that setMemory works correctly - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main SetMemory */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/Unsafe/ThrowException.java b/hotspot/test/runtime/Unsafe/ThrowException.java index c263aa18684..5056000acb3 100644 --- a/hotspot/test/runtime/Unsafe/ThrowException.java +++ b/hotspot/test/runtime/Unsafe/ThrowException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,13 +24,13 @@ /* * @test * @summary Verify that throwException() can throw an exception - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main ThrowException */ -import jdk.test.lib.*; +import jdk.test.lib.Utils; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java index 1cc20a1ef24..62cc40968ba 100644 --- a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java +++ b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,7 +25,7 @@ * @test * @bug 7051189 8023393 * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main XCheckJSig @@ -33,7 +33,9 @@ import java.io.File; import java.util.Map; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class XCheckJSig { public static void main(String args[]) throws Throwable { diff --git a/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java b/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java index 2415cc22029..e7fba9fde42 100644 --- a/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java +++ b/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8040018 - * @library /testlibrary + * @library /test/lib * @summary Check for exception instead of assert. * @modules java.base/jdk.internal.misc * java.management @@ -32,7 +32,8 @@ */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ClassFileParserBug { public static void main(String args[]) throws Throwable { diff --git a/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java b/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java index be0dc53dee9..0100d0433cf 100644 --- a/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java +++ b/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test TestEmptyBootstrapMethodsAttr * @bug 8041918 - * @library /testlibrary + * @library /test/lib * @summary Test empty bootstrap_methods table within BootstrapMethods attribute * @modules java.base/jdk.internal.misc * java.management @@ -33,7 +33,9 @@ */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; public class TestEmptyBootstrapMethodsAttr { diff --git a/hotspot/test/runtime/contended/Options.java b/hotspot/test/runtime/contended/Options.java index cd11d8230f8..69892cc8e9c 100644 --- a/hotspot/test/runtime/contended/Options.java +++ b/hotspot/test/runtime/contended/Options.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -21,14 +21,15 @@ * questions. */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test * @bug 8006997 * @summary ContendedPaddingWidth should be range-checked * - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main Options diff --git a/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java b/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java index 8d1ddab89df..c2b6e759d42 100644 --- a/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java +++ b/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @bug 8040292 - * @library /testlibrary + * @library /test/lib * @summary Throw exceptions when duplicate attributes are detected. * @modules java.base/jdk.internal.misc * java.management @@ -32,7 +32,8 @@ */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class DuplAttributesTest { diff --git a/hotspot/test/runtime/execstack/Testexecstack.java b/hotspot/test/runtime/execstack/Testexecstack.java index eb0b89f0117..7af23d7a41e 100644 --- a/hotspot/test/runtime/execstack/Testexecstack.java +++ b/hotspot/test/runtime/execstack/Testexecstack.java @@ -28,14 +28,15 @@ * @bug 8025519 * @summary Stack guard pages lost after loading library with executable stack. * @requires (os.family == "linux") - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib + * @modules java.base/jdk.internal.misc * @compile Test.java * @compile TestMT.java * @run driver Testexecstack */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class Testexecstack { diff --git a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java index cce37fa72ff..fb87f8fbc1e 100644 --- a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java +++ b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java @@ -26,14 +26,16 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.loader * java.desktop - * @library /testlibrary + * @library /test/lib * @run main/othervm GetSysPkgTest */ import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; // Test that JVM get_system_package() returns the module location for defined packages. public class GetSysPkgTest { diff --git a/hotspot/test/runtime/interned/SanityTest.java b/hotspot/test/runtime/interned/SanityTest.java index c0f2f726040..7ce22bb4238 100644 --- a/hotspot/test/runtime/interned/SanityTest.java +++ b/hotspot/test/runtime/interned/SanityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,8 +25,8 @@ * @test SanityTest * @summary Sanity check of String.intern() & GC * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build SanityTest + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SanityTest diff --git a/hotspot/test/runtime/jni/ToStringInInterfaceTest/ToStringTest.java b/hotspot/test/runtime/jni/ToStringInInterfaceTest/ToStringTest.java index 02d4d55365e..e9c0fa45f24 100644 --- a/hotspot/test/runtime/jni/ToStringInInterfaceTest/ToStringTest.java +++ b/hotspot/test/runtime/jni/ToStringInInterfaceTest/ToStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,8 +23,7 @@ /* @test * @bug 8072588 - * @build InterfaceWithToString - * @build ImplementationOfWithToString + * @build InterfaceWithToString ImplementationOfWithToString * @run main/native ToStringTest */ public final class ToStringTest { diff --git a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java index 49201a7aa13..9d744f22f40 100644 --- a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java +++ b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,8 +28,7 @@ * @summary make sure the Solaris Sparc M7 libadimalloc.so library generates SIGSEGV's on buffer overflow * @requires (os.family == "solaris" & os.arch == "sparcv9") * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @compile SEGVOverflow.java * @run driver Testlibadimalloc */ @@ -37,7 +36,7 @@ import java.io.*; import java.nio.file.*; import java.util.*; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class Testlibadimalloc { diff --git a/hotspot/test/runtime/logging/BiasedLockingTest.java b/hotspot/test/runtime/logging/BiasedLockingTest.java index 365f31934b0..75ea90b352b 100644 --- a/hotspot/test/runtime/logging/BiasedLockingTest.java +++ b/hotspot/test/runtime/logging/BiasedLockingTest.java @@ -25,15 +25,14 @@ * @test * @bug 8149383 * @summary -Xlog:biasedlocking should have logging from statements in the source code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver BiasedLockingTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class BiasedLockingTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/ClassInitializationTest.java b/hotspot/test/runtime/logging/ClassInitializationTest.java index 9ffd4d236fe..90a5bdb4353 100644 --- a/hotspot/test/runtime/logging/ClassInitializationTest.java +++ b/hotspot/test/runtime/logging/ClassInitializationTest.java @@ -26,15 +26,14 @@ * @test ClassInitializationTest * @bug 8142976 * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile BadMap50.jasm - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.Platform jdk.test.lib.ProcessTools * @run driver ClassInitializationTest */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class ClassInitializationTest { diff --git a/hotspot/test/runtime/logging/ClassLoadUnloadTest.java b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java index e9c5d97ba83..1c2396327aa 100644 --- a/hotspot/test/runtime/logging/ClassLoadUnloadTest.java +++ b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java @@ -26,13 +26,14 @@ * @test ClassLoadUnloadTest * @bug 8142506 * @modules java.base/jdk.internal.misc - * @library /testlibrary /runtime/testlibrary + * @library /test/lib /runtime/testlibrary * @library classes - * @build ClassUnloadCommon test.Empty jdk.test.lib.* jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @build test.Empty * @run driver ClassLoadUnloadTest */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.lang.ref.WeakReference; import java.lang.reflect.Method; import java.util.ArrayList; diff --git a/hotspot/test/runtime/logging/ClassResolutionTest.java b/hotspot/test/runtime/logging/ClassResolutionTest.java index ceebd4c3ac0..32f43b13337 100644 --- a/hotspot/test/runtime/logging/ClassResolutionTest.java +++ b/hotspot/test/runtime/logging/ClassResolutionTest.java @@ -26,13 +26,12 @@ * @test ClassResolutionTest * @bug 8144874 * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @library /test/lib * @run driver ClassResolutionTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.lang.ref.WeakReference; import java.lang.reflect.Method; diff --git a/hotspot/test/runtime/logging/CompressedOopsTest.java b/hotspot/test/runtime/logging/CompressedOopsTest.java index 2216f957d8c..aa5bcf9b95f 100644 --- a/hotspot/test/runtime/logging/CompressedOopsTest.java +++ b/hotspot/test/runtime/logging/CompressedOopsTest.java @@ -26,16 +26,15 @@ * @bug 8149991 * @requires (sun.arch.data.model == "64") * @summary -Xlog:gc+heap+coops=info should have output from the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.Platform jdk.test.lib.ProcessTools * @run driver CompressedOopsTest */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class CompressedOopsTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/DefaultMethodsTest.java b/hotspot/test/runtime/logging/DefaultMethodsTest.java index e910bbb920c..3790689f9bf 100644 --- a/hotspot/test/runtime/logging/DefaultMethodsTest.java +++ b/hotspot/test/runtime/logging/DefaultMethodsTest.java @@ -25,15 +25,14 @@ * @test * @bug 8139564 * @summary defaultmethods=debug should have logging from each of the statements in the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver DefaultMethodsTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class DefaultMethodsTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java index 6d2e60f2b8b..27a12c8e930 100644 --- a/hotspot/test/runtime/logging/ExceptionsTest.java +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -25,17 +25,16 @@ * @test * @bug 8141211 8147477 * @summary exceptions=info output should have an exception message for interpreter methods - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver ExceptionsTest */ import java.io.File; import java.util.Map; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class ExceptionsTest { static void updateEnvironment(ProcessBuilder pb, String environmentVariable, String value) { diff --git a/hotspot/test/runtime/logging/ItablesTest.java b/hotspot/test/runtime/logging/ItablesTest.java index 44fb7b486e2..48ed3963570 100644 --- a/hotspot/test/runtime/logging/ItablesTest.java +++ b/hotspot/test/runtime/logging/ItablesTest.java @@ -26,7 +26,7 @@ * @bug 8141564 * @summary itables=trace should have logging from each of the statements * in the code - * @library /testlibrary + * @library /test/lib * @compile ClassB.java * ItablesVtableTest.java * @modules java.base/jdk.internal.misc @@ -34,7 +34,9 @@ * @run driver ItablesTest */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; public class ItablesTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/LoaderConstraintsTest.java b/hotspot/test/runtime/logging/LoaderConstraintsTest.java index ea6e13b673e..49dc5d278da 100644 --- a/hotspot/test/runtime/logging/LoaderConstraintsTest.java +++ b/hotspot/test/runtime/logging/LoaderConstraintsTest.java @@ -26,13 +26,12 @@ * @test LoaderConstraintsTest * @bug 8149996 * @modules java.base/jdk.internal.misc - * @library /testlibrary /runtime/testlibrary - * @library classes - * @build ClassUnloadCommon test.Empty jdk.test.lib.* jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @library /test/lib /runtime/testlibrary classes * @run driver LoaderConstraintsTest */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.lang.ref.WeakReference; import java.lang.reflect.Method; import java.util.ArrayList; diff --git a/hotspot/test/runtime/logging/ModulesTest.java b/hotspot/test/runtime/logging/ModulesTest.java index e1689fb41aa..13d4ed171a8 100644 --- a/hotspot/test/runtime/logging/ModulesTest.java +++ b/hotspot/test/runtime/logging/ModulesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,15 +24,14 @@ /* * @test * @summary modules=debug should have logging from statements in the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run main ModulesTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class ModulesTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java index dca42b223f0..ab927b4474c 100644 --- a/hotspot/test/runtime/logging/MonitorInflationTest.java +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -25,15 +25,14 @@ * @test * @bug 8133885 * @summary monitorinflation=debug should have logging from each of the statements in the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver MonitorInflationTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class MonitorInflationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/MonitorMismatchTest.java b/hotspot/test/runtime/logging/MonitorMismatchTest.java index 0d7c76f0ce1..f0550841657 100644 --- a/hotspot/test/runtime/logging/MonitorMismatchTest.java +++ b/hotspot/test/runtime/logging/MonitorMismatchTest.java @@ -26,14 +26,13 @@ * @test MonitorMismatchTest * @bug 8150084 * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile MonitorMismatchHelper.jasm - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools jdk.test.lib.Platform * @run driver MonitorMismatchTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Platform; public class MonitorMismatchTest { diff --git a/hotspot/test/runtime/logging/OsCpuLoggingTest.java b/hotspot/test/runtime/logging/OsCpuLoggingTest.java index 94aba04f7b0..93ed049f6bf 100644 --- a/hotspot/test/runtime/logging/OsCpuLoggingTest.java +++ b/hotspot/test/runtime/logging/OsCpuLoggingTest.java @@ -25,16 +25,17 @@ * @test * @bug 8151939 * @summary os+cpu output should contain some os,cpu information - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver OsCpuLoggingTest */ import java.io.File; import java.util.Map; -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class OsCpuLoggingTest { diff --git a/hotspot/test/runtime/logging/ProtectionDomainVerificationTest.java b/hotspot/test/runtime/logging/ProtectionDomainVerificationTest.java index 919d9582074..1d145047e86 100644 --- a/hotspot/test/runtime/logging/ProtectionDomainVerificationTest.java +++ b/hotspot/test/runtime/logging/ProtectionDomainVerificationTest.java @@ -25,14 +25,13 @@ * @test ProtectionDomainVerificationTest * @bug 8149064 * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.Platform jdk.test.lib.ProcessTools + * @library /test/lib * @run driver ProtectionDomainVerificationTest */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class ProtectionDomainVerificationTest { diff --git a/hotspot/test/runtime/logging/RemovedDevelopFlagsTest.java b/hotspot/test/runtime/logging/RemovedDevelopFlagsTest.java index 47d61d1b0f2..a53749812a0 100644 --- a/hotspot/test/runtime/logging/RemovedDevelopFlagsTest.java +++ b/hotspot/test/runtime/logging/RemovedDevelopFlagsTest.java @@ -26,11 +26,12 @@ * @test RemovedDevelopFlagsTest * @bug 8146632 * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @library /test/lib * @run driver RemovedDevelopFlagsTest */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class RemovedDevelopFlagsTest { public static ProcessBuilder pb; diff --git a/hotspot/test/runtime/logging/SafepointCleanupTest.java b/hotspot/test/runtime/logging/SafepointCleanupTest.java index cbec3cb5763..1f52daca0c7 100644 --- a/hotspot/test/runtime/logging/SafepointCleanupTest.java +++ b/hotspot/test/runtime/logging/SafepointCleanupTest.java @@ -25,15 +25,14 @@ * @test * @bug 8149991 * @summary safepoint+cleanup=info should have output from the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver SafepointCleanupTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class SafepointCleanupTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/SafepointTest.java b/hotspot/test/runtime/logging/SafepointTest.java index 184706b9516..161302fdb36 100644 --- a/hotspot/test/runtime/logging/SafepointTest.java +++ b/hotspot/test/runtime/logging/SafepointTest.java @@ -25,16 +25,15 @@ * @test * @bug 8140348 * @summary safepoint=trace should have output from each log statement in the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver SafepointTest */ import java.lang.ref.WeakReference; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class SafepointTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/StartupTimeTest.java b/hotspot/test/runtime/logging/StartupTimeTest.java index 1c5a77e8730..dfd3514be4a 100644 --- a/hotspot/test/runtime/logging/StartupTimeTest.java +++ b/hotspot/test/runtime/logging/StartupTimeTest.java @@ -25,15 +25,14 @@ * @test * @bug 8148630 * @summary -Xlog:startuptime should produce logging from the source code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver StartupTimeTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class StartupTimeTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/ThreadLoggingTest.java b/hotspot/test/runtime/logging/ThreadLoggingTest.java index e3cc0695ec0..1f06e0594d9 100644 --- a/hotspot/test/runtime/logging/ThreadLoggingTest.java +++ b/hotspot/test/runtime/logging/ThreadLoggingTest.java @@ -26,18 +26,17 @@ * @test * @bug 8149036 8150619 * @summary os+thread output should contain logging calls for thread start stop attaches detaches - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver ThreadLoggingTest * @author Thomas Stuefe (SAP) */ import java.io.File; import java.util.Map; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class ThreadLoggingTest { diff --git a/hotspot/test/runtime/logging/VMOperationTest.java b/hotspot/test/runtime/logging/VMOperationTest.java index 9ffe8632d58..b72410bf497 100644 --- a/hotspot/test/runtime/logging/VMOperationTest.java +++ b/hotspot/test/runtime/logging/VMOperationTest.java @@ -25,16 +25,15 @@ * @test * @bug 8143157 * @summary vmoperation=debug should have logging output - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver VMOperationTest */ import java.lang.ref.WeakReference; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class VMOperationTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/VerificationTest.java b/hotspot/test/runtime/logging/VerificationTest.java index d49b7b3547f..de64713cbd8 100644 --- a/hotspot/test/runtime/logging/VerificationTest.java +++ b/hotspot/test/runtime/logging/VerificationTest.java @@ -25,15 +25,14 @@ * @test * @bug 8150083 * @summary verification=info output should have output from the code - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver VerificationTest */ -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class VerificationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/VtablesTest.java b/hotspot/test/runtime/logging/VtablesTest.java index b23fec00b3a..c80e0b98aae 100644 --- a/hotspot/test/runtime/logging/VtablesTest.java +++ b/hotspot/test/runtime/logging/VtablesTest.java @@ -25,7 +25,7 @@ * @test * @bug 8141564 * @summary vtables=trace should have logging from each of the statements in the code - * @library /testlibrary + * @library /test/lib * @compile ClassB.java * p1/A.java * p2/B.jcod @@ -36,7 +36,9 @@ * @run driver VtablesTest */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class VtablesTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java b/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java index 0b86e9d11a8..37b06f71936 100644 --- a/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java +++ b/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,15 +24,15 @@ /* @test TestLargePageSizeInBytes * @summary Tests that the flag -XX:LargePageSizeInBytes does not cause warnings on Solaris * @bug 8049536 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver TestLargePageSizeInBytes */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; public class TestLargePageSizeInBytes { private static long M = 1024L * 1024L; diff --git a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java index 2cfb5a70ace..90075297489 100644 --- a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java +++ b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -23,15 +23,15 @@ /* @test TestLargePagesFlags * @summary Tests how large pages are choosen depending on the given large pages flag combinations. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main TestLargePagesFlags */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; import java.util.ArrayList; public class TestLargePagesFlags { diff --git a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java index e47aa48ea2f..6beef36a27e 100644 --- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java +++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,16 +24,18 @@ /* * @test * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build ReadFromNoaccessArea + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main ReadFromNoaccessArea */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.WhiteBox; public class ReadFromNoaccessArea { diff --git a/hotspot/test/runtime/memory/ReadVMPageSize.java b/hotspot/test/runtime/memory/ReadVMPageSize.java index aa83ce0b582..f9bf76fe9f6 100644 --- a/hotspot/test/runtime/memory/ReadVMPageSize.java +++ b/hotspot/test/runtime/memory/ReadVMPageSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,13 +25,12 @@ * @test * @summary Using WhiteBox to get VM page size * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build ReadVMPageSize + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ReadVMPageSize */ -import jdk.test.lib.*; import sun.hotspot.WhiteBox; public class ReadVMPageSize { diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java index c9d80302174..2a248313d7d 100644 --- a/hotspot/test/runtime/memory/ReserveMemory.java +++ b/hotspot/test/runtime/memory/ReserveMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -28,16 +28,17 @@ * @bug 8012015 * @requires !(os.family == "aix") * @summary Make sure reserved (but uncommitted) memory is not accessible - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build ReserveMemory + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main ReserveMemory */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; diff --git a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java index c03cf8afa9c..d3bb7bdaf54 100644 --- a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java +++ b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,16 +24,16 @@ /* * @test * @summary Test launches unit tests inside vm concurrently - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build RunUnitTestsConcurrently + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI RunUnitTestsConcurrently 30 15000 */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; public class RunUnitTestsConcurrently { diff --git a/hotspot/test/runtime/memory/StressVirtualSpaceResize.java b/hotspot/test/runtime/memory/StressVirtualSpaceResize.java index 4fd0534b873..9a1e7dae485 100644 --- a/hotspot/test/runtime/memory/StressVirtualSpaceResize.java +++ b/hotspot/test/runtime/memory/StressVirtualSpaceResize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -25,8 +25,8 @@ * @test * @summary Stress test that expands/shrinks VirtualSpace * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build StressVirtualSpaceResize + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI StressVirtualSpaceResize diff --git a/hotspot/test/runtime/modules/AccModuleTest.java b/hotspot/test/runtime/modules/AccModuleTest.java index 45d9bb394ad..8deac7f327e 100644 --- a/hotspot/test/runtime/modules/AccModuleTest.java +++ b/hotspot/test/runtime/modules/AccModuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,15 +23,12 @@ /* * @test - * @library /testlibrary * @modules java.base/jdk.internal.misc * @compile acc_module.jcod - * @build AccModuleTest * @run main AccModuleTest */ import java.io.File; -import jdk.test.lib.*; public class AccModuleTest { diff --git a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java index 71435b1718f..986fd092cc3 100644 --- a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can not read module m2, then class p1.c1 * in module m1 can not access p2.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build CheckRead * @run main/othervm -Xbootclasspath/a:. CheckRead */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java index 3342d8f9073..e084f73e8df 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can not read module m2, then class p1.c1 * in module m1 can not access p2.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build DiffCL_CheckRead * @run main/othervm -Xbootclasspath/a:. DiffCL_CheckRead */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java index 3d2bb9eda86..edbca757818 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java @@ -29,11 +29,10 @@ * is exported specifically to module m3, then class p1.c1 in m1 can not * access p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build DiffCL_ExpQualOther * @run main/othervm -Xbootclasspath/a:. DiffCL_ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java index 5854c4530ea..32098106e7f 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java @@ -28,11 +28,10 @@ * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in m2. * Access allowed since m1 can read m2 and package p2 is exported to m1. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build DiffCL_ExpQualToM1 * @run main/othervm -Xbootclasspath/a:. DiffCL_ExpQualToM1 */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java index 57490768b2f..c8d156e73e5 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can read module m2, and package p2 in m2 is * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build DiffCL_ExpUnqual * @run main/othervm -Xbootclasspath/a:. DiffCL_ExpUnqual */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java index 9b1bd9613cc..afc3ec811ce 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can read module m2, but package p2 in m2 is not * exported, then class p1.c1 in m1 can not read p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build DiffCL_PkgNotExp * @run main/othervm -Xbootclasspath/a:. DiffCL_PkgNotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java index 09488b60327..5f88ede128b 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java @@ -26,7 +26,7 @@ /* * @test * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module * @compile myloaders/MyDiffClassLoader.java @@ -34,7 +34,6 @@ * @compile p1/c1.java * @compile p1/c1ReadEdgeDiffLoader.java * @compile p1/c1Loose.java - * @build DiffCL_Umod * @run main/othervm -Xbootclasspath/a:. DiffCL_Umod */ diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java index 3ce98422ec6..b7bb37072e9 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java @@ -28,12 +28,11 @@ * @summary class p3.c3 defined in module m1 tries to access c4 defined in an unnamed package * and an unnamed module. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile c4.java * @compile p3/c3.jcod * @compile p3/c3ReadEdgeDiffLoader.jcod - * @build DiffCL_UmodUpkg * @run main/othervm -Xbootclasspath/a:. DiffCL_UmodUpkg */ diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java index 5cf5132ece9..d1c4b207af2 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java @@ -29,11 +29,10 @@ * is exported specifically to module m3, then class p1.c1 in m1 can not * access p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build ExpQualOther * @run main/othervm -Xbootclasspath/a:. ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java index 4a7822fb4d7..035008cb1b7 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can read module m2, AND package p2 in m2 is * exported qualifiedly to m1, then class p1.c1 in m1 can read p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build ExpQualToM1 * @run main/othervm -Xbootclasspath/a:. ExpQualToM1 */ diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java index 67e69ea42e0..2c321ceb9b2 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can read module m2, AND package p2 in module2 is * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build ExpUnqual * @run main/othervm -Xbootclasspath/a:. ExpUnqual */ diff --git a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java index 3762f13b696..7d5fb596aaf 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java @@ -27,13 +27,12 @@ * @test * @summary Test if package p2 in module m2 is exported to all unnamed, * then class p1.c1 in an unnamed module can read p2.c2 in module m2. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build ExportAllUnnamed * @run main/othervm -Xbootclasspath/a:. ExportAllUnnamed */ diff --git a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java index 0b044974fa8..86e26c5cc8e 100644 --- a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java @@ -28,11 +28,10 @@ * @summary Test that if module m1 can read module m2, but package p2 in m2 is not * exported, then class p1.c1 in m1 can not read p2.c2 in m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build PkgNotExp * @run main/othervm -Xbootclasspath/a:. PkgNotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod.java b/hotspot/test/runtime/modules/AccessCheck/Umod.java index c61bcf45896..e8d0a04d050 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java @@ -26,7 +26,7 @@ /* * @test * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module * @compile myloaders/MySameClassLoader.java @@ -34,7 +34,6 @@ * @compile p1/c1.java * @compile p1/c1ReadEdge.java * @compile p1/c1Loose.java - * @build Umod * @run main/othervm -Xbootclasspath/a:. Umod */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java index cde2644146d..2a9db0f2733 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java @@ -29,11 +29,10 @@ * Access is denied, since an unnamed module can read all modules but p2 in module * m2 is exported specifically to module m1, not to all modules. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build UmodDiffCL_ExpQualOther * @run main/othervm -Xbootclasspath/a:. UmodDiffCL_ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java index 93b2f14428a..c83998de6bc 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java @@ -29,11 +29,10 @@ * Access allowed, an unnamed module can read all modules and p2 in module m2 * which is exported unqualifiedly. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build UmodDiffCL_ExpUnqual * @run main/othervm -Xbootclasspath/a:. UmodDiffCL_ExpUnqual */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java index aca576bd721..b4d0461a1cd 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java @@ -29,10 +29,9 @@ * Access is denied since even though unnamed module can read all modules, p2 * in module m2 is not exported at all. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p1/c1.java - * @build UmodDiffCL_PkgNotExp * @run main/othervm -Xbootclasspath/a:. UmodDiffCL_PkgNotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_Umod.java index 6fd267961b1..f164908558e 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_Umod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -32,7 +32,6 @@ * @compile myloaders/MyDiffClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build UmodDiffCL_Umod * @run main/othervm -Xbootclasspath/a:. UmodDiffCL_Umod */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java index 909ab0ffb29..d9d0414ca26 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -31,7 +31,6 @@ * @compile myloaders/MyDiffClassLoader.java * @compile c4.java * @compile p3/c3.jcod - * @build UmodDiffCL_UmodUpkg * @run main/othervm -Xbootclasspath/a:. UmodDiffCL_UmodUpkg */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java index 36035e9c4d2..4ad9b24a0ea 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java @@ -27,12 +27,11 @@ * @test * @summary class p3.c3 defined in module m1 tries to access c4 defined in unnamed module. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile c4.java * @compile p3/c3.jcod * @compile p3/c3ReadEdge.jcod - * @build UmodUPkg * @run main/othervm -Xbootclasspath/a:. UmodUPkg */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java index ed81b24fc7f..3a64481c561 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java @@ -29,11 +29,10 @@ * Access is denied, since an unnamed module can read all modules but p6 in module * m2 is exported specifically to module m1, not to all modules. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkgDiffCL_ExpQualOther * @run main/othervm -Xbootclasspath/a:. UmodUpkgDiffCL_ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java index 11d42b74673..b06cf17e04d 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java @@ -28,11 +28,10 @@ * @summary class c5 in an unnamed module can read module m2, but package p6 in module m2 is not exported. * Access denied since even though unnamed module can read all modules, p6 in module m2 is not exported at all. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MyDiffClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkgDiffCL_NotExp * @run main/othervm -Xbootclasspath/a:. UmodUpkgDiffCL_NotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java index 597389546d8..5411255a643 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -30,7 +30,6 @@ * @compile myloaders/MyDiffClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkgDiffCL_Umod * @run main/othervm -Xbootclasspath/a:. UmodUpkgDiffCL_Umod */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java index 8ea1cdd1daa..33f7482dc33 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java @@ -28,11 +28,10 @@ * @summary Test that if class c5 in an unnamed module can read package p6 in module m2, but package p6 in module m2 is * exported qualifiedly to module m3, then class c5 in an unnamed module can not read p6.c6 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkg_ExpQualOther * @run main/othervm -Xbootclasspath/a:. UmodUpkg_ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java index ebf9b5e8a2a..f3cda29cea8 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java @@ -28,11 +28,10 @@ * @summary Test if package p6 in module m2 is not exported, then class c5 * in an unnamed module can not access p6.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkg_NotExp * @run main/othervm -Xbootclasspath/a:. UmodUpkg_NotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_Umod.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_Umod.java index 7a96e5c2afb..400c41d7b88 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_Umod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -30,7 +30,6 @@ * @compile myloaders/MySameClassLoader.java * @compile p6/c6.java * @compile c5.java - * @build UmodUpkg_Umod * @run main/othervm -Xbootclasspath/a:. UmodUpkg_Umod */ diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java index 3c58cdb1a34..74288ef865d 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java @@ -28,11 +28,10 @@ * @summary Test that if package p2 in module m2 is exported to module m3, * then class p1.c1 in an unnamed module can not read p2.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build Umod_ExpQualOther * @run main/othervm -Xbootclasspath/a:. Umod_ExpQualOther */ diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java index 6f8f83f0e59..dd69c1318b1 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java @@ -28,11 +28,10 @@ * @summary Test if package p2 in module m2 is exported unqualifiedly, * then class p1.c1 in an unnamed module can read p2.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build Umod_ExpUnqual * @run main/othervm -Xbootclasspath/a:. Umod_ExpUnqual */ diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java index 90c071cb345..e15687ebb8b 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java @@ -28,11 +28,10 @@ * @summary Test if package p2 in module m2 is not exported, then class p1.c1 * in an unnamed module can not access p2.c2 in module m2. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile myloaders/MySameClassLoader.java * @compile p2/c2.java * @compile p1/c1.java - * @build Umod_PkgNotExp * @run main/othervm -Xbootclasspath/a:. Umod_PkgNotExp */ diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/Umod_UmodUpkg.java index 23abc1e5a35..7adfe52b1be 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_UmodUpkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_UmodUpkg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -31,7 +31,6 @@ * @compile myloaders/MySameClassLoader.java * @compile c4.java * @compile p3/c3.jcod - * @build Umod_UmodUpkg * @run main/othervm -Xbootclasspath/a:. Umod_UmodUpkg */ diff --git a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java index 8846108567f..7872d0d3306 100644 --- a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java @@ -27,7 +27,7 @@ import static jdk.test.lib.Asserts.*; /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/AccessCheckExp.java b/hotspot/test/runtime/modules/AccessCheckExp.java index 0adbd72c553..fa624b0783a 100644 --- a/hotspot/test/runtime/modules/AccessCheckExp.java +++ b/hotspot/test/runtime/modules/AccessCheckExp.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/AccessCheckJavaBase.java b/hotspot/test/runtime/modules/AccessCheckJavaBase.java index dc1b691cf17..24f2f77e115 100644 --- a/hotspot/test/runtime/modules/AccessCheckJavaBase.java +++ b/hotspot/test/runtime/modules/AccessCheckJavaBase.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java diff --git a/hotspot/test/runtime/modules/AccessCheckRead.java b/hotspot/test/runtime/modules/AccessCheckRead.java index 320ba55ec7c..a36268ace02 100644 --- a/hotspot/test/runtime/modules/AccessCheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheckRead.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox @@ -34,7 +34,6 @@ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckRead */ -import jdk.test.lib.*; import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/runtime/modules/AccessCheckSuper.java b/hotspot/test/runtime/modules/AccessCheckSuper.java index 663679b48c9..594c1921e0f 100644 --- a/hotspot/test/runtime/modules/AccessCheckSuper.java +++ b/hotspot/test/runtime/modules/AccessCheckSuper.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p3/c3.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/AccessCheckUnnamed.java b/hotspot/test/runtime/modules/AccessCheckUnnamed.java index 319ee7402c2..4a2ab3e4951 100644 --- a/hotspot/test/runtime/modules/AccessCheckUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheckUnnamed.java @@ -27,7 +27,7 @@ import static jdk.test.lib.Asserts.*; /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/AccessCheckWorks.java b/hotspot/test/runtime/modules/AccessCheckWorks.java index 63de8ca8b2a..48d6660f195 100644 --- a/hotspot/test/runtime/modules/AccessCheckWorks.java +++ b/hotspot/test/runtime/modules/AccessCheckWorks.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/ExportTwice.java b/hotspot/test/runtime/modules/ExportTwice.java index 93f4e682ac4..538c65926c0 100644 --- a/hotspot/test/runtime/modules/ExportTwice.java +++ b/hotspot/test/runtime/modules/ExportTwice.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java index 833182b09b3..3714a9ee97a 100644 --- a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java +++ b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java @@ -26,10 +26,11 @@ * @bug 8136930 * @summary Test that the VM ignores explicitly specified module internal properties. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; // Test that the VM ignores module related properties such as "jdk.module.addmods" // and jdk.module.addreads.0" that can only be set using module options. diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java index 8ea4f6b1106..7a08787c696 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMAddModuleExports.java b/hotspot/test/runtime/modules/JVMAddModuleExports.java index 1f0dcae38c0..689523639f4 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExports.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExports.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java index 9f6e69fc6cf..80db658a99d 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java @@ -27,7 +27,7 @@ import static jdk.test.lib.Asserts.*; /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMAddModulePackage.java b/hotspot/test/runtime/modules/JVMAddModulePackage.java index 359e3f2b132..502b4497b51 100644 --- a/hotspot/test/runtime/modules/JVMAddModulePackage.java +++ b/hotspot/test/runtime/modules/JVMAddModulePackage.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMAddReadsModule.java b/hotspot/test/runtime/modules/JVMAddReadsModule.java index dda62822367..a25bcfc64f6 100644 --- a/hotspot/test/runtime/modules/JVMAddReadsModule.java +++ b/hotspot/test/runtime/modules/JVMAddReadsModule.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMCanReadModule.java b/hotspot/test/runtime/modules/JVMCanReadModule.java index daabd21d213..c6707d20cee 100644 --- a/hotspot/test/runtime/modules/JVMCanReadModule.java +++ b/hotspot/test/runtime/modules/JVMCanReadModule.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMDefineModule.java b/hotspot/test/runtime/modules/JVMDefineModule.java index 82f50650dfc..f4a838ac55a 100644 --- a/hotspot/test/runtime/modules/JVMDefineModule.java +++ b/hotspot/test/runtime/modules/JVMDefineModule.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java index 88ff93a5040..1f58193c676 100644 --- a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java +++ b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @compile p2/c2.java * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java diff --git a/hotspot/test/runtime/modules/JVMIsExportedToModule.java b/hotspot/test/runtime/modules/JVMIsExportedToModule.java index 2d465001ce2..3f58cb5d66a 100644 --- a/hotspot/test/runtime/modules/JVMIsExportedToModule.java +++ b/hotspot/test/runtime/modules/JVMIsExportedToModule.java @@ -24,7 +24,7 @@ /* * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java index ec30f58d2e3..1f27ba9b432 100644 --- a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java +++ b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java @@ -25,7 +25,7 @@ * @test * @summary Ensure module information is cleaned when owning class loader unloads * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib /compiler/whitebox .. + * @library /test/lib .. * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/reflect/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/runtime/modules/ModuleOptionsTest.java b/hotspot/test/runtime/modules/ModuleOptionsTest.java index 2efb8bc0ad5..a1dec0141d4 100644 --- a/hotspot/test/runtime/modules/ModuleOptionsTest.java +++ b/hotspot/test/runtime/modules/ModuleOptionsTest.java @@ -27,10 +27,11 @@ * @summary Test that the VM only recognizes the last specified --add-modules * and --list-modules options * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; // Test that the VM behaves correctly when processing module related options. public class ModuleOptionsTest { diff --git a/hotspot/test/runtime/modules/ModuleOptionsWarn.java b/hotspot/test/runtime/modules/ModuleOptionsWarn.java index e595c555e17..7ad1f9b2ca9 100644 --- a/hotspot/test/runtime/modules/ModuleOptionsWarn.java +++ b/hotspot/test/runtime/modules/ModuleOptionsWarn.java @@ -26,10 +26,11 @@ * @bug 8162415 * @summary Test warnings for ignored properties. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; // Test that the VM behaves correctly when processing command line module system properties. public class ModuleOptionsWarn { diff --git a/hotspot/test/runtime/modules/ModuleStress/ExportModuleStressTest.java b/hotspot/test/runtime/modules/ModuleStress/ExportModuleStressTest.java index e170d5eabb1..389e5144082 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ExportModuleStressTest.java +++ b/hotspot/test/runtime/modules/ModuleStress/ExportModuleStressTest.java @@ -26,15 +26,15 @@ * @bug 8156871 * @summary package in the boot layer is repeatedly exported to unique module created in layers on top of the boot layer * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile ../CompilerUtils.java - * @build ExportModuleStressTest * @run main/othervm ExportModuleStressTest */ import java.nio.file.Path; import java.nio.file.Paths; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ExportModuleStressTest { diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java index d7791e9b43a..2da921d4d8c 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java +++ b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java @@ -28,16 +28,17 @@ * @bug 8159262 * @summary Test differing scenarios where a module's readability list and a package's exportability list should be walked * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile ../AccessCheck/ModuleLibrary.java * @compile ModuleSameCLMain.java * @compile ModuleNonBuiltinCLMain.java * @compile CustomSystemClassLoader.java - * @build ModuleStress * @run main/othervm ModuleStress */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.InMemoryJavaCompiler; import java.io.File; public class ModuleStress { diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleStressGC.java b/hotspot/test/runtime/modules/ModuleStress/ModuleStressGC.java index 8ee2fb8a6f3..9db70d4b137 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ModuleStressGC.java +++ b/hotspot/test/runtime/modules/ModuleStress/ModuleStressGC.java @@ -26,15 +26,15 @@ * @bug 8159262 * @summary layers over the boot layer are repeatedly created, during this iteration, GCs are forced to verify correct walk of module and package lists. * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib + * @library /test/lib * @compile ../CompilerUtils.java - * @build ModuleStressGC * @run main/othervm ModuleStressGC */ import java.nio.file.Path; import java.nio.file.Paths; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class ModuleStressGC { diff --git a/hotspot/test/runtime/modules/PatchModule/BasicJarBuilder.java b/hotspot/test/runtime/modules/PatchModule/BasicJarBuilder.java index ab8955cb0f7..b3242ba2cb2 100644 --- a/hotspot/test/runtime/modules/PatchModule/BasicJarBuilder.java +++ b/hotspot/test/runtime/modules/PatchModule/BasicJarBuilder.java @@ -29,8 +29,6 @@ * Output: A jar containing compiled classes, placed in a test classes folder */ -import jdk.test.lib.*; - import java.io.File; import java.util.ArrayList; import sun.tools.jar.Main; diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java b/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java index 8b04db22632..5af477b5c30 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java @@ -25,12 +25,14 @@ * @test * @summary Make sure --patch-module works with multiple directories. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile PatchModule2DirsMain.java * @run main PatchModule2Dirs */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import java.io.File; public class PatchModule2Dirs { diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java index 3ad5dab8014..a7f4784223b 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java @@ -23,13 +23,14 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @run main PatchModuleCDS */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleCDS { diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupJavaBase.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupJavaBase.java index e1d29adfc8b..6b19f288d1a 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupJavaBase.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupJavaBase.java @@ -25,10 +25,11 @@ * @test * @summary VM exit initialization results if java.base is specificed more than once to --patch-module. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleDupJavaBase { // The VM should exit initialization if java.base is specified diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java index 2b56665de2b..f87a582d30a 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java @@ -25,10 +25,11 @@ * @test * @summary Module system initialization exception results if a module is specificed twice to --patch-module. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleDupModule { diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java index c9d957f96f3..e43325703e9 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java @@ -26,12 +26,14 @@ * @bug 8130399 * @summary Make sure --patch-module works for java.base. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile PatchModuleMain.java * @run main PatchModuleJavaBase */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleJavaBase { diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java index c85c88e99dd..a5eb563a230 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java @@ -26,12 +26,14 @@ * @bug 8130399 * @summary Make sure --patch-module works for modules besides java.base. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile PatchModuleMain.java * @run main PatchModuleTest */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleTest { diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java index c9ed80939a5..c7775c0c136 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java @@ -24,15 +24,16 @@ /* * @test * @summary Make sure --patch-module works when a jar file is specified for a module - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.jartool/sun.tools.jar - * @build BasicJarBuilder * @compile PatchModuleMain.java * @run main PatchModuleTestJar */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleTestJar { private static String moduleJar; diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java index 4220816b322..18cc2597c2b 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java @@ -24,17 +24,18 @@ /* * @test * @summary Make sure --patch-module works when a jar file and a directory is specified for a module - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.jartool/sun.tools.jar - * @build BasicJarBuilder * @compile PatchModule2DirsMain.java * @run main PatchModuleTestJarDir */ import java.io.File; import java.nio.file.Files; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleTestJarDir { private static String moduleJar; diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java index 0d3bdeac0d1..7dda4a51d55 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java @@ -27,13 +27,15 @@ * @summary Make sure -Xlog:classload=info works properly with "modules" jimage, --patch-module, and with -Xbootclasspath/a * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile PatchModuleMain.java * @run main PatchModuleTraceCL */ import java.io.File; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleTraceCL { diff --git a/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java b/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java index 89afde3376d..95fbce1b125 100644 --- a/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java +++ b/hotspot/test/runtime/modules/Visibility/PatchModuleVisibility.java @@ -26,7 +26,7 @@ * @summary Ensure that a newly introduced java.base package placed within the --patch-module * directory is considered part of the boot loader's visibility boundary * @requires !(os.family == "windows") - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm PatchModuleVisibility @@ -36,7 +36,9 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class PatchModuleVisibility { diff --git a/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java b/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java index 3f92fd3dfe1..5f56b2573eb 100644 --- a/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java +++ b/hotspot/test/runtime/modules/Visibility/XbootcpNoVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,13 +25,15 @@ * @test * @summary Ensure that a class defined within a java.base package can not * be located via -Xbootclasspath/a - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm XbootcpNoVisibility */ -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class XbootcpNoVisibility { public static void main(String args[]) throws Exception { diff --git a/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java b/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java index c58ff0b606d..1530d8bed13 100644 --- a/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java +++ b/hotspot/test/runtime/modules/Visibility/XbootcpVisibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @summary Ensure that a package whose module has not been defined to the boot loader * is correctly located with -Xbootclasspath/a * @requires !(os.family == "windows") - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm XbootcpVisibility @@ -36,7 +36,9 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; -import jdk.test.lib.*; +import jdk.test.lib.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class XbootcpVisibility { diff --git a/hotspot/test/runtime/os/AvailableProcessors.java b/hotspot/test/runtime/os/AvailableProcessors.java index a60757391ee..29a496ccabb 100644 --- a/hotspot/test/runtime/os/AvailableProcessors.java +++ b/hotspot/test/runtime/os/AvailableProcessors.java @@ -21,8 +21,8 @@ * questions. */ import java.io.File; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import java.util.ArrayList; /* @@ -31,8 +31,7 @@ import java.util.ArrayList; * @summary Check that availableProcessors reports the correct value when running in a cpuset on linux * @requires os.family == "linux" * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @run driver AvailableProcessors */ public class AvailableProcessors { diff --git a/hotspot/test/runtime/verifier/OverriderMsg.java b/hotspot/test/runtime/verifier/OverriderMsg.java index dffa43885e6..8e484da4b39 100644 --- a/hotspot/test/runtime/verifier/OverriderMsg.java +++ b/hotspot/test/runtime/verifier/OverriderMsg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,12 +26,13 @@ import java.io.FileOutputStream; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; import static jdk.internal.org.objectweb.asm.Opcodes.*; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test OverriderMsg * @bug 8026894 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/runtime/verifier/TestANewArray.java b/hotspot/test/runtime/verifier/TestANewArray.java index 4414e88f80a..a94ce25ef8c 100644 --- a/hotspot/test/runtime/verifier/TestANewArray.java +++ b/hotspot/test/runtime/verifier/TestANewArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,12 +28,13 @@ import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; import static jdk.internal.org.objectweb.asm.Opcodes.*; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/runtime/verifier/TestMultiANewArray.java b/hotspot/test/runtime/verifier/TestMultiANewArray.java index 96e22064cde..7e53ce27734 100644 --- a/hotspot/test/runtime/verifier/TestMultiANewArray.java +++ b/hotspot/test/runtime/verifier/TestMultiANewArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,12 +26,13 @@ import java.io.FileOutputStream; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; import static jdk.internal.org.objectweb.asm.Opcodes.*; -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /* * @test TestMultiANewArray * @bug 8038076 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/runtime/verifier/TraceClassRes.java b/hotspot/test/runtime/verifier/TraceClassRes.java index c8b5d5e95db..8e6ef28f7d8 100644 --- a/hotspot/test/runtime/verifier/TraceClassRes.java +++ b/hotspot/test/runtime/verifier/TraceClassRes.java @@ -26,10 +26,11 @@ * @bug 8076318 * @summary split verifier needs to add TraceClassResolution * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; // Test that the verifier outputs the classes it loads if -XX:+TraceClassResolution is specified" public class TraceClassRes { diff --git a/hotspot/test/runtime/whitebox/WBStackSize.java b/hotspot/test/runtime/whitebox/WBStackSize.java index 9bc117b3927..c1429bbc694 100644 --- a/hotspot/test/runtime/whitebox/WBStackSize.java +++ b/hotspot/test/runtime/whitebox/WBStackSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,8 +25,8 @@ * @test WBStackSize * @summary verify that whitebox functions getThreadFullStackSize() and getThreadRemainingStackSize are working * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build WBStackSize + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xss512k WBStackSize diff --git a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java index a6f442476d2..fb992393c0e 100644 --- a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java +++ b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,7 +27,7 @@ * @summary verify that whitebox can be used even if not all functions are declared in java-part * @author igor.ignatyev@oracle.com * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @compile WhiteBox.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-CheckIntrinsics sun.hotspot.WhiteBox diff --git a/hotspot/test/sanity/WBApi.java b/hotspot/test/sanity/WBApi.java index e24e672bc82..bc5aa61f22b 100644 --- a/hotspot/test/sanity/WBApi.java +++ b/hotspot/test/sanity/WBApi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -25,8 +25,8 @@ * @test WBApi * @summary verify that whitebox functions can be linked and executed * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build WBApi + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI WBApi diff --git a/hotspot/test/serviceability/ParserTest.java b/hotspot/test/serviceability/ParserTest.java index 58ef23bdf86..2fca0ec4c81 100644 --- a/hotspot/test/serviceability/ParserTest.java +++ b/hotspot/test/serviceability/ParserTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -25,8 +25,8 @@ * @test * @summary Test that the diagnostic command arguemnt parser works * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.parser.* + * @library /test/lib + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ParserTest diff --git a/hotspot/test/serviceability/attach/AttachSetGetFlag.java b/hotspot/test/serviceability/attach/AttachSetGetFlag.java index 81e3a01fccb..3b48759cc23 100644 --- a/hotspot/test/serviceability/attach/AttachSetGetFlag.java +++ b/hotspot/test/serviceability/attach/AttachSetGetFlag.java @@ -25,13 +25,12 @@ * @test * @bug 8054823 * @summary Tests the setFlag and printFlag attach command - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.attach/sun.tools.attach * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* AttachSetGetFlag * @run main AttachSetGetFlag */ @@ -47,7 +46,7 @@ import sun.tools.attach.HotSpotVirtualMachine; import jdk.test.lib.Asserts; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; import com.sun.tools.attach.VirtualMachine; public class AttachSetGetFlag { diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java index 5cc42cab22f..8be22f0988a 100644 --- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java +++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java @@ -28,12 +28,12 @@ * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues * @modules java.base/jdk.internal.misc * @modules jdk.attach/sun.tools.attach - * @library /testlibrary - * @build jdk.test.lib.* AttachWithStalePidFileTarget + * @library /test/lib * @run main AttachWithStalePidFile */ -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; import com.sun.tools.attach.VirtualMachine; import sun.tools.attach.HotSpotVirtualMachine; import java.lang.reflect.Field; diff --git a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java index 4bbf6b1d0b8..07251f32597 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,13 +24,11 @@ /* * @test CodeCacheTest * @bug 8054889 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest * @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest * @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest @@ -40,7 +38,7 @@ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java index 7125a57f9bb..e0bdd408012 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java @@ -24,15 +24,12 @@ /* * @test CodelistTest * @bug 8054889 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -Xmixed CodelistTest @@ -48,7 +45,7 @@ import compiler.testlibrary.CompilerUtils; import compiler.whitebox.CompilerWhiteBoxTest; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import org.testng.annotations.Test; diff --git a/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java b/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java index 7851431ba7e..c43dfafa56f 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,18 +24,15 @@ /* * @test CompilerDirectivesDCMDTest * @bug 8137167 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @run main ClassFileInstaller jdk.test.lib.Platform * @run testng/othervm CompilerDirectivesDCMDTest * @summary Test of diagnostic command */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import jdk.test.lib.Platform; diff --git a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java index 217e9c29fa8..3640bbcebbb 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,16 +24,13 @@ /* * @test CompilerQueueTest * @bug 8054889 - * @library /testlibrary /test/lib / + * @library /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * @summary Test of diagnostic command Compiler.queue - * @build jdk.test.lib.* - * jdk.test.lib.dcmd.* - * sun.hotspot.WhiteBox - * compiler.testlibrary.CompilerUtils + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmixed -XX:+WhiteBoxAPI CompilerQueueTest @@ -42,7 +39,7 @@ */ import compiler.testlibrary.CompilerUtils; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import org.testng.annotations.Test; diff --git a/hotspot/test/serviceability/dcmd/framework/HelpTest.java b/hotspot/test/serviceability/dcmd/framework/HelpTest.java index 012bcf878ca..b172db8e7ca 100644 --- a/hotspot/test/serviceability/dcmd/framework/HelpTest.java +++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; import jdk.test.lib.dcmd.MainClassJcmdExecutor; @@ -32,13 +32,11 @@ import org.testng.annotations.Test; /* * @test * @summary Test of diagnostic command help (tests all DCMD executors) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -XX:+UsePerfData HelpTest */ public class HelpTest { diff --git a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java index afd3755714b..be8a4d8560d 100644 --- a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java +++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; import jdk.test.lib.dcmd.MainClassJcmdExecutor; @@ -32,13 +32,11 @@ import org.testng.annotations.Test; /* * @test * @summary Test of invalid diagnostic command (tests all DCMD executors) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -XX:+UsePerfData InvalidCommandTest */ public class InvalidCommandTest { diff --git a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java index 7daa95fcaf5..dadaf3113b2 100644 --- a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java +++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; import jdk.test.lib.dcmd.MainClassJcmdExecutor; @@ -33,13 +33,11 @@ import org.testng.annotations.Test; /* * @test * @summary Test of diagnostic command VM.version (tests all DCMD executors) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -XX:+UsePerfData VMVersionTest */ public class VMVersionTest { diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java index 331421af297..bc2f3e2eb15 100644 --- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java +++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,11 @@ /* * @test * @summary Test of diagnostic command GC.class_histogram -all=true - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @build ClassHistogramTest * @run testng ClassHistogramAllTest */ public class ClassHistogramAllTest extends ClassHistogramTest { diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java index 996074a5a67..5b4f017ec40 100644 --- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java +++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java @@ -25,20 +25,18 @@ import org.testng.annotations.Test; import java.util.regex.Pattern; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; /* * @test * @summary Test of diagnostic command GC.class_histogram - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng ClassHistogramTest */ public class ClassHistogramTest { diff --git a/hotspot/test/serviceability/dcmd/gc/FinalizerInfoTest.java b/hotspot/test/serviceability/dcmd/gc/FinalizerInfoTest.java index 05b06270bcf..c5d27b9a1b5 100644 --- a/hotspot/test/serviceability/dcmd/gc/FinalizerInfoTest.java +++ b/hotspot/test/serviceability/dcmd/gc/FinalizerInfoTest.java @@ -28,19 +28,17 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; /* * @test * @summary - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.xml * java.management - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng FinalizerInfoTest */ public class FinalizerInfoTest { diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java index ca38cbb5332..257acea6b10 100644 --- a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java +++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java @@ -24,19 +24,11 @@ /* * @test * @summary Test of diagnostic command GC.heap_dump -all=true - * @library /testlibrary - * @library /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @build jdk.test.lib.hprof.* - * @build jdk.test.lib.hprof.model.* - * @build jdk.test.lib.hprof.parser.* - * @build jdk.test.lib.hprof.util.* - * @build HeapDumpTest * @run testng HeapDumpAllTest */ public class HeapDumpAllTest extends HeapDumpTest { diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java index 0329cb625aa..257a30f899c 100644 --- a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java +++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java @@ -33,25 +33,18 @@ import jdk.test.lib.hprof.HprofParser; import jdk.test.lib.hprof.model.Snapshot; import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; /* * @test * @summary Test of diagnostic command GC.heap_dump - * @library /testlibrary - * @library /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @build jdk.test.lib.hprof.* - * @build jdk.test.lib.hprof.model.* - * @build jdk.test.lib.hprof.parser.* - * @build jdk.test.lib.hprof.util.* * @run testng HeapDumpTest */ public class HeapDumpTest { diff --git a/hotspot/test/serviceability/dcmd/gc/HeapInfoTest.java b/hotspot/test/serviceability/dcmd/gc/HeapInfoTest.java index 5193e6c6821..b2297552b35 100644 --- a/hotspot/test/serviceability/dcmd/gc/HeapInfoTest.java +++ b/hotspot/test/serviceability/dcmd/gc/HeapInfoTest.java @@ -28,18 +28,16 @@ import java.io.IOException; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; /* * @test * @summary Test of diagnostic command GC.heap_info - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.xml * java.management - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng HeapInfoTest */ public class HeapInfoTest { diff --git a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java index 9e22ada4602..22af05f0523 100644 --- a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java +++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -30,16 +30,12 @@ import jdk.test.lib.process.ProcessTools; /* * @test * @summary Test of diagnostic command GC.run_finalization - * @library /testlibrary - * @library /test/lib/share/classes + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @build jdk.test.lib.process.* - * @build RunFinalizationTest FinalizationRunner + * @build FinalizationRunner * @run main RunFinalizationTest */ public class RunFinalizationTest { diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java index 7813605933c..44bd09a6268 100644 --- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java +++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -29,20 +29,18 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; /* * @test * @summary Test of diagnostic command GC.run - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -Xlog:gc=debug:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest */ public class RunGCTest { diff --git a/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java b/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java index b25999a77bd..189f9a7e392 100644 --- a/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java +++ b/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; @@ -32,8 +32,7 @@ import org.testng.annotations.Test; * @bug 8054890 * @summary Test of JVMTI.data_dump diagnostic command * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @run testng DataDumpDcmdTest */ diff --git a/hotspot/test/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java b/hotspot/test/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java index f27bd3aaca6..82b563bafdd 100644 --- a/hotspot/test/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java +++ b/hotspot/test/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java @@ -26,7 +26,8 @@ import java.util.jar.Attributes; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; -import jdk.test.lib.*; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.*; import org.testng.annotations.Test; @@ -35,13 +36,13 @@ import org.testng.annotations.Test; * * @test * @bug 8147388 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.instrument * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* SimpleJvmtiAgent + * @build SimpleJvmtiAgent * @ignore 8150318 * @run main ClassFileInstaller SimpleJvmtiAgent * @run testng LoadAgentDcmdTest @@ -59,7 +60,7 @@ public class LoadAgentDcmdTest { "'-Dtest.jdk=/path/to/jdk'."); } - Path libpath = Paths.get(jdkPath, Platform.jdkLibPath(), Platform.sharedObjectName("instrument")); + Path libpath = Paths.get(jdkPath, jdkLibPath(), sharedObjectName("instrument")); if (!libpath.toFile().exists()) { throw new FileNotFoundException( @@ -129,6 +130,32 @@ public class LoadAgentDcmdTest { throw new RuntimeException(e); } } + /** + * return path to library inside jdk tree + */ + public static String jdkLibPath() { + if (Platform.isWindows()) { + return "bin"; + } + if (Platform.isOSX()) { + return "lib"; + } + + return "lib/" + Platform.getOsArch(); + } + + /** + * Build name of shared object according to platform rules + */ + public static String sharedObjectName(String name) { + if (Platform.isWindows()) { + return name + ".dll"; + } + if (Platform.isOSX()) { + return "lib" + name + ".dylib"; + } + return "lib" + name + ".so"; + } @Test public void jmx() throws Throwable { diff --git a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java index 55e0728e030..b931c42019e 100644 --- a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java +++ b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,14 +24,11 @@ /* * @test * @summary Test of diagnostic command Thread.print -l=true - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* - * @build PrintTest * @run testng PrintConcurrentLocksTest */ public class PrintConcurrentLocksTest extends PrintTest { diff --git a/hotspot/test/serviceability/dcmd/thread/PrintTest.java b/hotspot/test/serviceability/dcmd/thread/PrintTest.java index 79f9b04fa77..77e22e1d8c5 100644 --- a/hotspot/test/serviceability/dcmd/thread/PrintTest.java +++ b/hotspot/test/serviceability/dcmd/thread/PrintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; @@ -37,13 +37,11 @@ import java.util.regex.Pattern; /* * @test * @summary Test of diagnostic command Thread.print - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng PrintTest */ public class PrintTest { diff --git a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java index 63c509d935c..aee55b5cc31 100644 --- a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java +++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,20 +24,18 @@ /* * @test * @summary Test of diagnostic command VM.class_hierarchy - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng ClassHierarchyTest */ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; diff --git a/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java index fcabb137ed0..d2230e33d8b 100644 --- a/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java +++ b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,20 +24,18 @@ /* * @test * @summary Test of diagnostic command VM.classloader_stats - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng ClassLoaderStatsTest */ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; diff --git a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java index 6d8c174544a..ac04d02b382 100644 --- a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java +++ b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import org.testng.annotations.Test; import jdk.test.lib.dcmd.CommandExecutor; @@ -30,13 +30,11 @@ import jdk.test.lib.dcmd.JMXExecutor; /* * @test * @summary Test of diagnostic command VM.command_line - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis CommandLineTest */ public class CommandLineTest { diff --git a/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java index b8c2fbe8cd0..5bd7a087a06 100644 --- a/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java +++ b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java @@ -1,13 +1,13 @@ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -32,13 +32,11 @@ import jdk.test.lib.dcmd.JMXExecutor; /* * @test * @summary Test of VM.dynlib diagnostic command via MBean - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng DynLibsTest */ diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java index 1ed2da18436..f83ab760a49 100644 --- a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java +++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import org.testng.annotations.Test; @@ -29,13 +29,11 @@ import org.testng.annotations.Test; /* * @test * @summary Test of diagnostic command VM.flags - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng/othervm -Xmx129m -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest */ public class FlagsTest { diff --git a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java index 663a7bc6a2f..3d8b02958a1 100644 --- a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java +++ b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -21,7 +21,7 @@ * questions. */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; import org.testng.annotations.Test; @@ -32,9 +32,7 @@ import static org.testng.Assert.*; * @bug 8054890 * @summary Test of VM.set_flag diagnostic command * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* + * @library /test/lib * @run testng SetVMFlagTest */ diff --git a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java index ae3d6ae6370..71ec4e17139 100644 --- a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java +++ b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,20 +23,18 @@ import org.testng.annotations.Test; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; /* * @test * @summary Test of diagnostic command VM.system_properties - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng SystemPropertiesTest */ public class SystemPropertiesTest { diff --git a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java index 02783bfdb73..a907421d5da 100644 --- a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java +++ b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,7 +24,7 @@ import org.testng.annotations.Test; import org.testng.Assert; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; @@ -34,13 +34,11 @@ import java.text.ParseException; /* * @test * @summary Test of diagnostic command VM.uptime - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* - * @build jdk.test.lib.dcmd.* * @run testng UptimeTest */ public class UptimeTest { diff --git a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java index 90855ba9f01..5fa6c9e4402 100644 --- a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java +++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java @@ -24,7 +24,7 @@ /** * @test * @summary Verifies the JVMTI GetAllModules API - * @library /testlibrary + * @library /test/lib * @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest * */ diff --git a/hotspot/test/serviceability/jvmti/GetObjectSizeClass.java b/hotspot/test/serviceability/jvmti/GetObjectSizeClass.java index cec03f32947..1030675d8f3 100644 --- a/hotspot/test/serviceability/jvmti/GetObjectSizeClass.java +++ b/hotspot/test/serviceability/jvmti/GetObjectSizeClass.java @@ -21,19 +21,22 @@ * questions. */ import java.io.PrintWriter; -import jdk.test.lib.*; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + /* * @test * @bug 8075030 * @summary JvmtiEnv::GetObjectSize reports incorrect java.lang.Class instance size - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.instrument * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* GetObjectSizeClassAgent + * @build GetObjectSizeClassAgent * @run main ClassFileInstaller GetObjectSizeClassAgent * @run main GetObjectSizeClass */ diff --git a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java index 562dda8d4f5..e2a801aaef8 100644 --- a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java +++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -21,20 +21,23 @@ * questions. */ import java.io.PrintWriter; -import jdk.test.lib.*; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /* * Test to verify GetObjectSize does not overflow on a 600M element int[] * * @test * @bug 8027230 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.instrument * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* GetObjectSizeOverflowAgent + * @build GetObjectSizeOverflowAgent * @run main ClassFileInstaller GetObjectSizeOverflowAgent * @run main GetObjectSizeOverflow */ diff --git a/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java b/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java index aeda7a1db69..9d59fc65835 100644 --- a/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java +++ b/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ * @test * @bug 8008678 * @summary JSR 292: constant pool reconstitution must support pseudo strings - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.instrument * java.management @@ -46,9 +46,9 @@ import java.nio.file.Paths; import java.security.ProtectionDomain; import java.util.Arrays; -import jdk.test.lib.ExitCode; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ExitCode; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestLambdaFormRetransformation { private static String MANIFEST = String.format("Manifest-Version: 1.0\n" + diff --git a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java index 85840996a29..4a9bb2606fe 100644 --- a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java +++ b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,22 +25,22 @@ * @test * @summary Redefine a class with an UnresolvedClass reference in the constant pool. * @bug 8035150 - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.instrument * java.management * jdk.jartool/sun.tools.jar * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* UnresolvedClassAgent + * @build UnresolvedClassAgent * @run main TestRedefineWithUnresolvedClass */ import java.io.File; import java.util.Arrays; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class TestRedefineWithUnresolvedClass { diff --git a/hotspot/test/serviceability/logging/TestBasicLogOutput.java b/hotspot/test/serviceability/logging/TestBasicLogOutput.java index 345e3737932..6c7b260ab4a 100644 --- a/hotspot/test/serviceability/logging/TestBasicLogOutput.java +++ b/hotspot/test/serviceability/logging/TestBasicLogOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,11 +25,11 @@ * @test TestBasicLogOutput * @summary Ensure logging can be enabled and successfully prints to stdout. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestBasicLogOutput { diff --git a/hotspot/test/serviceability/logging/TestDefaultLogOutput.java b/hotspot/test/serviceability/logging/TestDefaultLogOutput.java index cd55cc608d7..575832b8d7e 100644 --- a/hotspot/test/serviceability/logging/TestDefaultLogOutput.java +++ b/hotspot/test/serviceability/logging/TestDefaultLogOutput.java @@ -25,11 +25,11 @@ * @test TestDefaultLogOutput * @summary Ensure logging is default on stdout. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestDefaultLogOutput { diff --git a/hotspot/test/serviceability/logging/TestLogRotation.java b/hotspot/test/serviceability/logging/TestLogRotation.java index 3e3696b3fb0..f1eaf41acc2 100644 --- a/hotspot/test/serviceability/logging/TestLogRotation.java +++ b/hotspot/test/serviceability/logging/TestLogRotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -24,13 +24,13 @@ /* * @test TestLogRotation.java * @summary test flags for log rotation - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main/othervm/timeout=600 TestLogRotation * */ -import jdk.test.lib.*; +import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; diff --git a/hotspot/test/serviceability/logging/TestMultipleXlogArgs.java b/hotspot/test/serviceability/logging/TestMultipleXlogArgs.java index dfc62f7ca10..6d3af8f4148 100644 --- a/hotspot/test/serviceability/logging/TestMultipleXlogArgs.java +++ b/hotspot/test/serviceability/logging/TestMultipleXlogArgs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,11 +25,11 @@ * @test TestMultipleXlogArgs * @summary Ensure multiple -Xlog arguments aggregate the logging options. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestMultipleXlogArgs { diff --git a/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java index 77b4e007412..6d9d8987bfd 100644 --- a/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java +++ b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ * @test TestQuotedLogOutputs * @summary Ensure proper parsing of quoted output names for -Xlog arguments. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ import java.io.File; @@ -33,8 +33,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import jdk.test.lib.Asserts; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; public class TestQuotedLogOutputs { diff --git a/hotspot/test/serviceability/sa/DeadlockDetectionTest.java b/hotspot/test/serviceability/sa/DeadlockDetectionTest.java index 85e5529509d..415a849c886 100644 --- a/hotspot/test/serviceability/sa/DeadlockDetectionTest.java +++ b/hotspot/test/serviceability/sa/DeadlockDetectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -32,19 +32,15 @@ import jdk.test.lib.apps.LingeredAppWithDeadlock; import jdk.test.lib.Utils; import jdk.test.lib.Platform; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /* * @test * @summary Test deadlock detection - * @library /test/lib/share/classes - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management - * @build jdk.test.lib.* - * @build jdk.test.lib.apps.* - * @build DeadlockDetectionTest * @run main DeadlockDetectionTest */ diff --git a/hotspot/test/serviceability/sa/TestInstanceKlassSize.java b/hotspot/test/serviceability/sa/TestInstanceKlassSize.java index 6ab0a921609..db1ed0f180f 100644 --- a/hotspot/test/serviceability/sa/TestInstanceKlassSize.java +++ b/hotspot/test/serviceability/sa/TestInstanceKlassSize.java @@ -31,8 +31,8 @@ import java.util.stream.Collectors; import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Asserts; @@ -42,16 +42,16 @@ import java.util.*; /* * @test - * @library /test/lib/share/classes - * @library /testlibrary - * @build jdk.test.lib.* - * @build jdk.test.lib.apps.* + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules jdk.hotspot.agent * @modules jdk.hotspot.agent/sun.jvm.hotspot * @modules jdk.hotspot.agent/sun.jvm.hotspot.utilities * @modules jdk.hotspot.agent/sun.jvm.hotspot.oops - * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent TestInstanceKlassSize.java + * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent + * -XaddExports:java.base/jdk.internal.misc=jdk.hotspot.agent + * -XaddExports:java.management/java.lang.management=jdk.hotspot.agent + * TestInstanceKlassSize.java * @run main/othervm TestInstanceKlassSize */ diff --git a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java index c2c0c61b9a9..0c23373e6e3 100644 --- a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java +++ b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java @@ -29,23 +29,23 @@ import sun.jvm.hotspot.debugger.*; import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.JDKToolFinder; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; import jdk.test.lib.Asserts; /* * @test - * @library /test/lib/share/classes - * @library /testlibrary - * @build jdk.test.lib.* - * @build jdk.test.lib.apps.* + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules jdk.hotspot.agent * @modules jdk.hotspot.agent/sun.jvm.hotspot * @modules jdk.hotspot.agent/sun.jvm.hotspot.utilities * @modules jdk.hotspot.agent/sun.jvm.hotspot.oops - * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent TestInstanceKlassSizeForInterface.java + * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent + * -XaddExports:java.base/jdk.internal.misc=jdk.hotspot.agent + * -XaddExports:java.management/java.lang.management=jdk.hotspot.agent + * TestInstanceKlassSizeForInterface.java * @run main/othervm TestInstanceKlassSizeForInterface */ diff --git a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java index 0328e393339..6af55b5fdf9 100644 --- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java +++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -22,9 +22,9 @@ */ import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputBuffer; +import jdk.test.lib.process.OutputBuffer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; import java.io.File; @@ -32,12 +32,11 @@ import java.io.File; * @test * @bug 8028623 * @summary Test hashing of extended characters in Serviceability Agent. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* * @compile -encoding utf8 Test8028623.java * @run main/othervm -XX:+UsePerfData Test8028623 */ diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java index a1b297adc06..3469bdf6315 100644 --- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java +++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -32,11 +32,10 @@ import java.util.Arrays; import java.util.Scanner; import jdk.test.lib.Asserts; -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; /* * @test @@ -46,12 +45,12 @@ import jdk.test.lib.ProcessTools; * Started failing on 2016.06.24 due to 8160376 on MacOS X so quarantine * it on that platform: * @requires os.family != "mac" - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management/sun.management * jdk.jvmstat/sun.jvmstat.monitor - * @build jdk.test.lib.* JMapHProfLargeHeapProc + * @build JMapHProfLargeHeapProc * @run main JMapHProfLargeHeapTest */ diff --git a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java index a9cf6e53119..51b18469f7f 100644 --- a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java +++ b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java @@ -26,7 +26,7 @@ * @summary Checks that the jshdb debugd utility sucessfully starts * and tries to attach to a running process * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * * @ignore 8163805 * @run main/othervm SADebugDTest diff --git a/hotspot/test/serviceability/threads/TestFalseDeadLock.java b/hotspot/test/serviceability/threads/TestFalseDeadLock.java index e4654f4a266..d32760bf4d2 100644 --- a/hotspot/test/serviceability/threads/TestFalseDeadLock.java +++ b/hotspot/test/serviceability/threads/TestFalseDeadLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -31,7 +31,7 @@ import java.util.Random; * @bug 8016304 * @summary Make sure no deadlock is reported for this program which has no deadlocks. * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib * @run main/othervm TestFalseDeadLock */ diff --git a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java index cebd2c7d65f..23bba681fc1 100644 --- a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,10 +26,8 @@ * @summary Create daemon and non-deamon threads. * Check the correctness of thread's status from jstack. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * * @run main/othervm -XX:+UsePerfData DaemonThreadTest */ import common.ToolResults; diff --git a/hotspot/test/serviceability/tmtools/jstack/JstackThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/JstackThreadTest.java index 2d0eb05686c..2de069b1b21 100644 --- a/hotspot/test/serviceability/tmtools/jstack/JstackThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/JstackThreadTest.java @@ -23,8 +23,8 @@ import java.util.Arrays; import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import utils.Utils; import java.util.concurrent.CountDownLatch; @@ -33,8 +33,7 @@ import java.util.concurrent.CountDownLatch; * @bug 8151442 * @summary jstack doesn't close quotation marks properly with threads' name greater than 1996 characters * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @build jdk.test.lib.* + * @library /test/lib * @run main JstackThreadTest */ public class JstackThreadTest { diff --git a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java index 884c8d2bfa3..8f3be8153c6 100644 --- a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,10 +28,8 @@ * After checking that lock info is correct invoke another method * and get the lock again. Repeat this action. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * * @run main/othervm -XX:+UsePerfData SpreadLockTest */ import common.ToolResults; diff --git a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java index 282bfda2186..6402c2265c4 100644 --- a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,10 +25,8 @@ * @test * @summary Checks that jstack correctly prints the thread names * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * * @run main/othervm -XX:+UsePerfData ThreadNamesTest */ import common.ToolResults; diff --git a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java index 174bcdb7257..9a87d6bdc13 100644 --- a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,10 +28,8 @@ * After checking that lock info is correct free the lock and * invoke another method. Repeat this action. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * * @run main/othervm -XX:+UsePerfData TraveledLockTest */ import common.ToolResults; diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java index 6f87c0a04b3..9b5a5449326 100644 --- a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,10 +28,8 @@ * monitor info have to disappear from the stack. * Repeats the same scenario calling interrupt() method * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * * @run main/othervm -XX:+UsePerfData WaitNotifyThreadTest */ import common.ToolResults; diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java index 8e2f56e8b37..08b72d1f2aa 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -28,11 +28,9 @@ import utils.*; * @summary Test checks the consistency of the output * displayed with jstat -gccapacity. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @build common.* - * @build utils.* * @run main/othervm -XX:+UsePerfData -Xmx128M GcCapacityTest */ public class GcCapacityTest { diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java index 688670f3d9d..60c0a60c092 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -29,12 +29,9 @@ * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage * collection time increase. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @build common.* - * @build utils.* - * * @run main/othervm -XX:+UsePerfData -Xmx128M GcCauseTest01 */ import utils.*; diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java index 0efd59fe764..0e886ffe1b1 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java @@ -28,11 +28,8 @@ * tests forces debuggee application eat ~70% of heap and runs jstat. * jstat should show that ~70% of heap (OC/OU ~= 70%). * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * @build utils.* - * * @run main/othervm -XX:+UsePerfData -Xmx128M -XX:MaxMetaspaceSize=128M GcCauseTest02 */ import utils.*; diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java index a014c373fac..91ebd0ffcee 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java @@ -28,11 +28,8 @@ * test forces debuggee application call System.gc(), runs jstat and checks that * cause of last garbage collection displayed by jstat (LGCC) is 'System.gc()'. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * @build utils.* - * * @run main/othervm -XX:+UsePerfData -Xmx128M -XX:MaxMetaspaceSize=128M GcCauseTest03 */ import utils.*; diff --git a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java index 4e2fbdc801b..10a8e60cd2a 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java @@ -30,10 +30,8 @@ import utils.*; * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage * collection time increase. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * @build utils.* * @run main/othervm -XX:+UsePerfData -Xmx128M GcNewTest */ diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java index 5738da18fc3..cabfc9ec80a 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -32,12 +32,9 @@ * number of GC events and garbage * collection time increase. * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @build common.* - * @build utils.* - * * @run main/othervm -XX:+UsePerfData -Xmx128M GcTest01 */ import utils.*; diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java index 171b87b78e5..0c022358edc 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java @@ -29,10 +29,8 @@ import utils.*; * tests forces debuggee application eat ~70% of heap and runs jstat. * jstat should show that ~70% of heap is utilized (OC/OU ~= 70%). * @modules java.base/jdk.internal.misc - * @library /test/lib/share/classes + * @library /test/lib * @library ../share - * @build common.* - * @build utils.* * @ignore 8155570 * @run main/othervm -XX:+UsePerfData -Xmx128M -XX:MaxMetaspaceSize=128M GcTest02 */ diff --git a/hotspot/test/testlibrary/ClassFileInstaller.java b/hotspot/test/testlibrary/ClassFileInstaller.java deleted file mode 100644 index 2486bd2ef81..00000000000 --- a/hotspot/test/testlibrary/ClassFileInstaller.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -/** - * Dump a class file for a class on the class path in the current directory, or - * in the specified JAR file. This class is usually used when you build a class - * from a test library, but want to use this class in a sub-process. - * - * For example, to build the following library class: - * test/lib/sun/hotspot/WhiteBox.java - * - * You would use the following tags: - * - * @library /test/lib - * @build sun.hotspot.WhiteBox - * - * JTREG would build the class file under - * ${JTWork}/classes/test/lib/sun/hotspot/WhiteBox.class - * - * With you run your main test class using "@run main MyMainClass", JTREG would setup the - * -classpath to include "${JTWork}/classes/test/lib/", so MyMainClass would be able to - * load the WhiteBox class. - * - * However, if you run a sub process, and do not wish to use the exact same -classpath, - * You can use ClassFileInstaller to ensure that WhiteBox is available in the current - * directory of your test: - * - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * - * Or, you can use the -jar option to store the class in the specified JAR file. If a relative - * path name is given, the JAR file would be relative to the current directory of - * - * @run main ClassFileInstaller -jar myjar.jar sun.hotspot.WhiteBox - */ -public class ClassFileInstaller { - /** - * You can enable debug tracing of ClassFileInstaller by running JTREG with - * jtreg -DClassFileInstaller.debug=true ... - */ - public static boolean DEBUG = Boolean.getBoolean("ClassFileInstaller.debug"); - - /** - * @param args The names of the classes to dump - * @throws Exception - */ - public static void main(String... args) throws Exception { - if (args.length > 1 && args[0].equals("-jar")) { - if (args.length < 2) { - throw new RuntimeException("Usage: ClassFileInstaller \n" + - "where possible options include:\n" + - " -jar Write to the JAR file "); - } - writeJar(args[1], null, args, 2, args.length); - } else { - if (DEBUG) { - System.out.println("ClassFileInstaller: Writing to " + System.getProperty("user.dir")); - } - for (String arg : args) { - writeClassToDisk(arg); - } - } - } - - public static class Manifest { - private InputStream in; - - private Manifest(InputStream in) { - this.in = in; - } - - static Manifest fromSourceFile(String fileName) throws Exception { - String pathName = System.getProperty("test.src") + File.separator + fileName; - return new Manifest(new FileInputStream(pathName)); - } - - // Example: - // String manifest = "Premain-Class: RedefineClassHelper\n" + - // "Can-Redefine-Classes: true\n"; - // ClassFileInstaller.writeJar("redefineagent.jar", - // ClassFileInstaller.Manifest.fromString(manifest), - // "RedefineClassHelper"); - static Manifest fromString(String manifest) throws Exception { - return new Manifest(new ByteArrayInputStream(manifest.getBytes())); - } - - public InputStream getInputStream() { - return in; - } - } - - private static void writeJar(String jarFile, Manifest manifest, String classes[], int from, int to) throws Exception { - if (DEBUG) { - System.out.println("ClassFileInstaller: Writing to " + getJarPath(jarFile)); - } - - (new File(jarFile)).delete(); - FileOutputStream fos = new FileOutputStream(jarFile); - ZipOutputStream zos = new ZipOutputStream(fos); - - // The manifest must be the first or second entry. See comments in JarInputStream - // constructor and JDK-5046178. - if (manifest != null) { - writeToDisk(zos, "META-INF/MANIFEST.MF", manifest.getInputStream()); - } - - for (int i=from; i 0) { - pathName = prependPath + "/" + pathName; - } - writeToDisk(zos, pathName, is); - } - - public static void writeClassToDisk(String className, byte[] bytecode) throws Exception { - writeClassToDisk(null, className, bytecode); - } - private static void writeClassToDisk(ZipOutputStream zos, String className, byte[] bytecode) throws Exception { - writeClassToDisk(zos, className, bytecode, ""); - } - - public static void writeClassToDisk(String className, byte[] bytecode, String prependPath) throws Exception { - writeClassToDisk(null, className, bytecode, prependPath); - } - private static void writeClassToDisk(ZipOutputStream zos, String className, byte[] bytecode, String prependPath) throws Exception { - // Convert dotted class name to a path to a class file - String pathName = className.replace('.', '/').concat(".class"); - if (prependPath.length() > 0) { - pathName = prependPath + "/" + pathName; - } - writeToDisk(zos, pathName, new ByteArrayInputStream(bytecode)); - } - - private static void writeToDisk(ZipOutputStream zos, String pathName, InputStream is) throws Exception { - if (DEBUG) { - System.out.println("ClassFileInstaller: Writing " + pathName); - } - if (zos != null) { - ZipEntry ze = new ZipEntry(pathName); - zos.putNextEntry(ze); - byte[] buf = new byte[1024]; - int len; - while ((len = is.read(buf))>0){ - zos.write(buf, 0, len); - } - } else { - // Create the class file's package directory - Path p = Paths.get(pathName); - if (pathName.contains("/")) { - Files.createDirectories(p.getParent()); - } - // Create the class file - Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING); - } - is.close(); - } -} diff --git a/hotspot/test/testlibrary/RedefineClassHelper.java b/hotspot/test/testlibrary/RedefineClassHelper.java deleted file mode 100644 index 6baddd8e2ec..00000000000 --- a/hotspot/test/testlibrary/RedefineClassHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.PrintWriter; -import java.lang.instrument.*; -import jdk.test.lib.*; - -/* - * Helper class to write tests that redefine classes. - * When main method is run, it will create a redefineagent.jar that can be used - * with the -javaagent option to support redefining classes in jtreg tests. - * - * See sample test in test/testlibrary_tests/RedefineClassTest.java - */ -public class RedefineClassHelper { - - public static Instrumentation instrumentation; - public static void premain(String agentArgs, Instrumentation inst) { - instrumentation = inst; - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param javacode String with the new java code for the class to be redefined - */ - public static void redefineClass(Class clazz, String javacode) throws Exception { - byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode); - redefineClass(clazz, bytecode); - } - - /** - * Redefine a class - * - * @param clazz Class to redefine - * @param bytecode byte[] with the new class - */ - public static void redefineClass(Class clazz, byte[] bytecode) throws Exception { - instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode)); - } - - /** - * Main method to be invoked before test to create the redefineagent.jar - */ - public static void main(String[] args) throws Exception { - ClassFileInstaller.main("RedefineClassHelper"); - - PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Premain-Class: RedefineClassHelper"); - pw.println("Can-Redefine-Classes: true"); - pw.close(); - - sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); - if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) { - throw new Exception("jar operation failed"); - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/Asserts.java b/hotspot/test/testlibrary/jdk/test/lib/Asserts.java deleted file mode 100644 index c07a3f38fe5..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/Asserts.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -/** - * Asserts that can be used for verifying assumptions in tests. - * - * An assertion will throw a {@link RuntimeException} if the assertion isn't - * valid. All the asserts can be imported into a test by using a static - * import: - * - *
- * {@code
- * import static jdk.test.lib.Asserts.*;
- * }
- *
- * Always provide a message describing the assumption if the line number of the
- * failing assertion isn't enough to understand why the assumption failed. For
- * example, if the assertion is in a loop or in a method that is called
- * multiple times, then the line number won't provide enough context to
- * understand the failure.
- * 
- * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib} - */ -@Deprecated -public class Asserts { - - /** - * Shorthand for {@link #assertLessThan(T, T)}. - * - * @see #assertLessThan(T, T) - */ - public static > void assertLT(T lhs, T rhs) { - assertLessThan(lhs, rhs); - } - - /** - * Shorthand for {@link #assertLessThan(T, T, String)}. - * - * @see #assertLessThan(T, T, String) - */ - public static > void assertLT(T lhs, T rhs, String msg) { - assertLessThan(lhs, rhs, msg); - } - - /** - * Calls {@link #assertLessThan(T, T, String)} with a default message. - * - * @see #assertLessThan(T, T, String) - */ - public static > void assertLessThan(T lhs, T rhs) { - assertLessThan(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is less than {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static >void assertLessThan(T lhs, T rhs, String msg) { - assertTrue(compare(lhs, rhs, msg) < 0, getMessage(lhs, rhs, "<", msg)); - } - - /** - * Shorthand for {@link #assertLessThanOrEqual(T, T)}. - * - * @see #assertLessThanOrEqual(T, T) - */ - public static > void assertLTE(T lhs, T rhs) { - assertLessThanOrEqual(lhs, rhs); - } - - /** - * Shorthand for {@link #assertLessThanOrEqual(T, T, String)}. - * - * @see #assertLessThanOrEqual(T, T, String) - */ - public static > void assertLTE(T lhs, T rhs, String msg) { - assertLessThanOrEqual(lhs, rhs, msg); - } - - /** - * Calls {@link #assertLessThanOrEqual(T, T, String)} with a default message. - * - * @see #assertLessThanOrEqual(T, T, String) - */ - public static > void assertLessThanOrEqual(T lhs, T rhs) { - assertLessThanOrEqual(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is less than or equal to {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static > void assertLessThanOrEqual(T lhs, T rhs, String msg) { - assertTrue(compare(lhs, rhs, msg) <= 0, getMessage(lhs, rhs, "<=", msg)); - } - - /** - * Shorthand for {@link #assertEquals(T, T)}. - * - * @see #assertEquals(T, T) - */ - public static void assertEQ(Object lhs, Object rhs) { - assertEquals(lhs, rhs); - } - - /** - * Shorthand for {@link #assertEquals(T, T, String)}. - * - * @see #assertEquals(T, T, String) - */ - public static void assertEQ(Object lhs, Object rhs, String msg) { - assertEquals(lhs, rhs, msg); - } - - /** - * Calls {@link #assertEquals(T, T, String)} with a default message. - * - * @see #assertEquals(T, T, String) - */ - public static void assertEquals(Object lhs, Object rhs) { - assertEquals(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is equal to {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertEquals(Object lhs, Object rhs, String msg) { - if (lhs == null) { - if (rhs != null) { - error(msg); - } - } else { - assertTrue(lhs.equals(rhs), getMessage(lhs, rhs, "==", msg)); - } - } - - /** - * Shorthand for {@link #assertGreaterThanOrEqual(T, T)}. - * - * @see #assertGreaterThanOrEqual(T, T) - */ - public static > void assertGTE(T lhs, T rhs) { - assertGreaterThanOrEqual(lhs, rhs); - } - - /** - * Shorthand for {@link #assertGreaterThanOrEqual(T, T, String)}. - * - * @see #assertGreaterThanOrEqual(T, T, String) - */ - public static > void assertGTE(T lhs, T rhs, String msg) { - assertGreaterThanOrEqual(lhs, rhs, msg); - } - - /** - * Calls {@link #assertGreaterThanOrEqual(T, T, String)} with a default message. - * - * @see #assertGreaterThanOrEqual(T, T, String) - */ - public static > void assertGreaterThanOrEqual(T lhs, T rhs) { - assertGreaterThanOrEqual(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is greater than or equal to {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static > void assertGreaterThanOrEqual(T lhs, T rhs, String msg) { - assertTrue(compare(lhs, rhs, msg) >= 0, getMessage(lhs, rhs, ">=", msg)); - } - - /** - * Shorthand for {@link #assertGreaterThan(T, T)}. - * - * @see #assertGreaterThan(T, T) - */ - public static > void assertGT(T lhs, T rhs) { - assertGreaterThan(lhs, rhs); - } - - /** - * Shorthand for {@link #assertGreaterThan(T, T, String)}. - * - * @see #assertGreaterThan(T, T, String) - */ - public static > void assertGT(T lhs, T rhs, String msg) { - assertGreaterThan(lhs, rhs, msg); - } - - /** - * Calls {@link #assertGreaterThan(T, T, String)} with a default message. - * - * @see #assertGreaterThan(T, T, String) - */ - public static > void assertGreaterThan(T lhs, T rhs) { - assertGreaterThan(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is greater than {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static > void assertGreaterThan(T lhs, T rhs, String msg) { - assertTrue(compare(lhs, rhs, msg) > 0, getMessage(lhs, rhs, ">", msg)); - } - - /** - * Shorthand for {@link #assertNotEquals(T, T)}. - * - * @see #assertNotEquals(T, T) - */ - public static void assertNE(Object lhs, Object rhs) { - assertNotEquals(lhs, rhs); - } - - /** - * Shorthand for {@link #assertNotEquals(T, T, String)}. - * - * @see #assertNotEquals(T, T, String) - */ - public static void assertNE(Object lhs, Object rhs, String msg) { - assertNotEquals(lhs, rhs, msg); - } - - /** - * Calls {@link #assertNotEquals(T, T, String)} with a default message. - * - * @see #assertNotEquals(T, T, String) - */ - public static void assertNotEquals(Object lhs, Object rhs) { - assertNotEquals(lhs, rhs, null); - } - - /** - * Asserts that {@code lhs} is not equal to {@code rhs}. - * - * @param lhs The left hand side of the comparison. - * @param rhs The right hand side of the comparison. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertNotEquals(Object lhs, Object rhs, String msg) { - if (lhs == null) { - if (rhs == null) { - error(msg); - } - } else { - assertFalse(lhs.equals(rhs), getMessage(lhs, rhs,"!=", msg)); - } - } - - /** - * Calls {@link #assertNull(Object, String)} with a default message. - * - * @see #assertNull(Object, String) - */ - public static void assertNull(Object o) { - assertNull(o, "Expected " + format(o) + " to be null"); - } - - /** - * Asserts that {@code o} is null. - * - * @param o The reference assumed to be null. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertNull(Object o, String msg) { - assertEquals(o, null, msg); - } - - /** - * Calls {@link #assertNotNull(Object, String)} with a default message. - * - * @see #assertNotNull(Object, String) - */ - public static void assertNotNull(Object o) { - assertNotNull(o, "Expected non null reference"); - } - - /** - * Asserts that {@code o} is not null. - * - * @param o The reference assumed not to be null, - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertNotNull(Object o, String msg) { - assertNotEquals(o, null, msg); - } - - /** - * Calls {@link #assertFalse(boolean, String)} with a default message. - * - * @see #assertFalse(boolean, String) - */ - public static void assertFalse(boolean value) { - assertFalse(value, "Expected value to be false"); - } - - /** - * Asserts that {@code value} is {@code false}. - * - * @param value The value assumed to be false. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertFalse(boolean value, String msg) { - assertTrue(!value, msg); - } - - /** - * Calls {@link #assertTrue(boolean, String)} with a default message. - * - * @see #assertTrue(boolean, String) - */ - public static void assertTrue(boolean value) { - assertTrue(value, "Expected value to be true"); - } - - /** - * Asserts that {@code value} is {@code true}. - * - * @param value The value assumed to be true. - * @param msg A description of the assumption. - * @throws RuntimeException if the assertion isn't valid. - */ - public static void assertTrue(boolean value, String msg) { - if (!value) { - error(msg); - } - } - - /** - * Asserts that two strings are equal. - * - * If strings are not equals, then exception message - * will contain {@code msg} followed by list of mismatched lines. - * - * @param str1 First string to compare. - * @param str2 Second string to compare. - * @param msg A description of the assumption. - * @throws RuntimeException if strings are not equal. - */ - public static void assertStringsEqual(String str1, String str2, - String msg) { - String lineSeparator = System.getProperty("line.separator"); - String str1Lines[] = str1.split(lineSeparator); - String str2Lines[] = str2.split(lineSeparator); - - int minLength = Math.min(str1Lines.length, str2Lines.length); - String longestStringLines[] = ((str1Lines.length == minLength) ? - str2Lines : str1Lines); - - boolean stringsAreDifferent = false; - - StringBuilder messageBuilder = new StringBuilder(msg); - - messageBuilder.append("\n"); - - for (int line = 0; line < minLength; line++) { - if (!str1Lines[line].equals(str2Lines[line])) { - messageBuilder.append(String. - format("[line %d] '%s' differs " + - "from '%s'\n", - line, - str1Lines[line], - str2Lines[line])); - stringsAreDifferent = true; - } - } - - if (minLength < longestStringLines.length) { - String stringName = ((longestStringLines == str1Lines) ? - "first" : "second"); - messageBuilder.append(String.format("Only %s string contains " + - "following lines:\n", - stringName)); - stringsAreDifferent = true; - for(int line = minLength; line < longestStringLines.length; line++) { - messageBuilder.append(String. - format("[line %d] '%s'", line, - longestStringLines[line])); - } - } - - if (stringsAreDifferent) { - error(messageBuilder.toString()); - } - } - - private static > int compare(T lhs, T rhs, String msg) { - assertNotNull(lhs, msg); - assertNotNull(rhs, msg); - return lhs.compareTo(rhs); - } - - private static String format(Object o) { - return o == null? "null" : o.toString(); - } - - private static void error(String msg) { - throw new RuntimeException(msg); - } - - private static String getMessage(Object lhs, Object rhs, String op, String msg) { - return (msg == null ? "" : msg + " ") + "(assert failed: " + format(lhs) + " " + op + " " + format(rhs) + ")"; - } -} - diff --git a/hotspot/test/testlibrary/jdk/test/lib/BuildHelper.java b/hotspot/test/testlibrary/jdk/test/lib/BuildHelper.java deleted file mode 100644 index e9f3cae8e06..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/BuildHelper.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib; - -import java.io.File; -import java.io.FileReader; -import java.util.Properties; - -public class BuildHelper { - - /** - * Commercial builds should have the BUILD_TYPE set to commercial - * within the release file, found at the root of the JDK. - */ - public static boolean isCommercialBuild() throws Exception { - String buildType = getReleaseProperty("BUILD_TYPE","notFound"); - return buildType.equals("commercial"); - } - - - /** - * Return the value for property key, or defaultValue if no property not found. - * If present, double quotes are trimmed. - */ - public static String getReleaseProperty(String key, String defaultValue) throws Exception { - Properties properties = getReleaseProperties(); - String value = properties.getProperty(key, defaultValue); - return trimDoubleQuotes(value); - } - - /** - * Return the value for property key, or null if no property not found. - * If present, double quotes are trimmed. - */ - public static String getReleaseProperty(String key) throws Exception { - return getReleaseProperty(key, null); - } - - /** - * Get properties from the release file - */ - public static Properties getReleaseProperties() throws Exception { - Properties properties = new Properties(); - properties.load(new FileReader(getReleaseFile())); - return properties; - } - - /** - * Every JDK has a release file in its root. - * @return A handler to the release file. - */ - public static File getReleaseFile() throws Exception { - String jdkPath = getJDKRoot(); - File releaseFile = new File(jdkPath,"release"); - if ( ! releaseFile.canRead() ) { - throw new Exception("Release file is not readable, or it is absent: " + - releaseFile.getCanonicalPath()); - } - return releaseFile; - } - - /** - * Returns path to the JDK under test. - * This path is obtained through the test.jdk property, usually set by JTREG. - */ - public static String getJDKRoot() { - String jdkPath = System.getProperty("test.jdk"); - if (jdkPath == null) { - throw new RuntimeException("System property 'test.jdk' not set. This property is normally set by jtreg. " - + "When running test separately, set this property using '-Dtest.jdk=/path/to/jdk'."); - } - return jdkPath; - } - - /** - * Trim double quotes from the beginning and the end of the given string. - * @param original string to trim. - * @return a new trimmed string. - */ - public static String trimDoubleQuotes(String original) { - if (original == null) { return null; } - String trimmed = original.replaceAll("^\"+|\"+$", ""); - return trimmed; - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/ByteCodeLoader.java b/hotspot/test/testlibrary/jdk/test/lib/ByteCodeLoader.java deleted file mode 100644 index 9e5fa322d48..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/ByteCodeLoader.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.security.SecureClassLoader; - -/** - * {@code ByteCodeLoader} can be used for easy loading of byte code already - * present in memory. - * - * {@code InMemoryCompiler} can be used for compiling source code in a string - * into byte code, which then can be loaded with {@code ByteCodeLoader}. - * - * @see InMemoryCompiler - */ -public class ByteCodeLoader extends SecureClassLoader { - private final String className; - private final byte[] byteCode; - private volatile Class holder; - - /** - * Creates a new {@code ByteCodeLoader} ready to load a class with the - * given name and the given byte code. - * - * @param className The name of the class - * @param byteCode The byte code of the class - */ - public ByteCodeLoader(String className, byte[] byteCode) { - this.className = className; - this.byteCode = byteCode; - } - - @Override - public Class loadClass(String name) throws ClassNotFoundException { - if (!name.equals(className)) { - return super.loadClass(name); - } - if (holder == null) { - synchronized(this) { - if (holder == null) { - holder = findClass(name); - } - } - } - return holder; - } - - @Override - protected Class findClass(String name) throws ClassNotFoundException { - if (!name.equals(className)) { - throw new ClassNotFoundException(name); - } - - return defineClass(name, byteCode, 0, byteCode.length); - } - - /** - * Utility method for creating a new {@code ByteCodeLoader} and then - * directly load the given byte code. - * - * @param className The name of the class - * @param byteCode The byte code for the class - * @throws ClassNotFoundException if the class can't be loaded - * @return A {@see Class} object representing the class - */ - public static Class load(String className, byte[] byteCode) throws ClassNotFoundException { - return new ByteCodeLoader(className, byteCode).loadClass(className); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/DynamicVMOption.java b/hotspot/test/testlibrary/jdk/test/lib/DynamicVMOption.java deleted file mode 100644 index 5d0f1001b73..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/DynamicVMOption.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib; - -import com.sun.management.HotSpotDiagnosticMXBean; -import java.lang.management.ManagementFactory; - -/** - * A utility class to work with VM options which could be altered during - * execution. - * - * This class is a wrapper around {@code com.sun.management.VMOption}. - * It provides more convenient interface to read/write the values. - * - */ -public class DynamicVMOption { - - private final HotSpotDiagnosticMXBean mxBean; - - /** - * VM option name, like "MinHeapFreeRatio". - */ - public final String name; - - /** - * Creates an instance of DynamicVMOption. - * - * @param name the VM option name - */ - public DynamicVMOption(String name) { - this.name = name; - mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); - } - - /** - * Sets a new value for the option. - * Trying to set not applicable value will cause IllegalArgumentException. - * Behavior with null is undefined, most likely NPE will be thrown. - * - * @param newValue the value to be set - * @see #getValue() - * @throws IllegalArgumentException if newValue is not applicable to the option - */ - public final void setValue(String newValue) { - mxBean.setVMOption(name, newValue); - } - - /** - * Returns the value of option. - * - * @return the current option value - * @see #setValue(java.lang.String) - */ - public final String getValue() { - return mxBean.getVMOption(name).getValue(); - } - - /** - * Returns true, if option is writable, false otherwise. - * - * @return true, if option is writable, false otherwise - */ - public final boolean isWriteable() { - return mxBean.getVMOption(name).isWriteable(); - } - - /** - * Checks if the given value is applicable for the option. - * - * This method tries to set the option to the new value. If no exception - * has been thrown the value is treated as valid. - * - * Calling this method will not change the option value. After an attempt - * to set a new value, the option will be restored to its previous value. - * - * @param value the value to verify - * @return true if option could be set to the given value - */ - public boolean isValidValue(String value) { - boolean isValid = true; - String oldValue = getValue(); - try { - setValue(value); - } catch (NullPointerException e) { - if (value == null) { - isValid = false; - } - } catch (IllegalArgumentException e) { - isValid = false; - } finally { - setValue(oldValue); - } - return isValid; - } - - /** - * Returns the value of the given VM option as String. - * - * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()} - * - * @param name the name of VM option - * @return value as a string - * @see #getValue() - */ - public static String getString(String name) { - return new DynamicVMOption(name).getValue(); - } - - /** - * Returns the value of the given option as int. - * - * @param name the name of VM option - * @return value parsed as integer - * @see #getString(java.lang.String) - * - */ - public static int getInt(String name) { - return Integer.parseInt(getString(name)); - } - - /** - * Sets the VM option to a new value. - * - * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)} - * - * @param name the name of VM option - * @param value the value to be set - * @see #setValue(java.lang.String) - */ - public static void setString(String name, String value) { - new DynamicVMOption(name).setValue(value); - } - - /** - * Sets the VM option value to a new integer value. - * - * @param name the name of VM option - * @param value the integer value to be set - * @see #setString(java.lang.String, java.lang.String) - */ - public static void setInt(String name, int value) { - new DynamicVMOption(name).setValue(Integer.toString(value)); - } - -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/ExitCode.java b/hotspot/test/testlibrary/jdk/test/lib/ExitCode.java deleted file mode 100644 index 859346d3d06..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/ExitCode.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib; - -/** - * Exit code values that could be returned by the JVM. - */ -public enum ExitCode { - OK(0), - FAIL(1), - CRASH(134); - - public final int value; - - ExitCode(int value) { - this.value = value; - } -} - diff --git a/hotspot/test/testlibrary/jdk/test/lib/FileInstaller.java b/hotspot/test/testlibrary/jdk/test/lib/FileInstaller.java deleted file mode 100644 index 7a8e3b8575c..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/FileInstaller.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib; - -import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.BasicFileAttributes; - -/** - * Copy a resource: file or directory recursively, using relative path(src and dst) - * which are applied to test source directory(src) and current directory(dst) - */ -public class FileInstaller { - /** - * @param args source and destination - * @throws IOException if an I/O error occurs - */ - public static void main(String[] args) throws IOException { - if (args.length != 2) { - throw new IllegalArgumentException("Unexpected number of arguments for file copy"); - } - Path src = Paths.get(Utils.TEST_SRC, args[0]).toAbsolutePath(); - Path dst = Paths.get(args[1]).toAbsolutePath(); - if (src.toFile().exists()) { - if (src.toFile().isDirectory()) { - Files.walkFileTree(src, new CopyFileVisitor(src, dst)); - } else { - Path dstDir = dst.getParent(); - if (!dstDir.toFile().exists()) { - Files.createDirectories(dstDir); - } - Files.copy(src, dst, StandardCopyOption.REPLACE_EXISTING); - } - } else { - throw new IOException("Can't find source " + src); - } - } - - private static class CopyFileVisitor extends SimpleFileVisitor { - private final Path copyFrom; - private final Path copyTo; - - public CopyFileVisitor(Path copyFrom, Path copyTo) { - this.copyFrom = copyFrom; - this.copyTo = copyTo; - } - - @Override - public FileVisitResult preVisitDirectory(Path file, - BasicFileAttributes attrs) throws IOException { - Path relativePath = file.relativize(copyFrom); - Path destination = copyTo.resolve(relativePath); - if (!destination.toFile().exists()) { - Files.createDirectories(destination); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult visitFile(Path file, - BasicFileAttributes attrs) throws IOException { - if (!file.toFile().isFile()) { - return FileVisitResult.CONTINUE; - } - Path relativePath = copyFrom.relativize(file); - Path destination = copyTo.resolve(relativePath); - Files.copy(file, destination, StandardCopyOption.COPY_ATTRIBUTES); - return FileVisitResult.CONTINUE; - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java b/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java deleted file mode 100644 index 8384b28ca5d..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import java.net.URI; -import java.util.Arrays; - -import javax.tools.ForwardingJavaFileManager; -import javax.tools.FileObject; -import javax.tools.JavaCompiler; -import javax.tools.JavaCompiler.CompilationTask; -import javax.tools.JavaFileObject; -import javax.tools.JavaFileObject.Kind; -import javax.tools.SimpleJavaFileObject; -import javax.tools.ToolProvider; - -/** - * {@code InMemoryJavaCompiler} can be used for compiling a {@link - * CharSequence} to a {@code byte[]}. - * - * The compiler will not use the file system at all, instead using a {@link - * ByteArrayOutputStream} for storing the byte code. For the source code, any - * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link - * StringBuffer} or {@link StringBuilder}. - * - * The {@code InMemoryCompiler} can easily be used together with a {@code - * ByteClassLoader} to easily compile and load source code in a {@link String}: - * - *
- * {@code
- * import jdk.test.lib.InMemoryJavaCompiler;
- * import jdk.test.lib.ByteClassLoader;
- *
- * class Example {
- *     public static void main(String[] args) {
- *         String className = "Foo";
- *         String sourceCode = "public class " + className + " {" +
- *                             "    public void bar() {" +
- *                             "        System.out.println("Hello from bar!");" +
- *                             "    }" +
- *                             "}";
- *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
- *         Class fooClass = ByteClassLoader.load(className, byteCode);
- *     }
- * }
- * }
- * 
- */ -public class InMemoryJavaCompiler { - private static class MemoryJavaFileObject extends SimpleJavaFileObject { - private final String className; - private final CharSequence sourceCode; - private final ByteArrayOutputStream byteCode; - - public MemoryJavaFileObject(String className, CharSequence sourceCode) { - super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE); - this.className = className; - this.sourceCode = sourceCode; - this.byteCode = new ByteArrayOutputStream(); - } - - @Override - public CharSequence getCharContent(boolean ignoreEncodingErrors) { - return sourceCode; - } - - @Override - public OutputStream openOutputStream() throws IOException { - return byteCode; - } - - public byte[] getByteCode() { - return byteCode.toByteArray(); - } - - public String getClassName() { - return className; - } - } - - private static class FileManagerWrapper extends ForwardingJavaFileManager { - private MemoryJavaFileObject file; - - public FileManagerWrapper(MemoryJavaFileObject file) { - super(getCompiler().getStandardFileManager(null, null, null)); - this.file = file; - } - - @Override - public JavaFileObject getJavaFileForOutput(Location location, String className, - Kind kind, FileObject sibling) - throws IOException { - if (!file.getClassName().equals(className)) { - throw new IOException("Expected class with name " + file.getClassName() + - ", but got " + className); - } - return file; - } - } - - /** - * Compiles the class with the given name and source code. - * - * @param className The name of the class - * @param sourceCode The source code for the class with name {@code className} - * @param options additional command line options - * @throws RuntimeException if the compilation did not succeed - * @return The resulting byte code from the compilation - */ - public static byte[] compile(String className, CharSequence sourceCode, String... options) { - MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode); - CompilationTask task = getCompilationTask(file, options); - - if(!task.call()) { - throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); - } - - return file.getByteCode(); - } - - private static JavaCompiler getCompiler() { - return ToolProvider.getSystemJavaCompiler(); - } - - private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) { - return getCompiler().getTask(null, new FileManagerWrapper(file), null, Arrays.asList(options), null, Arrays.asList(file)); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/InfiniteLoop.java b/hotspot/test/testlibrary/jdk/test/lib/InfiniteLoop.java deleted file mode 100644 index 2c1d1a96f7f..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/InfiniteLoop.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib; - -import java.util.Objects; - -/** - * Class which runs another Runnable in infinite loop with certain pauses - * between cycles. - */ -public class InfiniteLoop implements Runnable { - private final Runnable target; - private final long mills; - - - /** - * @param target a target to run in a loop - * @param mills the length of pause time in milliseconds - * @throws NullPointerException if target is null - * @throws IllegalArgumentException if the value of millis is negative - */ - public InfiniteLoop(Runnable target, long mills) { - Objects.requireNonNull(target); - if (mills < 0) { - throw new IllegalArgumentException("mills < 0"); - } - this.target = target; - this.mills = mills; - } - - @Override - public void run() { - try { - while (true) { - target.run(); - if (mills > 0) { - Thread.sleep(mills); - } - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new Error(e); - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java b/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java deleted file mode 100644 index dc924bbfc39..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.io.FileNotFoundException; -import java.nio.file.Path; -import java.nio.file.Paths; - -/** - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib} - */ -@Deprecated -public final class JDKToolFinder { - - private JDKToolFinder() { - } - - /** - * Returns the full path to an executable in jdk/bin based on System - * property {@code test.jdk} or {@code compile.jdk} (both are set by the jtreg test suite) - * - * @return Full path to an executable in jdk/bin - */ - public static String getJDKTool(String tool) { - - // First try to find the executable in test.jdk - try { - return getTool(tool, "test.jdk"); - } catch (FileNotFoundException e) { - - } - - // Now see if it's available in compile.jdk - try { - return getTool(tool, "compile.jdk"); - } catch (FileNotFoundException e) { - throw new RuntimeException("Failed to find " + tool + - ", looked in test.jdk (" + System.getProperty("test.jdk") + - ") and compile.jdk (" + System.getProperty("compile.jdk") + ")"); - } - } - - /** - * Returns the full path to an executable in jdk/bin based on System - * property {@code compile.jdk} - * - * @return Full path to an executable in jdk/bin - */ - public static String getCompileJDKTool(String tool) { - try { - return getTool(tool, "compile.jdk"); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - /** - * Returns the full path to an executable in jdk/bin based on System - * property {@code test.jdk} - * - * @return Full path to an executable in jdk/bin - */ - public static String getTestJDKTool(String tool) { - try { - return getTool(tool, "test.jdk"); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - private static String getTool(String tool, String property) throws FileNotFoundException { - String jdkPath = System.getProperty(property); - - if (jdkPath == null) { - throw new RuntimeException( - "System property '" + property + "' not set. This property is normally set by jtreg. " - + "When running test separately, set this property using '-D" + property + "=/path/to/jdk'."); - } - - Path toolName = Paths.get("bin", tool + (Platform.isWindows() ? ".exe" : "")); - - Path jdkTool = Paths.get(jdkPath, toolName.toString()); - if (!jdkTool.toFile().exists()) { - throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath()); - } - - return jdkTool.toAbsolutePath().toString(); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java b/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java deleted file mode 100644 index eba1859121a..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * A utility for constructing command lines for starting JDK tool processes. - * - * The JDKToolLauncher can in particular be combined with a - * java.lang.ProcessBuilder to easily run a JDK tool. For example, the following - * code run {@code jmap -heap} against a process with GC logging turned on for - * the {@code jmap} process: - * - *
- * {@code
- * JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
- *                                       .addVMArg("-XX:+PrintGC");
- *                                       .addVMArg("-XX:+PrintGCDetails")
- *                                       .addToolArg("-heap")
- *                                       .addToolArg(pid);
- * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
- * Process p = pb.start();
- * }
- * 
- * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib} - */ -@Deprecated -public class JDKToolLauncher { - private final String executable; - private final List vmArgs = new ArrayList(); - private final List toolArgs = new ArrayList(); - - private JDKToolLauncher(String tool, boolean useCompilerJDK) { - if (useCompilerJDK) { - executable = JDKToolFinder.getJDKTool(tool); - } else { - executable = JDKToolFinder.getTestJDKTool(tool); - } - vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs())); - } - - /** - * Creates a new JDKToolLauncher for the specified tool. Using tools path - * from the compiler JDK. - * - * @param tool - * The name of the tool - * @return A new JDKToolLauncher - */ - public static JDKToolLauncher create(String tool) { - return new JDKToolLauncher(tool, true); - } - - /** - * Creates a new JDKToolLauncher for the specified tool in the Tested JDK. - * - * @param tool - * The name of the tool - * - * @return A new JDKToolLauncher - */ - public static JDKToolLauncher createUsingTestJDK(String tool) { - return new JDKToolLauncher(tool, false); - } - - /** - * Adds an argument to the JVM running the tool. - * - * The JVM arguments are passed to the underlying JVM running the tool. - * Arguments will automatically be prepended with "-J". - * - * Any platform specific arguments required for running the tool are - * automatically added. - * - * - * @param arg - * The argument to VM running the tool - * @return The JDKToolLauncher instance - */ - public JDKToolLauncher addVMArg(String arg) { - vmArgs.add(arg); - return this; - } - - /** - * Adds an argument to the tool. - * - * @param arg - * The argument to the tool - * @return The JDKToolLauncher instance - */ - public JDKToolLauncher addToolArg(String arg) { - toolArgs.add(arg); - return this; - } - - /** - * Returns the command that can be used for running the tool. - * - * @return An array whose elements are the arguments of the command. - */ - public String[] getCommand() { - List command = new ArrayList(); - command.add(executable); - // Add -J in front of all vmArgs - for (String arg : vmArgs) { - command.add("-J" + arg); - } - command.addAll(toolArgs); - return command.toArray(new String[command.size()]); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java b/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java deleted file mode 100644 index 15f6f53157b..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public final class OutputAnalyzer { - - private final String stdout; - private final String stderr; - private final int exitValue; - - /** - * Create an OutputAnalyzer, a utility class for verifying output and exit - * value from a Process - * - * @param process Process to analyze - * @throws IOException If an I/O error occurs. - * - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib/process} - */ - @Deprecated - public OutputAnalyzer(Process process) throws IOException { - OutputBuffer output = ProcessTools.getOutput(process); - exitValue = process.exitValue(); - this.stdout = output.getStdout(); - this.stderr = output.getStderr(); - } - - /** - * Create an OutputAnalyzer, a utility class for verifying output - * - * @param buf String buffer to analyze - */ - public OutputAnalyzer(String buf) { - this(buf, buf); - } - - /** - * Create an OutputAnalyzer, a utility class for verifying output - * - * @param stdout stdout buffer to analyze - * @param stderr stderr buffer to analyze - */ - public OutputAnalyzer(String stdout, String stderr) { - this.stdout = stdout; - this.stderr = stderr; - exitValue = -1; - } - - /** - * Verify that the stdout contents of output buffer is empty - * - * @throws RuntimeException - * If stdout was not empty - */ - public void stdoutShouldBeEmpty() { - if (!getStdout().isEmpty()) { - reportDiagnosticSummary(); - throw new RuntimeException("stdout was not empty"); - } - } - - /** - * Verify that the stderr contents of output buffer is empty - * - * @throws RuntimeException - * If stderr was not empty - */ - public void stderrShouldBeEmpty() { - if (!getStderr().isEmpty()) { - reportDiagnosticSummary(); - throw new RuntimeException("stderr was not empty"); - } - } - - /** - * Verify that the stdout contents of output buffer is not empty - * - * @throws RuntimeException - * If stdout was empty - */ - public void stdoutShouldNotBeEmpty() { - if (getStdout().isEmpty()) { - reportDiagnosticSummary(); - throw new RuntimeException("stdout was empty"); - } - } - - /** - * Verify that the stderr contents of output buffer is not empty - * - * @throws RuntimeException - * If stderr was empty - */ - public void stderrShouldNotBeEmpty() { - if (getStderr().isEmpty()) { - reportDiagnosticSummary(); - throw new RuntimeException("stderr was empty"); - } - } - - /** - * Verify that the stdout and stderr contents of output buffer contains the string - * - * @param expectedString String that buffer should contain - * @throws RuntimeException If the string was not found - */ - public OutputAnalyzer shouldContain(String expectedString) { - if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n"); - } - return this; - } - - /** - * Verify that the stdout contents of output buffer contains the string - * - * @param expectedString String that buffer should contain - * @throws RuntimeException If the string was not found - */ - public OutputAnalyzer stdoutShouldContain(String expectedString) { - if (!stdout.contains(expectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + expectedString + "' missing from stdout \n"); - } - return this; - } - - /** - * Verify that the stderr contents of output buffer contains the string - * - * @param expectedString String that buffer should contain - * @throws RuntimeException If the string was not found - */ - public OutputAnalyzer stderrShouldContain(String expectedString) { - if (!stderr.contains(expectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + expectedString + "' missing from stderr \n"); - } - return this; - } - - /** - * Verify that the stdout and stderr contents of output buffer does not contain the string - * - * @param expectedString String that the buffer should not contain - * @throws RuntimeException If the string was found - */ - public OutputAnalyzer shouldNotContain(String notExpectedString) { - if (stdout.contains(notExpectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + notExpectedString + "' found in stdout \n"); - } - if (stderr.contains(notExpectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + notExpectedString + "' found in stderr \n"); - } - return this; - } - - /** - * Verify that the stdout contents of output buffer does not contain the string - * - * @param expectedString String that the buffer should not contain - * @throws RuntimeException If the string was found - */ - public OutputAnalyzer stdoutShouldNotContain(String notExpectedString) { - if (stdout.contains(notExpectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + notExpectedString + "' found in stdout \n"); - } - return this; - } - - /** - * Verify that the stderr contents of output buffer does not contain the string - * - * @param expectedString String that the buffer should not contain - * @throws RuntimeException If the string was found - */ - public OutputAnalyzer stderrShouldNotContain(String notExpectedString) { - if (stderr.contains(notExpectedString)) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + notExpectedString + "' found in stderr \n"); - } - return this; - } - - /** - * Verify that the stdout and stderr contents of output buffer matches - * the pattern - * - * @param pattern - * @throws RuntimeException If the pattern was not found - */ - public OutputAnalyzer shouldMatch(String pattern) { - Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); - Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); - if (!stdoutMatcher.find() && !stderrMatcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' missing from stdout/stderr \n"); - } - return this; - } - - /** - * Verify that the stdout contents of output buffer matches the - * pattern - * - * @param pattern - * @throws RuntimeException If the pattern was not found - */ - public OutputAnalyzer stdoutShouldMatch(String pattern) { - Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); - if (!matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' missing from stdout \n"); - } - return this; - } - - /** - * Verify that the stderr contents of output buffer matches the - * pattern - * - * @param pattern - * @throws RuntimeException If the pattern was not found - */ - public OutputAnalyzer stderrShouldMatch(String pattern) { - Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); - if (!matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' missing from stderr \n"); - } - return this; - } - - /** - * Verify that the stdout and stderr contents of output buffer does not - * match the pattern - * - * @param pattern - * @throws RuntimeException If the pattern was found - */ - public OutputAnalyzer shouldNotMatch(String pattern) { - Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); - if (matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' found in stdout: '" + matcher.group() + "' \n"); - } - matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); - if (matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' found in stderr: '" + matcher.group() + "' \n"); - } - return this; - } - - /** - * Verify that the stdout contents of output buffer does not match the - * pattern - * - * @param pattern - * @throws RuntimeException If the pattern was found - */ - public OutputAnalyzer stdoutShouldNotMatch(String pattern) { - Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); - if (matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' found in stdout \n"); - } - return this; - } - - /** - * Verify that the stderr contents of output buffer does not match the - * pattern - * - * @param pattern - * @throws RuntimeException If the pattern was found - */ - public OutputAnalyzer stderrShouldNotMatch(String pattern) { - Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); - if (matcher.find()) { - reportDiagnosticSummary(); - throw new RuntimeException("'" + pattern - + "' found in stderr \n"); - } - return this; - } - - /** - * Get the captured group of the first string matching the pattern. - * stderr is searched before stdout. - * - * @param pattern The multi-line pattern to match - * @param group The group to capture - * @return The matched string or null if no match was found - */ - public String firstMatch(String pattern, int group) { - Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); - Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); - if (stderrMatcher.find()) { - return stderrMatcher.group(group); - } - if (stdoutMatcher.find()) { - return stdoutMatcher.group(group); - } - return null; - } - - /** - * Get the first string matching the pattern. - * stderr is searched before stdout. - * - * @param pattern The multi-line pattern to match - * @return The matched string or null if no match was found - */ - public String firstMatch(String pattern) { - return firstMatch(pattern, 0); - } - - /** - * Verify the exit value of the process - * - * @param expectedExitValue Expected exit value from process - * @throws RuntimeException If the exit value from the process did not match the expected value - */ - public OutputAnalyzer shouldHaveExitValue(int expectedExitValue) { - if (getExitValue() != expectedExitValue) { - reportDiagnosticSummary(); - throw new RuntimeException("Expected to get exit value of [" - + expectedExitValue + "]\n"); - } - return this; - } - - - /** - * Report summary that will help to diagnose the problem - * Currently includes: - * - standard input produced by the process under test - * - standard output - * - exit code - * Note: the command line is printed by the ProcessTools - */ - public void reportDiagnosticSummary() { - String msg = - " stdout: [" + stdout + "];\n" + - " stderr: [" + stderr + "]\n" + - " exitValue = " + getExitValue() + "\n"; - - System.err.println(msg); - } - - - /** - * Get the contents of the output buffer (stdout and stderr) - * - * @return Content of the output buffer - */ - public String getOutput() { - return stdout + stderr; - } - - /** - * Get the contents of the stdout buffer - * - * @return Content of the stdout buffer - */ - public String getStdout() { - return stdout; - } - - /** - * Get the contents of the stderr buffer - * - * @return Content of the stderr buffer - */ - public String getStderr() { - return stderr; - } - - /** - * Get the process exit value - * - * @return Process exit value - */ - public int getExitValue() { - return exitValue; - } - - /** - * Get the contents of the output buffer (stdout and stderr) as list of strings. - * Output will be split by newlines. - * - * @return Contents of the output buffer as list of strings - */ - public List asLines() { - return asLines(getOutput()); - } - - private List asLines(String buffer) { - return Arrays.asList(buffer.split("(\\r\\n|\\n|\\r)")); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java b/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java deleted file mode 100644 index 31ad53b6b56..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -/** - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib/process} - */ -@Deprecated -public class OutputBuffer { - private final String stdout; - private final String stderr; - - /** - * Create an OutputBuffer, a class for storing and managing stdout and stderr - * results separately - * - * @param stdout stdout result - * @param stderr stderr result - */ - public OutputBuffer(String stdout, String stderr) { - this.stdout = stdout; - this.stderr = stderr; - } - - /** - * Returns the stdout result - * - * @return stdout result - */ - public String getStdout() { - return stdout; - } - - /** - * Returns the stderr result - * - * @return stderr result - */ - public String getStderr() { - return stderr; - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/Pair.java b/hotspot/test/testlibrary/jdk/test/lib/Pair.java deleted file mode 100644 index 3e2a3c01ae5..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/Pair.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib; - -import java.util.Objects; - -/** - * Pair - a two element tuple - * - * @param first type - * @param second type - */ -public class Pair { - public final F first; - public final S second; - - public Pair(F first, S second) { - this.first = first; - this.second = second; - } - - @Override - public String toString() { - return "(" + first + ":" + second + ")"; - } - - @Override - public boolean equals(Object other) { - if (other instanceof Pair) { - Pair otherPair = (Pair) other; - return Objects.equals(first, otherPair.first) && - Objects.equals(second, otherPair.second); - } - return false; - } - - @Override - public int hashCode() { - if (first == null) { - return (second == null) ? 0 : second.hashCode(); - } else if (second == null) { - return first.hashCode(); - } else { - return first.hashCode() * 17 + second.hashCode(); - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/Platform.java b/hotspot/test/testlibrary/jdk/test/lib/Platform.java deleted file mode 100644 index d0906636400..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2013, 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 jdk.test.lib; - -import java.util.regex.Pattern; - -/** - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib} - */ -@Deprecated -public class Platform { - public static final String vmName = System.getProperty("java.vm.name"); - public static final String vmInfo = System.getProperty("java.vm.info"); - private static final String osName = System.getProperty("os.name"); - private static final String dataModel = System.getProperty("sun.arch.data.model"); - private static final String vmVersion = System.getProperty("java.vm.version"); - private static final String jdkDebug = System.getProperty("jdk.debug"); - private static final String osArch = System.getProperty("os.arch"); - private static final String userName = System.getProperty("user.name"); - private static final String compiler = System.getProperty("sun.management.compiler"); - - public static boolean isClient() { - return vmName.endsWith(" Client VM"); - } - - public static boolean isServer() { - return vmName.endsWith(" Server VM"); - } - - public static boolean isGraal() { - return vmName.endsWith(" Graal VM"); - } - - public static boolean isZero() { - return vmName.endsWith(" Zero VM"); - } - - public static boolean isMinimal() { - return vmName.endsWith(" Minimal VM"); - } - - public static boolean isTieredSupported() { - return compiler.contains("Tiered Compilers"); - } - - public static boolean isInt() { - return vmInfo.contains("interpreted"); - } - - public static boolean isMixed() { - return vmInfo.contains("mixed"); - } - - public static boolean isComp() { - return vmInfo.contains("compiled"); - } - - public static boolean is32bit() { - return dataModel.equals("32"); - } - - public static boolean is64bit() { - return dataModel.equals("64"); - } - - public static boolean isAix() { - return isOs("aix"); - } - - public static boolean isLinux() { - return isOs("linux"); - } - - public static boolean isOSX() { - return isOs("mac"); - } - - public static boolean isSolaris() { - return isOs("sunos"); - } - - public static boolean isWindows() { - return isOs("win"); - } - - private static boolean isOs(String osname) { - return osName.toLowerCase().startsWith(osname.toLowerCase()); - } - - public static String getOsName() { - return osName; - } - - public static boolean isDebugBuild() { - return (jdkDebug.toLowerCase().contains("debug")); - } - - public static String getVMVersion() { - return vmVersion; - } - - // Returns true for sparc and sparcv9. - public static boolean isSparc() { - return isArch("sparc.*"); - } - - public static boolean isARM() { - return isArch("arm.*"); - } - - public static boolean isPPC() { - return isArch("ppc.*"); - } - - public static boolean isX86() { - // On Linux it's 'i386', Windows 'x86' without '_64' suffix. - return isArch("(i386)|(x86(?!_64))"); - } - - public static boolean isX64() { - // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64' - return isArch("(amd64)|(x86_64)"); - } - - public static boolean isAArch64() { - return isArch("aarch64"); - } - - private static boolean isArch(String archnameRE) { - return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE) - .matcher(osArch) - .matches(); - } - - public static String getOsArch() { - return osArch; - } - - /** - * Return a boolean for whether we expect to be able to attach - * the SA to our own processes on this system. - */ - public static boolean shouldSAAttach() throws Exception { - - if (isAix()) { - return false; // SA not implemented. - } else if (isLinux()) { - return canPtraceAttachLinux(); - } else if (isOSX()) { - return canAttachOSX(); - } else { - // Other platforms expected to work: - return true; - } - } - - /** - * On Linux, first check the SELinux boolean "deny_ptrace" and return false - * as we expect to be denied if that is "1". Then expect permission to attach - * if we are root, so return true. Then return false for an expected denial - * if "ptrace_scope" is 1, and true otherwise. - */ - public static boolean canPtraceAttachLinux() throws Exception { - - // SELinux deny_ptrace: - String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace"); - if (deny_ptrace != null && deny_ptrace.contains("1")) { - // ptrace will be denied: - return false; - } - - if (userName.equals("root")) { - return true; - } - - // ptrace_scope: - String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope"); - if (ptrace_scope != null && ptrace_scope.contains("1")) { - // ptrace will be denied: - return false; - } - - // Otherwise expect to be permitted: - return true; - } - - /** - * On OSX, expect permission to attach only if we are root. - */ - public static boolean canAttachOSX() throws Exception { - return userName.equals("root"); - } - - /** - * return path to library inside jdk tree - */ - public static String jdkLibPath() { - if (isWindows()) { - return "bin"; - } - if (isOSX()) { - return "lib"; - } - - return "lib/" + getOsArch(); - } - - /** - * Build name of shared object according to platform rules - */ - public static String sharedObjectName(String name) { - if (isWindows()) { - return name + ".dll"; - } - if (isOSX()) { - return "lib" + name + ".dylib"; - } - return "lib" + name + ".so"; - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java b/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java deleted file mode 100644 index 21ff4159761..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.lang.management.RuntimeMXBean; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib/process} - */ -@Deprecated -public final class ProcessTools { - - private ProcessTools() { - } - - /** - * Pumps stdout and stderr from running the process into a String. - * - * @param processBuilder ProcessBuilder to run. - * @return Output from process. - * @throws IOException If an I/O error occurs. - */ - public static OutputBuffer getOutput(ProcessBuilder processBuilder) throws IOException { - return getOutput(processBuilder.start()); - } - - /** - * Pumps stdout and stderr the running process into a String. - * - * @param process Process to pump. - * @return Output from process. - * @throws IOException If an I/O error occurs. - */ - public static OutputBuffer getOutput(Process process) throws IOException { - ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream(); - ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream(); - StreamPumper outPumper = new StreamPumper(process.getInputStream(), stdoutBuffer); - StreamPumper errPumper = new StreamPumper(process.getErrorStream(), stderrBuffer); - Thread outPumperThread = new Thread(outPumper); - Thread errPumperThread = new Thread(errPumper); - - outPumperThread.setDaemon(true); - errPumperThread.setDaemon(true); - - outPumperThread.start(); - errPumperThread.start(); - - try { - process.waitFor(); - outPumperThread.join(); - errPumperThread.join(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - return null; - } - - return new OutputBuffer(stdoutBuffer.toString(), stderrBuffer.toString()); - } - - /** - * Get the process id of the current running Java process - * - * @return Process id - */ - public static long getProcessId() throws Exception { - return ProcessHandle.current().getPid(); - } - - /** - * Gets the array of strings containing input arguments passed to the VM - * - * @return arguments - */ - public static String[] getVmInputArgs() { - RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); - List args = runtime.getInputArguments(); - return args.toArray(new String[args.size()]); - } - - /** - * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris) - * - * @return String[] with platform specific arguments, empty if there are none - */ - public static String[] getPlatformSpecificVMArgs() { - - if (Platform.is64bit() && Platform.isSolaris()) { - return new String[] { "-d64" }; - } - - return new String[] {}; - } - - /** - * Create ProcessBuilder using the java launcher from the jdk to be tested and - * with any platform specific arguments prepended - */ - public static ProcessBuilder createJavaProcessBuilder(String... command) throws Exception { - return createJavaProcessBuilder(false, command); - } - - public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception { - String javapath = JDKToolFinder.getJDKTool("java"); - - ArrayList args = new ArrayList<>(); - args.add(javapath); - Collections.addAll(args, getPlatformSpecificVMArgs()); - - args.add("-cp"); - args.add(System.getProperty("java.class.path")); - - if (addTestVmAndJavaOptions) { - Collections.addAll(args, Utils.getTestJavaOpts()); - } - - Collections.addAll(args, command); - - // Reporting - StringBuilder cmdLine = new StringBuilder(); - for (String cmd : args) { - cmdLine.append(cmd).append(' '); - } - System.out.println("Command line: [" + cmdLine.toString() + "]"); - - return new ProcessBuilder(args.toArray(new String[args.size()])); - } - - /** - * Executes a test jvm process, waits for it to finish and returns the process output. - * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added. - * The java from the test.jdk is used to execute the command. - * - * The command line will be like: - * {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds - * - * @param cmds User specifed arguments. - * @return The output from the process. - */ - public static OutputAnalyzer executeTestJvm(String... cmds) throws Throwable { - ProcessBuilder pb = createJavaProcessBuilder(Utils.addTestJavaOpts(cmds)); - return executeProcess(pb); - } - - /** - * Executes a test jvm process, waits for it to finish and returns the process output. - * The default jvm options from the test's run command, jtreg, test.vm.opts and test.java.opts, are added. - * The java from the test.jdk is used to execute the command. - * - * The command line will be like: - * {test.jdk}/bin/java {test.fromRun.opts} {test.vm.opts} {test.java.opts} cmds - * - * @param cmds User specifed arguments. - * @return The output from the process. - */ - public static OutputAnalyzer executeTestJvmAllArgs(String... cmds) throws Throwable { - List argsList = new ArrayList<>(); - String[] testArgs = getVmInputArgs(); - Collections.addAll(argsList, testArgs); - Collections.addAll(argsList, Utils.addTestJavaOpts(cmds)); - ProcessBuilder pb = createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); - return executeProcess(pb); - } - - /** - * Executes a process, waits for it to finish and returns the process output. - * The process will have exited before this method returns. - * @param pb The ProcessBuilder to execute. - * @return The {@linkplain OutputAnalyzer} instance wrapping the process. - */ - public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception { - OutputAnalyzer output = null; - Process p = null; - boolean failed = false; - try { - p = pb.start(); - output = new OutputAnalyzer(p); - p.waitFor(); - - return output; - } catch (Throwable t) { - if (p != null) { - p.destroyForcibly().waitFor(); - } - - failed = true; - System.out.println("executeProcess() failed: " + t); - throw t; - } finally { - if (failed) { - System.err.println(getProcessLog(pb, output)); - } - } - } - - /** - * Executes a process, waits for it to finish and returns the process output. - * @param cmds The command line to execute. - * @return The output from the process. - */ - public static OutputAnalyzer executeProcess(String... cmds) throws Throwable { - return executeProcess(new ProcessBuilder(cmds)); - } - - /** - * Used to log command line, stdout, stderr and exit code from an executed process. - * @param pb The executed process. - * @param output The output from the process. - */ - public static String getProcessLog(ProcessBuilder pb, OutputAnalyzer output) { - String stderr = output == null ? "null" : output.getStderr(); - String stdout = output == null ? "null" : output.getStdout(); - String exitValue = output == null ? "null": Integer.toString(output.getExitValue()); - StringBuilder logMsg = new StringBuilder(); - final String nl = System.getProperty("line.separator"); - logMsg.append("--- ProcessLog ---" + nl); - logMsg.append("cmd: " + getCommandLine(pb) + nl); - logMsg.append("exitvalue: " + exitValue + nl); - logMsg.append("stderr: " + stderr + nl); - logMsg.append("stdout: " + stdout + nl); - return logMsg.toString(); - } - - /** - * @return The full command line for the ProcessBuilder. - */ - public static String getCommandLine(ProcessBuilder pb) { - if (pb == null) { - return "null"; - } - StringBuilder cmd = new StringBuilder(); - for (String s : pb.command()) { - cmd.append(s).append(" "); - } - return cmd.toString().trim(); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java b/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java deleted file mode 100644 index 399ecb179ce..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 jdk.test.lib; - -import java.io.OutputStream; -import java.io.InputStream; -import java.io.IOException; - -/** - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib/process} - */ -@Deprecated -public final class StreamPumper implements Runnable { - - private static final int BUF_SIZE = 256; - - private final OutputStream out; - private final InputStream in; - - /** - * Create a StreamPumper that reads from in and writes to out. - * - * @param in The stream to read from. - * @param out The stream to write to. - */ - public StreamPumper(InputStream in, OutputStream out) { - this.in = in; - this.out = out; - } - - /** - * Implements Thread.run(). Continuously read from in and write - * to out until in has reached end of stream. Abort - * on interruption. Abort on IOExceptions. - */ - @Override - public void run() { - int length; - InputStream localIn = in; - OutputStream localOut = out; - byte[] buffer = new byte[BUF_SIZE]; - - try { - while (!Thread.interrupted() && (length = localIn.read(buffer)) > 0) { - localOut.write(buffer, 0, length); - } - } catch (IOException e) { - // Just abort if something like this happens. - e.printStackTrace(); - } finally { - try { - localOut.flush(); - in.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/TimeLimitedRunner.java b/hotspot/test/testlibrary/jdk/test/lib/TimeLimitedRunner.java deleted file mode 100644 index 4d014fed145..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/TimeLimitedRunner.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib; - -import java.util.Objects; -import java.util.concurrent.Callable; - -/** - * Auxiliary class to run target w/ given timeout. - */ -public class TimeLimitedRunner implements Callable { - private final long stoptime; - private final long timeout; - private final double factor; - private final Callable target; - - /** - * @param timeout a timeout. zero means no time limitation - * @param factor a multiplier used to estimate next iteration time - * @param target a target to run - * @throws NullPointerException if target is null - * @throws IllegalArgumentException if timeout is negative or - factor isn't positive - */ - public TimeLimitedRunner(long timeout, double factor, - Callable target) { - Objects.requireNonNull(target, "target must not be null"); - if (timeout < 0) { - throw new IllegalArgumentException("timeout[" + timeout + "] < 0"); - } - if (factor <= 0d) { - throw new IllegalArgumentException("factor[" + factor + "] <= 0"); - } - this.stoptime = System.currentTimeMillis() + timeout; - this.timeout = timeout; - this.factor = factor; - this.target = target; - } - - /** - * Runs @{linkplan target} while it returns true and timeout isn't exceeded - */ - @Override - public Void call() throws Exception { - long maxDuration = 0L; - long iterStart = System.currentTimeMillis(); - if (timeout != 0 && iterStart > stoptime) { - return null; - } - while (target.call()) { - if (timeout != 0) { - long iterDuration = System.currentTimeMillis() - iterStart; - maxDuration = Math.max(maxDuration, iterDuration); - iterStart = System.currentTimeMillis(); - if (iterStart + (maxDuration * factor) > stoptime) { - System.out.println("Not enough time to continue execution. " - + "Interrupted."); - break; - } - } - } - return null; - } - -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/Triple.java b/hotspot/test/testlibrary/jdk/test/lib/Triple.java deleted file mode 100644 index d459aa03af5..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/Triple.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib; - -import java.util.Objects; - -/** - * Triple - a three element tuple - * - * @param first element type - * @param second element type - * @param third element type - */ -public class Triple { - private final Pair> container; - - /** - * Constructor - * - * @param first first element of the triple - * @param second second element of the triple - * @param third third element of the triple - */ - public Triple(F first, S second, T third) { - container = new Pair<>(first, new Pair<>(second, third)); - } - - /** - * Gets first element of the triple - */ - public F getFirst() { - return container.first; - } - - /** - * Gets second element of the triple - */ - public S getSecond() { - return container.second.first; - } - - /** - * Gets third element of the triple - */ - public T getThird() { - return container.second.second; - } - - @Override - public int hashCode() { - return container.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof Triple) { - Triple objTriple = (Triple) obj; - return Objects.equals(container.first, objTriple.container.first) - && Objects.equals(container.second, - objTriple.container.second); - } - return false; - } - - @Override - public String toString() { - return "(" + getFirst() + " : " + getSecond() + " : " + getThird() + ")"; - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/Utils.java b/hotspot/test/testlibrary/jdk/test/lib/Utils.java deleted file mode 100644 index 6925f73d0e4..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/Utils.java +++ /dev/null @@ -1,648 +0,0 @@ -/* - * Copyright (c) 2013, 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 jdk.test.lib; - -import java.io.File; -import static jdk.test.lib.Asserts.assertTrue; -import java.io.IOException; -import java.lang.reflect.Field; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.ServerSocket; -import java.net.URL; -import java.net.URLClassLoader; -import java.net.UnknownHostException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; -import java.util.Random; -import java.util.function.BooleanSupplier; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import jdk.internal.misc.Unsafe; - -/** - * Common library for various test helper functions. - * - * @deprecated This class is deprecated. Use the one from - * {@code /test/lib/share/classes/jdk/test/lib} - */ -@Deprecated -public final class Utils { - - /** - * Returns the value of 'test.class.path' system property. - */ - public static final String TEST_CLASS_PATH = System.getProperty("test.class.path", "."); - - /** - * Returns the sequence used by operating system to separate lines. - */ - public static final String NEW_LINE = System.getProperty("line.separator"); - - /** - * Returns the value of 'test.vm.opts' system property. - */ - public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim(); - - /** - * Returns the value of 'test.java.opts' system property. - */ - public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim(); - - /** - * Returns the value of 'test.src' system property. - */ - public static final String TEST_SRC = System.getProperty("test.src", ".").trim(); - - /* - * Returns the value of 'test.jdk' system property - */ - public static final String TEST_JDK = System.getProperty("test.jdk"); - - /** - * Returns the value of 'test.classes' system property - */ - public static final String TEST_CLASSES = System.getProperty("test.classes", "."); - - private static Unsafe unsafe = null; - - /** - * Defines property name for seed value. - */ - public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed"; - - /* (non-javadoc) - * Random generator with (or without) predefined seed. Depends on - * "jdk.test.lib.random.seed" property value. - */ - private static volatile Random RANDOM_GENERATOR; - - /** - * Contains the seed value used for {@link java.util.Random} creation. - */ - public static final long SEED = Long.getLong(SEED_PROPERTY_NAME, new Random().nextLong()); - /** - * Returns the value of 'test.timeout.factor' system property - * converted to {@code double}. - */ - public static final double TIMEOUT_FACTOR; - static { - String toFactor = System.getProperty("test.timeout.factor", "1.0"); - TIMEOUT_FACTOR = Double.parseDouble(toFactor); - } - - /** - * Returns the value of JTREG default test timeout in milliseconds - * converted to {@code long}. - */ - public static final long DEFAULT_TEST_TIMEOUT = TimeUnit.SECONDS.toMillis(120); - - private Utils() { - // Private constructor to prevent class instantiation - } - - /** - * Returns the list of VM options. - * - * @return List of VM options - */ - public static List getVmOptions() { - return Arrays.asList(safeSplitString(VM_OPTIONS)); - } - - /** - * Returns the list of VM options with -J prefix. - * - * @return The list of VM options with -J prefix - */ - public static List getForwardVmOptions() { - String[] opts = safeSplitString(VM_OPTIONS); - for (int i = 0; i < opts.length; i++) { - opts[i] = "-J" + opts[i]; - } - return Arrays.asList(opts); - } - - /** - * Returns the default JTReg arguments for a jvm running a test. - * This is the combination of JTReg arguments test.vm.opts and test.java.opts. - * @return An array of options, or an empty array if no options. - */ - public static String[] getTestJavaOpts() { - List opts = new ArrayList(); - Collections.addAll(opts, safeSplitString(VM_OPTIONS)); - Collections.addAll(opts, safeSplitString(JAVA_OPTIONS)); - return opts.toArray(new String[0]); - } - - /** - * Returns the default JTReg arguments for a jvm running a test without - * options that matches regular expressions in {@code filters}. - * This is the combination of JTReg arguments test.vm.opts and test.java.opts. - * @param filters Regular expressions used to filter out options. - * @return An array of options, or an empty array if no options. - */ - public static String[] getFilteredTestJavaOpts(String... filters) { - String options[] = getTestJavaOpts(); - - if (filters.length == 0) { - return options; - } - - List filteredOptions = new ArrayList(options.length); - Pattern patterns[] = new Pattern[filters.length]; - for (int i = 0; i < filters.length; i++) { - patterns[i] = Pattern.compile(filters[i]); - } - - for (String option : options) { - boolean matched = false; - for (int i = 0; i < patterns.length && !matched; i++) { - Matcher matcher = patterns[i].matcher(option); - matched = matcher.find(); - } - if (!matched) { - filteredOptions.add(option); - } - } - - return filteredOptions.toArray(new String[filteredOptions.size()]); - } - - /** - * Combines given arguments with default JTReg arguments for a jvm running a test. - * This is the combination of JTReg arguments test.vm.opts and test.java.opts - * @return The combination of JTReg test java options and user args. - */ - public static String[] addTestJavaOpts(String... userArgs) { - List opts = new ArrayList(); - Collections.addAll(opts, getTestJavaOpts()); - Collections.addAll(opts, userArgs); - return opts.toArray(new String[0]); - } - - /** - * Splits a string by white space. - * Works like String.split(), but returns an empty array - * if the string is null or empty. - */ - private static String[] safeSplitString(String s) { - if (s == null || s.trim().isEmpty()) { - return new String[] {}; - } - return s.trim().split("\\s+"); - } - - /** - * @return The full command line for the ProcessBuilder. - */ - public static String getCommandLine(ProcessBuilder pb) { - StringBuilder cmd = new StringBuilder(); - for (String s : pb.command()) { - cmd.append(s).append(" "); - } - return cmd.toString(); - } - - /** - * Returns the free port on the local host. - * The function will spin until a valid port number is found. - * - * @return The port number - * @throws InterruptedException if any thread has interrupted the current thread - * @throws IOException if an I/O error occurs when opening the socket - */ - public static int getFreePort() throws InterruptedException, IOException { - int port = -1; - - while (port <= 0) { - Thread.sleep(100); - - ServerSocket serverSocket = null; - try { - serverSocket = new ServerSocket(0); - port = serverSocket.getLocalPort(); - } finally { - serverSocket.close(); - } - } - - return port; - } - - /** - * Returns the name of the local host. - * - * @return The host name - * @throws UnknownHostException if IP address of a host could not be determined - */ - public static String getHostname() throws UnknownHostException { - InetAddress inetAddress = InetAddress.getLocalHost(); - String hostName = inetAddress.getHostName(); - - assertTrue((hostName != null && !hostName.isEmpty()), - "Cannot get hostname"); - - return hostName; - } - - /** - * Uses "jcmd -l" to search for a jvm pid. This function will wait - * forever (until jtreg timeout) for the pid to be found. - * @param key Regular expression to search for - * @return The found pid. - */ - public static int waitForJvmPid(String key) throws Throwable { - final long iterationSleepMillis = 250; - System.out.println("waitForJvmPid: Waiting for key '" + key + "'"); - System.out.flush(); - while (true) { - int pid = tryFindJvmPid(key); - if (pid >= 0) { - return pid; - } - Thread.sleep(iterationSleepMillis); - } - } - - /** - * Searches for a jvm pid in the output from "jcmd -l". - * - * Example output from jcmd is: - * 12498 sun.tools.jcmd.JCmd -l - * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar - * - * @param key A regular expression to search for. - * @return The found pid, or -1 if not found. - * @throws Exception If multiple matching jvms are found. - */ - public static int tryFindJvmPid(String key) throws Throwable { - OutputAnalyzer output = null; - try { - JDKToolLauncher jcmdLauncher = JDKToolLauncher.create("jcmd"); - jcmdLauncher.addToolArg("-l"); - output = ProcessTools.executeProcess(jcmdLauncher.getCommand()); - output.shouldHaveExitValue(0); - - // Search for a line starting with numbers (pid), followed by the key. - Pattern pattern = Pattern.compile("^([0-9]+)\\s.*(" + key + ")", Pattern.MULTILINE); - Matcher matcher = pattern.matcher(output.getStdout()); - - int pid = -1; - if (matcher.find()) { - pid = Integer.parseInt(matcher.group(1)); - System.out.println("findJvmPid.pid: " + pid); - if (matcher.find()) { - throw new Exception("Found multiple JVM pids for key: " + key); - } - } - return pid; - } catch (Throwable t) { - System.out.println(String.format("Utils.findJvmPid(%s) failed: %s", key, t)); - throw t; - } - } - - /** - * Return the contents of the named file as a single String, - * or null if not found. - * @param filename name of the file to read - * @return String contents of file, or null if file not found. - * @throws IOException - * if an I/O error occurs reading from the file or a malformed or - * unmappable byte sequence is read - */ - public static String fileAsString(String filename) throws IOException { - Path filePath = Paths.get(filename); - if (!Files.exists(filePath)) return null; - return new String(Files.readAllBytes(filePath)); - } - - /** - * @return Unsafe instance. - */ - public static synchronized Unsafe getUnsafe() { - if (unsafe == null) { - try { - Field f = Unsafe.class.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe) f.get(null); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException("Unable to get Unsafe instance.", e); - } - } - return unsafe; - } - private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - - /** - * Returns hex view of byte array - * - * @param bytes byte array to process - * @return Space separated hexadecimal string representation of bytes - */ - - public static String toHexString(byte[] bytes) { - char[] hexView = new char[bytes.length * 3]; - int i = 0; - for (byte b : bytes) { - hexView[i++] = hexArray[(b >> 4) & 0x0F]; - hexView[i++] = hexArray[b & 0x0F]; - hexView[i++] = ' '; - } - return new String(hexView); - } - - /** - * Returns {@link java.util.Random} generator initialized with particular seed. - * The seed could be provided via system property {@link Utils#SEED_PROPERTY_NAME} - * In case no seed is provided, the method uses a random number. - * The used seed printed to stdout. - * @return {@link java.util.Random} generator with particular seed. - */ - public static Random getRandomInstance() { - if (RANDOM_GENERATOR == null) { - synchronized (Utils.class) { - if (RANDOM_GENERATOR == null) { - RANDOM_GENERATOR = new Random(SEED); - System.out.printf("For random generator using seed: %d%n", SEED); - System.out.printf("To re-run test with same seed value please add \"-D%s=%d\" to command line.%n", SEED_PROPERTY_NAME, SEED); - } - } - } - return RANDOM_GENERATOR; - } - - /** - * Returns random element of non empty collection - * - * @param a type of collection element - * @param collection collection of elements - * @return random element of collection - * @throws IllegalArgumentException if collection is empty - */ - public static T getRandomElement(Collection collection) - throws IllegalArgumentException { - if (collection.isEmpty()) { - throw new IllegalArgumentException("Empty collection"); - } - Random random = getRandomInstance(); - int elementIndex = 1 + random.nextInt(collection.size() - 1); - Iterator iterator = collection.iterator(); - while (--elementIndex != 0) { - iterator.next(); - } - return iterator.next(); - } - - /** - * Returns random element of non empty array - * - * @param a type of array element - * @param array array of elements - * @return random element of array - * @throws IllegalArgumentException if array is empty - */ - public static T getRandomElement(T[] array) - throws IllegalArgumentException { - if (array == null || array.length == 0) { - throw new IllegalArgumentException("Empty or null array"); - } - Random random = getRandomInstance(); - return array[random.nextInt(array.length)]; - } - - /** - * Wait for condition to be true - * - * @param condition, a condition to wait for - */ - public static final void waitForCondition(BooleanSupplier condition) { - waitForCondition(condition, -1L, 100L); - } - - /** - * Wait until timeout for condition to be true - * - * @param condition, a condition to wait for - * @param timeout a time in milliseconds to wait for condition to be true - * specifying -1 will wait forever - * @return condition value, to determine if wait was successful - */ - public static final boolean waitForCondition(BooleanSupplier condition, - long timeout) { - return waitForCondition(condition, timeout, 100L); - } - - /** - * Wait until timeout for condition to be true for specified time - * - * @param condition, a condition to wait for - * @param timeout a time in milliseconds to wait for condition to be true, - * specifying -1 will wait forever - * @param sleepTime a time to sleep value in milliseconds - * @return condition value, to determine if wait was successful - */ - public static final boolean waitForCondition(BooleanSupplier condition, - long timeout, long sleepTime) { - long startTime = System.currentTimeMillis(); - while (!(condition.getAsBoolean() || (timeout != -1L - && ((System.currentTimeMillis() - startTime) > timeout)))) { - try { - Thread.sleep(sleepTime); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new Error(e); - } - } - return condition.getAsBoolean(); - } - - /** - * Adjusts the provided timeout value for the TIMEOUT_FACTOR - * @param tOut the timeout value to be adjusted - * @return The timeout value adjusted for the value of "test.timeout.factor" - * system property - */ - public static long adjustTimeout(long tOut) { - return Math.round(tOut * Utils.TIMEOUT_FACTOR); - } - - /** - * Ensures a requested class is loaded - * @param aClass class to load - */ - public static void ensureClassIsLoaded(Class aClass) { - if (aClass == null) { - throw new Error("Requested null class"); - } - try { - Class.forName(aClass.getName(), /* initialize = */ true, - ClassLoader.getSystemClassLoader()); - } catch (ClassNotFoundException e) { - throw new Error("Class not found", e); - } - } - /** - * @param parent a class loader to be the parent for the returned one - * @return an UrlClassLoader with urls made of the 'test.class.path' jtreg - * property and with the given parent - */ - public static URLClassLoader getTestClassPathURLClassLoader(ClassLoader parent) { - URL[] urls = Arrays.stream(TEST_CLASS_PATH.split(File.pathSeparator)) - .map(Paths::get) - .map(Path::toUri) - .map(x -> { - try { - return x.toURL(); - } catch (MalformedURLException ex) { - throw new Error("Test issue. JTREG property" - + " 'test.class.path'" - + " is not defined correctly", ex); - } - }).toArray(URL[]::new); - return new URLClassLoader(urls, parent); - } - - /** - * Runs runnable and checks that it throws expected exception. If exceptionException is null it means - * that we expect no exception to be thrown. - * @param runnable what we run - * @param expectedException expected exception - */ - public static void runAndCheckException(Runnable runnable, Class expectedException) { - runAndCheckException(runnable, t -> { - if (t == null) { - if (expectedException != null) { - throw new AssertionError("Didn't get expected exception " + expectedException.getSimpleName()); - } - } else { - String message = "Got unexpected exception " + t.getClass().getSimpleName(); - if (expectedException == null) { - throw new AssertionError(message, t); - } else if (!expectedException.isAssignableFrom(t.getClass())) { - message += " instead of " + expectedException.getSimpleName(); - throw new AssertionError(message, t); - } - } - }); - } - - /** - * Runs runnable and makes some checks to ensure that it throws expected exception. - * @param runnable what we run - * @param checkException a consumer which checks that we got expected exception and raises a new exception otherwise - */ - public static void runAndCheckException(Runnable runnable, Consumer checkException) { - try { - runnable.run(); - checkException.accept(null); - } catch (Throwable t) { - checkException.accept(t); - } - } - - /** - * Converts to VM type signature - * - * @param type Java type to convert - * @return string representation of VM type - */ - public static String toJVMTypeSignature(Class type) { - if (type.isPrimitive()) { - if (type == boolean.class) { - return "Z"; - } else if (type == byte.class) { - return "B"; - } else if (type == char.class) { - return "C"; - } else if (type == double.class) { - return "D"; - } else if (type == float.class) { - return "F"; - } else if (type == int.class) { - return "I"; - } else if (type == long.class) { - return "J"; - } else if (type == short.class) { - return "S"; - } else if (type == void.class) { - return "V"; - } else { - throw new Error("Unsupported type: " + type); - } - } - String result = type.getName().replaceAll("\\.", "/"); - if (!type.isArray()) { - return "L" + result + ";"; - } - return result; - } - - public static Object[] getNullValues(Class... types) { - Object[] result = new Object[types.length]; - int i = 0; - for (Class type : types) { - result[i++] = NULL_VALUES.get(type); - } - return result; - } - private static Map, Object> NULL_VALUES = new HashMap<>(); - static { - NULL_VALUES.put(boolean.class, false); - NULL_VALUES.put(byte.class, (byte) 0); - NULL_VALUES.put(short.class, (short) 0); - NULL_VALUES.put(char.class, '\0'); - NULL_VALUES.put(int.class, 0); - NULL_VALUES.put(long.class, 0L); - NULL_VALUES.put(float.class, 0.0f); - NULL_VALUES.put(double.class, 0.0d); - } - - /** - * Returns mandatory property value - * @param propName is a name of property to request - * @return a String with requested property value - */ - public static String getMandatoryProperty(String propName) { - Objects.requireNonNull(propName, "Requested null property"); - String prop = System.getProperty(propName); - Objects.requireNonNull(prop, - String.format("A mandatory property '%s' isn't set", propName)); - return prop; - } -} - diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java b/hotspot/test/testlibrary/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java deleted file mode 100644 index 328d91fddb1..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli; - -import jdk.test.lib.cli.predicate.CPUSpecificPredicate; - -/** - * Base class for command line options tests that - * requires specific CPU arch or specific CPU features. - */ -public abstract class CPUSpecificCommandLineOptionTest - extends CommandLineOptionTest { - /** - * Creates new CPU specific test instance that does not - * require any CPU features. - * - * @param cpuArchPattern Regular expression that should - * match os.arch. - */ - public CPUSpecificCommandLineOptionTest(String cpuArchPattern) { - this(cpuArchPattern, null, null); - } - - /** - * Creates new CPU specific test instance that does not - * require from CPU support of {@code supportedCPUFeatures} features - * and no support of {@code unsupportedCPUFeatures}. - * - * @param cpuArchPattern Regular expression that should - * match os.arch. - * @param supportedCPUFeatures Array with names of features that - * should be supported by CPU. If {@code null}, - * then no features have to be supported. - * @param unsupportedCPUFeatures Array with names of features that - * should not be supported by CPU. - * If {@code null}, then CPU may support any - * features. - */ - public CPUSpecificCommandLineOptionTest(String cpuArchPattern, - String supportedCPUFeatures[], String unsupportedCPUFeatures[]) { - super(new CPUSpecificPredicate(cpuArchPattern, supportedCPUFeatures, - unsupportedCPUFeatures)); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java deleted file mode 100644 index 5fd3326c173..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli; - -import java.util.List; -import java.util.ArrayList; -import java.util.Collections; -import java.util.function.BooleanSupplier; - -import jdk.test.lib.*; - -/** - * Base class for command line option tests. - */ -public abstract class CommandLineOptionTest { - public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS - = "-XX:+UnlockDiagnosticVMOptions"; - public static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS - = "-XX:+UnlockExperimentalVMOptions"; - protected static final String UNRECOGNIZED_OPTION_ERROR_FORMAT - = "Unrecognized VM option '[+-]?%s(=.*)?'"; - protected static final String EXPERIMENTAL_OPTION_ERROR_FORMAT - = "VM option '%s' is experimental and must be enabled via " - + "-XX:\\+UnlockExperimentalVMOptions."; - protected static final String DIAGNOSTIC_OPTION_ERROR_FORMAT - = " VM option '%s' is diagnostic and must be enabled via " - + "-XX:\\+UnlockDiagnosticVMOptions."; - private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s"; - - /** - * Verifies that JVM startup behavior matches our expectations. - * - * @param option an option that should be passed to JVM - * @param expectedMessages an array of patterns that should occur - * in JVM output. If {@code null} then - * JVM output could be empty. - * @param unexpectedMessages an array of patterns that should not - * occur in JVM output. If {@code null} then - * JVM output could be empty. - * @param exitErrorMessage message that will be shown if exit code is not - * as expected. - * @param wrongWarningMessage message that will be shown if warning - * messages are not as expected. - * @param exitCode expected exit code. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyJVMStartup(String option, - String expectedMessages[], String unexpectedMessages[], - String exitErrorMessage, String wrongWarningMessage, - ExitCode exitCode) throws Throwable { - CommandLineOptionTest.verifyJVMStartup(expectedMessages, - unexpectedMessages, exitErrorMessage, - wrongWarningMessage, exitCode, false, option); - } - - /** - * Verifies that JVM startup behavior matches our expectations. - * - * @param expectedMessages an array of patterns that should occur - * in JVM output. If {@code null} then - * JVM output could be empty. - * @param unexpectedMessages an array of patterns that should not - * occur in JVM output. If {@code null} then - * JVM output could be empty. - * @param exitErrorMessage message that will be shown if exit code is not - * as expected. - * @param wrongWarningMessage message that will be shown if warning - * messages are not as expected. - * @param exitCode expected exit code. - * @param addTestVMOptions if {@code true} then test VM options will be - * passed to VM. - * @param options options that should be passed to VM in addition to mode - * flag. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyJVMStartup(String expectedMessages[], - String unexpectedMessages[], String exitErrorMessage, - String wrongWarningMessage, ExitCode exitCode, - boolean addTestVMOptions, String... options) - throws Throwable { - List finalOptions = new ArrayList<>(); - if (addTestVMOptions) { - Collections.addAll(finalOptions, ProcessTools.getVmInputArgs()); - Collections.addAll(finalOptions, Utils.getTestJavaOpts()); - } - Collections.addAll(finalOptions, options); - finalOptions.add("-version"); - - ProcessBuilder processBuilder - = ProcessTools.createJavaProcessBuilder(finalOptions.toArray( - new String[finalOptions.size()])); - OutputAnalyzer outputAnalyzer - = new OutputAnalyzer(processBuilder.start()); - - try { - outputAnalyzer.shouldHaveExitValue(exitCode.value); - } catch (RuntimeException e) { - String errorMessage = String.format( - "JVM process should have exit value '%d'.%n%s", - exitCode.value, exitErrorMessage); - throw new AssertionError(errorMessage, e); - } - - verifyOutput(expectedMessages, unexpectedMessages, - wrongWarningMessage, outputAnalyzer); - } - - /** - * Verifies that JVM startup behavior matches our expectations. - * - * @param expectedMessages an array of patterns that should occur in JVM - * output. If {@code null} then - * JVM output could be empty. - * @param unexpectedMessages an array of patterns that should not occur - * in JVM output. If {@code null} then - * JVM output could be empty. - * @param wrongWarningMessage message that will be shown if messages are - * not as expected. - * @param outputAnalyzer OutputAnalyzer instance - * @throws AssertionError if verification fails. - */ - public static void verifyOutput(String[] expectedMessages, - String[] unexpectedMessages, String wrongWarningMessage, - OutputAnalyzer outputAnalyzer) { - if (expectedMessages != null) { - for (String expectedMessage : expectedMessages) { - try { - outputAnalyzer.shouldMatch(expectedMessage); - } catch (RuntimeException e) { - String errorMessage = String.format( - "Expected message not found: '%s'.%n%s", - expectedMessage, wrongWarningMessage); - throw new AssertionError(errorMessage, e); - } - } - } - - if (unexpectedMessages != null) { - for (String unexpectedMessage : unexpectedMessages) { - try { - outputAnalyzer.shouldNotMatch(unexpectedMessage); - } catch (RuntimeException e) { - String errorMessage = String.format( - "Unexpected message found: '%s'.%n%s", - unexpectedMessage, wrongWarningMessage); - throw new AssertionError(errorMessage, e); - } - } - } - } - - /** - * Verifies that JVM startup behavior matches our expectations when type - * of newly started VM is the same as the type of current. - * - * @param expectedMessages an array of patterns that should occur - * in JVM output. If {@code null} then - * JVM output could be empty. - * @param unexpectedMessages an array of patterns that should not - * occur in JVM output. If {@code null} then - * JVM output could be empty. - * @param exitErrorMessage Message that will be shown if exit value is not - * as expected. - * @param wrongWarningMessage message that will be shown if warning - * messages are not as expected. - * @param exitCode expected exit code. - * @param options options that should be passed to VM in addition to mode - * flag. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifySameJVMStartup(String expectedMessages[], - String unexpectedMessages[], String exitErrorMessage, - String wrongWarningMessage, ExitCode exitCode, String... options) - throws Throwable { - List finalOptions = new ArrayList<>(); - finalOptions.add(CommandLineOptionTest.getVMTypeOption()); - Collections.addAll(finalOptions, options); - - CommandLineOptionTest.verifyJVMStartup(expectedMessages, - unexpectedMessages, exitErrorMessage, - wrongWarningMessage, exitCode, false, - finalOptions.toArray(new String[finalOptions.size()])); - } - - /** - * Verifies that value of specified JVM option is the same as - * expected value. - * This method filter out option with {@code optionName} - * name from test java options. - * - * @param optionName a name of tested option. - * @param expectedValue expected value of tested option. - * @param optionErrorString message will be shown if option value is not as - * expected. - * @param additionalVMOpts additional options that should be - * passed to JVM. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyOptionValue(String optionName, - String expectedValue, String optionErrorString, - String... additionalVMOpts) throws Throwable { - verifyOptionValue(optionName, expectedValue, optionErrorString, - true, additionalVMOpts); - } - - /** - * Verifies that value of specified JVM option is the same as - * expected value. - * This method filter out option with {@code optionName} - * name from test java options. - * - * @param optionName a name of tested option. - * @param expectedValue expected value of tested option. - * @param addTestVmOptions if {@code true}, then test VM options - * will be used. - * @param optionErrorString message will be shown if option value is not as - * expected. - * @param additionalVMOpts additional options that should be - * passed to JVM. - * @throws Throwable if verification fails or some other issues - * occur. - */ - public static void verifyOptionValue(String optionName, - String expectedValue, String optionErrorString, - boolean addTestVmOptions, String... additionalVMOpts) - throws Throwable { - List vmOpts = new ArrayList<>(); - - if (addTestVmOptions) { - Collections.addAll(vmOpts, - Utils.getFilteredTestJavaOpts(optionName)); - } - Collections.addAll(vmOpts, additionalVMOpts); - Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version"); - - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( - vmOpts.toArray(new String[vmOpts.size()])); - - OutputAnalyzer outputAnalyzer - = new OutputAnalyzer(processBuilder.start()); - - try { - outputAnalyzer.shouldHaveExitValue(0); - } catch (RuntimeException e) { - String errorMessage = String.format( - "JVM should start with option '%s' without errors.", - optionName); - throw new AssertionError(errorMessage, e); - } - verifyOptionValue(optionName, expectedValue, optionErrorString, - outputAnalyzer); - } - - /** - * Verifies that value of specified JVM option is the same as - * expected value. - * - * @param optionName a name of tested option. - * @param expectedValue expected value of tested option. - * @param optionErrorString message will be shown if option value is not - * as expected. - * @param outputAnalyzer OutputAnalyzer instance - * @throws AssertionError if verification fails - */ - public static void verifyOptionValue(String optionName, - String expectedValue, String optionErrorString, - OutputAnalyzer outputAnalyzer) { - try { - outputAnalyzer.shouldMatch(String.format( - CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, - optionName, expectedValue)); - } catch (RuntimeException e) { - String errorMessage = String.format( - "Option '%s' is expected to have '%s' value%n%s", - optionName, expectedValue, - optionErrorString); - throw new AssertionError(errorMessage, e); - } - } - - /** - * Start VM with given options and values. - * Generates command line option flags from - * {@code optionNames} and {@code optionValues}. - * - * @param optionNames names of options to pass in - * @param optionValues values of option - * @param additionalVMOpts additional options that should be - * passed to JVM. - * @return output from vm process - */ - public static OutputAnalyzer startVMWithOptions(String[] optionNames, - String[] optionValues, - String... additionalVMOpts) throws Throwable { - List vmOpts = new ArrayList<>(); - if (optionNames == null || optionValues == null || optionNames.length != optionValues.length) { - throw new IllegalArgumentException("optionNames and/or optionValues"); - } - - for (int i = 0; i < optionNames.length; i++) { - vmOpts.add(prepareFlag(optionNames[i], optionValues[i])); - } - Collections.addAll(vmOpts, additionalVMOpts); - Collections.addAll(vmOpts, "-version"); - - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( - vmOpts.toArray(new String[vmOpts.size()])); - - return new OutputAnalyzer(processBuilder.start()); - } - - /** - * Verifies from the output that values of specified JVM options were the same as - * expected values. - * - * @param outputAnalyzer search output for expect options and values. - * @param optionNames names of tested options. - * @param expectedValues expected values of tested options. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyOptionValuesFromOutput(OutputAnalyzer outputAnalyzer, - String[] optionNames, - String[] expectedValues) throws Throwable { - outputAnalyzer.shouldHaveExitValue(0); - for (int i = 0; i < optionNames.length; i++) { - outputAnalyzer.shouldMatch(String.format( - CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, - optionNames[i], expectedValues[i])); - } - } - - /** - * Verifies that value of specified JVM options are the same as - * expected values. - * Generates command line option flags from - * {@code optionNames} and {@code expectedValues}. - * - * @param optionNames names of tested options. - * @param expectedValues expected values of tested options. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyOptionValues(String[] optionNames, - String[] expectedValues) throws Throwable { - OutputAnalyzer outputAnalyzer = startVMWithOptions(optionNames, expectedValues, "-XX:+PrintFlagsFinal"); - verifyOptionValuesFromOutput(outputAnalyzer, optionNames, expectedValues); - } - - /** - * Verifies that value of specified JVM when type of newly started VM - * is the same as the type of current. - * This method filter out option with {@code optionName} - * name from test java options. - * Only mode flag will be passed to VM in addition to - * {@code additionalVMOpts} - * - * @param optionName name of tested option. - * @param expectedValue expected value of tested option. - * @param optionErrorString message to show if option has another value - * @param additionalVMOpts additional options that should be - * passed to JVM. - * @throws Throwable if verification fails or some other issues occur. - */ - public static void verifyOptionValueForSameVM(String optionName, - String expectedValue, String optionErrorString, - String... additionalVMOpts) throws Throwable { - List finalOptions = new ArrayList<>(); - finalOptions.add(CommandLineOptionTest.getVMTypeOption()); - Collections.addAll(finalOptions, additionalVMOpts); - - CommandLineOptionTest.verifyOptionValue(optionName, expectedValue, - optionErrorString, false, - finalOptions.toArray(new String[finalOptions.size()])); - } - - /** - * Prepares boolean command line flag with name {@code name} according - * to it's {@code value}. - * - * @param name the name of option to be prepared - * @param value the value of option - * @return prepared command line flag - */ - public static String prepareBooleanFlag(String name, boolean value) { - return String.format("-XX:%c%s", (value ? '+' : '-'), name); - } - - /** - * Prepares numeric command line flag with name {@code name} by setting - * it's value to {@code value}. - * - * @param name the name of option to be prepared - * @param value the value of option - * @return prepared command line flag - */ - public static String prepareNumericFlag(String name, Number value) { - return String.format("-XX:%s=%s", name, value.toString()); - } - - /** - * Prepares generic command line flag with name {@code name} by setting - * it's value to {@code value}. - * - * @param name the name of option to be prepared - * @param value the value of option ("+" or "-" can be used instead of "true" or "false") - * @return prepared command line flag - */ - public static String prepareFlag(String name, String value) { - if (value.equals("+") || value.equalsIgnoreCase("true")) { - return "-XX:+" + name; - } else if (value.equals("-") || value.equalsIgnoreCase("false")) { - return "-XX:-" + name; - } else { - return "-XX:" + name + "=" + value; - } - } - - /** - * Returns message that should occur in VM output if option - * {@code optionName} if unrecognized. - * - * @param optionName the name of option for which message should be returned - * @return message saying that option {@code optionName} is unrecognized - */ - public static String getUnrecognizedOptionErrorMessage(String optionName) { - return String.format( - CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT, - optionName); - } - - /** - * Returns message that should occur in VM output if option - * {@code optionName} is experimental and - * -XX:+UnlockExperimentalVMOptions was not passed to VM. - * - * @param optionName the name of option for which message should be returned - * @return message saying that option {@code optionName} is experimental - */ - public static String getExperimentalOptionErrorMessage(String optionName) { - return String.format( - CommandLineOptionTest.EXPERIMENTAL_OPTION_ERROR_FORMAT, - optionName); - } - - /** - * Returns message that should occur in VM output if option - * {@code optionName} is diagnostic and -XX:+UnlockDiagnosticVMOptions - * was not passed to VM. - * - * @param optionName the name of option for which message should be returned - * @return message saying that option {@code optionName} is diganostic - */ - public static String getDiagnosticOptionErrorMessage(String optionName) { - return String.format( - CommandLineOptionTest.DIAGNOSTIC_OPTION_ERROR_FORMAT, - optionName); - } - - /** - * @return option required to start a new VM with the same type as current. - * @throws RuntimeException when VM type is unknown. - */ - private static String getVMTypeOption() { - if (Platform.isServer()) { - return "-server"; - } else if (Platform.isClient()) { - return "-client"; - } else if (Platform.isMinimal()) { - return "-minimal"; - } else if (Platform.isGraal()) { - return "-graal"; - } - throw new RuntimeException("Unknown VM mode."); - } - - private final BooleanSupplier predicate; - - /** - * Constructs new CommandLineOptionTest that will be executed only if - * predicate {@code predicate} return {@code true}. - * @param predicate a predicate responsible for test's preconditions check. - */ - public CommandLineOptionTest(BooleanSupplier predicate) { - this.predicate = predicate; - } - - /** - * Runs command line option test. - */ - public final void test() throws Throwable { - if (predicate.getAsBoolean()) { - runTestCases(); - } - } - - /** - * @throws Throwable if some issue happened during test cases execution. - */ - protected abstract void runTestCases() throws Throwable; -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/AndPredicate.java b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/AndPredicate.java deleted file mode 100644 index 5081c3219cd..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/AndPredicate.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli.predicate; - -import java.util.function.BooleanSupplier; - -public class AndPredicate implements BooleanSupplier { - private final BooleanSupplier a; - private final BooleanSupplier b; - - public AndPredicate(BooleanSupplier a, BooleanSupplier b) { - this.a = a; - this.b = b; - } - - @Override - public boolean getAsBoolean() { - return a.getAsBoolean() && b.getAsBoolean(); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java deleted file mode 100644 index 228c0270a5b..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli.predicate; - -import jdk.test.lib.Platform; -import sun.hotspot.cpuinfo.CPUInfo; - -import java.util.function.BooleanSupplier; - -public class CPUSpecificPredicate implements BooleanSupplier { - private final String cpuArchPattern; - private final String supportedCPUFeatures[]; - private final String unsupportedCPUFeatures[]; - - public CPUSpecificPredicate(String cpuArchPattern, - String supportedCPUFeatures[], - String unsupportedCPUFeatures[]) { - this.cpuArchPattern = cpuArchPattern; - this.supportedCPUFeatures = supportedCPUFeatures; - this.unsupportedCPUFeatures = unsupportedCPUFeatures; - } - - @Override - public boolean getAsBoolean() { - if (!Platform.getOsArch().matches(cpuArchPattern)) { - System.out.println("CPU arch " + Platform.getOsArch() + " does not match " + cpuArchPattern); - return false; - } - - if (supportedCPUFeatures != null) { - for (String feature : supportedCPUFeatures) { - if (!CPUInfo.hasFeature(feature)) { - System.out.println("CPU does not support " + feature - + " feature"); - return false; - } - } - } - - if (unsupportedCPUFeatures != null) { - for (String feature : unsupportedCPUFeatures) { - if (CPUInfo.hasFeature(feature)) { - System.out.println("CPU support " + feature + " feature"); - return false; - } - } - } - return true; - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/NotPredicate.java b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/NotPredicate.java deleted file mode 100644 index 846ee0a6273..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/NotPredicate.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli.predicate; - -import java.util.function.BooleanSupplier; - -public class NotPredicate implements BooleanSupplier { - private final BooleanSupplier s; - - public NotPredicate(BooleanSupplier s) { - this.s = s; - } - - @Override - public boolean getAsBoolean() { - return !s.getAsBoolean(); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/OrPredicate.java b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/OrPredicate.java deleted file mode 100644 index 134eaa6eb80..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/OrPredicate.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 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 jdk.test.lib.cli.predicate; - -import java.util.function.BooleanSupplier; - -public class OrPredicate implements BooleanSupplier { - private final BooleanSupplier a; - private final BooleanSupplier b; - - public OrPredicate(BooleanSupplier a, BooleanSupplier b) { - this.a = a; - this.b = b; - } - - @Override - public boolean getAsBoolean() { - return a.getAsBoolean() || b.getAsBoolean(); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutor.java deleted file mode 100644 index dfae041585a..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import jdk.test.lib.OutputAnalyzer; - -/** - * Abstract base class for Diagnostic Command executors - */ -public abstract class CommandExecutor { - - /** - * Execute a diagnostic command - * - * @param cmd The diagnostic command to execute - * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command - * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the - * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in - * stderr, regardless of the specific executor used. - */ - public final OutputAnalyzer execute(String cmd) throws CommandExecutorException { - return execute(cmd, false); - } - - /** - * Execute a diagnostic command - * - * @param cmd The diagnostic command to execute - * @param silent Do not print the command output - * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command - * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the - * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in - * stderr, regardless of the specific executor used. - */ - public final OutputAnalyzer execute(String cmd, boolean silent) throws CommandExecutorException { - if (!silent) { - System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName()); - } - - OutputAnalyzer oa = executeImpl(cmd); - - if (!silent) { - System.out.println("---------------- stdout ----------------"); - System.out.println(oa.getStdout()); - System.out.println("---------------- stderr ----------------"); - System.out.println(oa.getStderr()); - System.out.println("----------------------------------------"); - System.out.println(); - } - return oa; - } - - protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException; -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutorException.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutorException.java deleted file mode 100644 index 8737e56584d..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutorException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -/** - * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic - * Commands - */ -public class CommandExecutorException extends RuntimeException { - private static final long serialVersionUID = -7039597746579144280L; - - public CommandExecutorException(String message, Throwable e) { - super(message, e); - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/FileJcmdExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/FileJcmdExecutor.java deleted file mode 100644 index 17ffd91b761..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/FileJcmdExecutor.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.List; - -/** - * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read - * Diagnostic Commands from a file. - */ -public class FileJcmdExecutor extends PidJcmdExecutor { - - /** - * Instantiates a new FileJcmdExecutor targeting the current VM - */ - public FileJcmdExecutor() { - super(); - } - - /** - * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid - * - * @param target Pid of the target VM - */ - public FileJcmdExecutor(String target) { - super(target); - } - - protected List createCommandLine(String cmd) throws CommandExecutorException { - File cmdFile = createTempFile(); - writeCommandToTemporaryFile(cmd, cmdFile); - - return Arrays.asList(jcmdBinary, Long.toString(pid), - "-f", cmdFile.getAbsolutePath()); - } - - private void writeCommandToTemporaryFile(String cmd, File cmdFile) { - try (PrintWriter pw = new PrintWriter(cmdFile)) { - pw.println(cmd); - } catch (IOException e) { - String message = "Could not write to file: " + cmdFile.getAbsolutePath(); - throw new CommandExecutorException(message, e); - } - } - - private File createTempFile() { - try { - File cmdFile = File.createTempFile("input", "jcmd"); - cmdFile.deleteOnExit(); - return cmdFile; - } catch (IOException e) { - throw new CommandExecutorException("Could not create temporary file", e); - } - } - -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/JMXExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/JMXExecutor.java deleted file mode 100644 index f0a8d3f0251..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/JMXExecutor.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import jdk.test.lib.OutputAnalyzer; - -import javax.management.*; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; - -import java.lang.management.ManagementFactory; - -import java.util.HashMap; - -/** - * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using - * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand. - */ -public class JMXExecutor extends CommandExecutor { - - private final MBeanServerConnection mbs; - - /** - * Instantiates a new JMXExecutor targeting the current VM - */ - public JMXExecutor() { - super(); - mbs = ManagementFactory.getPlatformMBeanServer(); - } - - /** - * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX - * Service URL - * - * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM - */ - public JMXExecutor(String target) { - String urlStr; - - if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) { - /* Matches "hostname:port" */ - urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target); - } else if (target.startsWith("service:")) { - urlStr = target; - } else { - throw new IllegalArgumentException("Could not recognize target string: " + target); - } - - try { - JMXServiceURL url = new JMXServiceURL(urlStr); - JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>()); - mbs = c.getMBeanServerConnection(); - } catch (IOException e) { - throw new CommandExecutorException("Could not initiate connection to target: " + target, e); - } - } - - protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException { - String stdout = ""; - String stderr = ""; - - String[] cmdParts = cmd.split(" ", 2); - String operation = commandToMethodName(cmdParts[0]); - Object[] dcmdArgs = produceArguments(cmdParts); - String[] signature = {String[].class.getName()}; - - ObjectName beanName = getMBeanName(); - - try { - stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature); - } - - /* Failures on the "local" side, the one invoking the command. */ - catch (ReflectionException e) { - Throwable cause = e.getCause(); - if (cause instanceof NoSuchMethodException) { - /* We want JMXExecutor to match the behavior of the other CommandExecutors */ - String message = "Unknown diagnostic command: " + operation; - stderr = exceptionTraceAsString(new IllegalArgumentException(message, e)); - } else { - rethrowExecutorException(operation, dcmdArgs, e); - } - } - - /* Failures on the "local" side, the one invoking the command. */ - catch (InstanceNotFoundException | IOException e) { - rethrowExecutorException(operation, dcmdArgs, e); - } - - /* Failures on the remote side, the one executing the invoked command. */ - catch (MBeanException e) { - stdout = exceptionTraceAsString(e); - } - - return new OutputAnalyzer(stdout, stderr); - } - - private void rethrowExecutorException(String operation, Object[] dcmdArgs, - Exception e) throws CommandExecutorException { - String message = String.format("Could not invoke: %s %s", operation, - String.join(" ", (String[]) dcmdArgs[0])); - throw new CommandExecutorException(message, e); - } - - private ObjectName getMBeanName() throws CommandExecutorException { - String MBeanName = "com.sun.management:type=DiagnosticCommand"; - - try { - return new ObjectName(MBeanName); - } catch (MalformedObjectNameException e) { - String message = "MBean not found: " + MBeanName; - throw new CommandExecutorException(message, e); - } - } - - private Object[] produceArguments(String[] cmdParts) { - Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */ - - if (cmdParts.length == 2) { - dcmdArgs[0] = cmdParts[1].split(" "); - } - return dcmdArgs; - } - - /** - * Convert from diagnostic command to MBean method name - * - * Examples: - * help --> help - * VM.version --> vmVersion - * VM.command_line --> vmCommandLine - */ - private static String commandToMethodName(String cmd) { - String operation = ""; - boolean up = false; /* First letter is to be lower case */ - - /* - * If a '.' or '_' is encountered it is not copied, - * instead the next character will be converted to upper case - */ - for (char c : cmd.toCharArray()) { - if (('.' == c) || ('_' == c)) { - up = true; - } else if (up) { - operation = operation.concat(Character.toString(c).toUpperCase()); - up = false; - } else { - operation = operation.concat(Character.toString(c).toLowerCase()); - } - } - - return operation; - } - - private static String exceptionTraceAsString(Throwable cause) { - StringWriter sw = new StringWriter(); - cause.printStackTrace(new PrintWriter(sw)); - return sw.toString(); - } - -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/JcmdExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/JcmdExecutor.java deleted file mode 100644 index ad593644389..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/JcmdExecutor.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; - -import java.util.List; - -/** - * Base class for Diagnostic Command Executors using the jcmd tool - */ -public abstract class JcmdExecutor extends CommandExecutor { - protected String jcmdBinary; - - protected abstract List createCommandLine(String cmd) throws CommandExecutorException; - - protected JcmdExecutor() { - jcmdBinary = JDKToolFinder.getJDKTool("jcmd"); - } - - protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException { - List commandLine = createCommandLine(cmd); - - try { - System.out.printf("Executing command '%s'%n", commandLine); - OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine)); - System.out.printf("Command returned with exit code %d%n", output.getExitValue()); - - return output; - } catch (Exception e) { - String message = String.format("Caught exception while executing '%s'", commandLine); - throw new CommandExecutorException(message, e); - } - } -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/MainClassJcmdExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/MainClassJcmdExecutor.java deleted file mode 100644 index d651b60009b..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/MainClassJcmdExecutor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import java.util.Arrays; -import java.util.List; - -/** - * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool - */ -public class MainClassJcmdExecutor extends JcmdExecutor { - private final String mainClass; - - /** - * Instantiates a new MainClassJcmdExecutor targeting the current VM - */ - public MainClassJcmdExecutor() { - super(); - mainClass = System.getProperty("sun.java.command").split(" ")[0]; - } - - /** - * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class - * - * @param target Main class of the target VM - */ - public MainClassJcmdExecutor(String target) { - super(); - mainClass = target; - } - - protected List createCommandLine(String cmd) throws CommandExecutorException { - return Arrays.asList(jcmdBinary, mainClass, cmd); - } - -} diff --git a/hotspot/test/testlibrary/jdk/test/lib/dcmd/PidJcmdExecutor.java b/hotspot/test/testlibrary/jdk/test/lib/dcmd/PidJcmdExecutor.java deleted file mode 100644 index f1caddb8b16..00000000000 --- a/hotspot/test/testlibrary/jdk/test/lib/dcmd/PidJcmdExecutor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2015, 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 jdk.test.lib.dcmd; - -import jdk.test.lib.ProcessTools; - -import java.util.Arrays; -import java.util.List; - -/** - * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool - */ -public class PidJcmdExecutor extends JcmdExecutor { - protected final long pid; - - /** - * Instantiates a new PidJcmdExecutor targeting the current VM - */ - public PidJcmdExecutor() { - super(); - try { - pid = ProcessTools.getProcessId(); - } catch (Exception e) { - throw new CommandExecutorException("Could not determine own pid", e); - } - } - - /** - * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid - * - * @param target Pid of the target VM - */ - public PidJcmdExecutor(String target) { - super(); - pid = Long.valueOf(target); - } - - protected List createCommandLine(String cmd) throws CommandExecutorException { - return Arrays.asList(jcmdBinary, Long.toString(pid), cmd); - } - -} diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java index 334911c3a03..866c485e895 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.factories.IRNodeBuilder; import jdk.test.lib.jittester.types.TypeKlass; import jdk.test.lib.jittester.utils.FixedTrees; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/AssignmentOperatorImplFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/AssignmentOperatorImplFactory.java index 719a1794f5a..2db4018d120 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/AssignmentOperatorImplFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/AssignmentOperatorImplFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryArithmeticOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryArithmeticOperatorFactory.java index a6d12a83daa..2d2dc81dc53 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryArithmeticOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryArithmeticOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BuiltInType; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryBitwiseOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryBitwiseOperatorFactory.java index 3925db13ae9..183995c169f 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryBitwiseOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryBitwiseOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Type; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryComparisonOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryComparisonOperatorFactory.java index d7250bd620e..3787ac3f9ae 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryComparisonOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryComparisonOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Type; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryEqualityOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryEqualityOperatorFactory.java index 2ad173533d7..19bf9125086 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryEqualityOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryEqualityOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Type; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryLogicOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryLogicOperatorFactory.java index cb6477f6839..9bbe91a68bc 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryLogicOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryLogicOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryOperatorFactory.java index 73f0e41ca78..613d5f83306 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryShiftOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryShiftOperatorFactory.java index 5f185003df2..66e13701dd2 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryShiftOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryShiftOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Type; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryStringPlusFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryStringPlusFactory.java index b7a5808aec7..55045ba1acf 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryStringPlusFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/BinaryStringPlusFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Type; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundArithmeticAssignmentOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundArithmeticAssignmentOperatorFactory.java index f8e00582d6c..16f835aac3e 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundArithmeticAssignmentOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundArithmeticAssignmentOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundBitwiseAssignmentOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundBitwiseAssignmentOperatorFactory.java index f87b495970f..73fabc71874 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundBitwiseAssignmentOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundBitwiseAssignmentOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundShiftAssignmentOperatorFactory.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundShiftAssignmentOperatorFactory.java index f534df8d2c3..07cfacde334 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundShiftAssignmentOperatorFactory.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CompoundShiftAssignmentOperatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -23,7 +23,7 @@ package jdk.test.lib.jittester.factories; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.IRNode; import jdk.test.lib.jittester.OperatorKind; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java index 72613da0049..651f6739726 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,8 +24,8 @@ package jdk.test.lib.jittester.jtreg; import jdk.test.lib.Asserts; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import java.io.IOException; import java.nio.file.Files; diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java index 8d5b11d1da9..a333f6209f6 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java @@ -39,7 +39,7 @@ import jdk.internal.org.objectweb.asm.FieldVisitor; import jdk.internal.org.objectweb.asm.Label; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.test.lib.Pair; +import jdk.test.lib.util.Pair; import jdk.test.lib.jittester.BinaryOperator; import jdk.test.lib.jittester.Block; import jdk.test.lib.jittester.BuiltInType; diff --git a/hotspot/test/testlibrary_tests/AssertsTest.java b/hotspot/test/testlibrary_tests/AssertsTest.java index 449126cb31e..fd0ca96c270 100644 --- a/hotspot/test/testlibrary_tests/AssertsTest.java +++ b/hotspot/test/testlibrary_tests/AssertsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ import static jdk.test.lib.Asserts.*; /* @test * @summary Tests the different assertions in the Assert class * @modules java.base/jdk.internal.misc - * @library /testlibrary + * @library /test/lib */ public class AssertsTest { private static class Foo implements Comparable { diff --git a/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java index d708ebb829a..c8abc6f50f1 100644 --- a/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java +++ b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,7 +27,7 @@ * @summary Test the OutputAnalyzer reporting functionality, * such as printing additional diagnostic info * (exit code, stdout, stderr, command line, etc.) - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ @@ -35,8 +35,8 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; public class OutputAnalyzerReportingTest { diff --git a/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java index 7f64529610b..6faedf4a8c5 100644 --- a/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java +++ b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -24,12 +24,12 @@ /* * @test * @summary Test the OutputAnalyzer utility class - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; public class OutputAnalyzerTest { diff --git a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java index f242d2f7d28..9f4ea33e66d 100644 --- a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java +++ b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ /* * @test * @summary Verify correctnes of the random generator from Utility.java - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run driver RandomGeneratorTest SAME_SEED @@ -38,8 +38,8 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.Random; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; /** diff --git a/hotspot/test/testlibrary_tests/RedefineClassTest.java b/hotspot/test/testlibrary_tests/RedefineClassTest.java index 739352a815e..63f30055d10 100644 --- a/hotspot/test/testlibrary_tests/RedefineClassTest.java +++ b/hotspot/test/testlibrary_tests/RedefineClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,19 +23,17 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @summary Proof of concept test for RedefineClassHelper * @modules java.base/jdk.internal.misc * @modules java.compiler * java.instrument * jdk.jartool/sun.tools.jar - * @build RedefineClassHelper * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar RedefineClassTest */ import static jdk.test.lib.Asserts.*; -import jdk.test.lib.*; /* * Proof of concept test for the test utility class RedefineClassHelper diff --git a/hotspot/test/testlibrary_tests/SimpleClassFileLoadHookTest.java b/hotspot/test/testlibrary_tests/SimpleClassFileLoadHookTest.java index d81d6d0ea6c..0da025a8112 100644 --- a/hotspot/test/testlibrary_tests/SimpleClassFileLoadHookTest.java +++ b/hotspot/test/testlibrary_tests/SimpleClassFileLoadHookTest.java @@ -23,7 +23,7 @@ /* * @test - * @library /testlibrary + * @library /test/lib * @requires vm.flavor != "minimal" * @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY * SimpleClassFileLoadHookTest diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java index 98cf13b1dbf..399535944f6 100644 --- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java @@ -38,7 +38,7 @@ import java.util.Set; * @summary Verify that for each group of mutually exclusive predicates defined * in jdk.test.lib.Platform one and only one predicate * evaluates to true. - * @library /testlibrary + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * @run main TestMutuallyExclusivePlatformPredicates @@ -48,7 +48,7 @@ public class TestMutuallyExclusivePlatformPredicates { ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64", "isAArch64"), BITNESS("is32bit", "is64bit"), OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"), - VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero"), + VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero", "isEmbedded"), MODE("isInt", "isMixed", "isComp"), IGNORED("isDebugBuild", "shouldSAAttach", "canPtraceAttachLinux", "canAttachOSX", "isTieredSupported"); diff --git a/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java b/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java index c9a5beabbcb..b5172689052 100644 --- a/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java +++ b/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,10 +28,10 @@ import sun.hotspot.WhiteBox; /** * @test * @summary Verifies that Platform::isTieredSupported returns correct value. - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management - * @build TestPlatformIsTieredSupported + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java index eb29c5bfb58..31f24081fa1 100644 --- a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java +++ b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java @@ -24,12 +24,12 @@ /* * @test * @bug 8012447 - * @library /testlibrary /test/lib /testlibrary/ctw/src + * @library /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.management - * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar + * @build sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main ClassesDirTest prepare diff --git a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java index 873180c5300..c2823de598c 100644 --- a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java +++ b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java @@ -24,12 +24,12 @@ /* * @test * @bug 8012447 - * @library /testlibrary /test/lib /testlibrary/ctw/src + * @library /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.management - * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar + * @build sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main ClassesListTest prepare diff --git a/hotspot/test/testlibrary_tests/ctw/CtwTest.java b/hotspot/test/testlibrary_tests/ctw/CtwTest.java index 3e62a058519..06b16b631b9 100644 --- a/hotspot/test/testlibrary_tests/ctw/CtwTest.java +++ b/hotspot/test/testlibrary_tests/ctw/CtwTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -37,7 +37,7 @@ import java.nio.file.StandardCopyOption; import java.nio.charset.Charset; import jdk.test.lib.JDKToolFinder; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; public abstract class CtwTest { protected final String[] shouldContain; diff --git a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java index 57f12a6c4b5..a784bda84ad 100644 --- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java +++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java @@ -24,14 +24,14 @@ /* * @test * @bug 8012447 - * @library /testlibrary /test/lib /testlibrary/ctw/src + * @library /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar + * @build sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main JarDirTest prepare @@ -45,7 +45,7 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; public class JarDirTest extends CtwTest { private static final String[] SHOULD_CONTAIN diff --git a/hotspot/test/testlibrary_tests/ctw/JarsTest.java b/hotspot/test/testlibrary_tests/ctw/JarsTest.java index e9bc05c1201..16af1639854 100644 --- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java +++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java @@ -24,14 +24,14 @@ /* * @test * @bug 8012447 - * @library /testlibrary /test/lib /testlibrary/ctw/src + * @library /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar + * @build sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main JarsTest prepare @@ -41,7 +41,7 @@ * @author igor.ignatyev@oracle.com */ -import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.process.OutputAnalyzer; public class JarsTest extends CtwTest { private static final String[] SHOULD_CONTAIN diff --git a/hotspot/test/testlibrary_tests/whitebox/BlobSanityTest.java b/hotspot/test/testlibrary_tests/whitebox/BlobSanityTest.java index 3146339e093..32369638233 100644 --- a/hotspot/test/testlibrary_tests/whitebox/BlobSanityTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/BlobSanityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -24,10 +24,10 @@ /* * @test BlobSanityTest * @bug 8132980 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build BlobSanityTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BlobSanityTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java index 23e6afd02bd..302f77c3d31 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,12 +24,12 @@ /* * @test BooleanTest * @bug 8028756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler * java.management/sun.management * jdk.jvmstat/sun.jvmstat.monitor - * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.* + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BooleanTest @@ -38,7 +38,8 @@ */ import sun.hotspot.WhiteBox; -import jdk.test.lib.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; import sun.management.*; import com.sun.management.*; diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java index 2694ba7046a..350f1f4888b 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test DoubleTest * @bug 8028756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build DoubleTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DoubleTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java index 56ffc53302d..16e9eba6f6e 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test IntxTest * @bug 8038756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build IntxTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xint -XX:-ProfileInterpreter IntxTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java index 22886802363..2d52d887a73 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test SizeTTest * @bug 8054823 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management - * @build SizeTTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions SizeTTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java index f8b98fa4daa..8bf9cabb9d4 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test StringTest * @bug 8028756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build StringTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI StringTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java index 015c02eba49..c2d34f1e683 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test Uint64Test * @bug 8028756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management/sun.management - * @build Uint64Test + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI Uint64Test diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java index 97149afd248..18e802182b1 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,10 +24,10 @@ /* * @test UintxTest * @bug 8028756 - * @library /testlibrary /test/lib + * @library /test/lib * @modules java.base/jdk.internal.misc * java.management/sun.management - * @build UintxTest + * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI UintxTest diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java index f1ce343cfe8..35d2ffa43a1 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -26,7 +26,7 @@ import java.util.function.Function; import sun.hotspot.WhiteBox; import sun.management.*; import com.sun.management.*; -import jdk.test.lib.*; +import jdk.test.lib.Asserts; import java.lang.management.ManagementFactory; public final class VmFlagTest { From 830cf57fbd0838381106c8b288647d5b2a63da34 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Fri, 19 Aug 2016 10:09:25 -0400 Subject: [PATCH 18/99] 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder Reviewed-by: coleenp, gtriantafill, mseledtsov, iignatyev, dholmes, dsamersoff --- make/test/BuildTestLib.gmk | 4 +- test/lib/ClassFileInstaller.java | 257 +++++++++ test/lib/RedefineClassHelper.java | 79 +++ .../classes => }/jdk/test/lib/Asserts.java | 2 +- test/lib/jdk/test/lib/BuildHelper.java | 106 ++++ test/lib/jdk/test/lib/ByteCodeLoader.java | 90 +++ test/lib/jdk/test/lib/DynamicVMOption.java | 165 ++++++ test/lib/jdk/test/lib/FileInstaller.java | 97 ++++ .../jdk/test/lib/InMemoryJavaCompiler.java | 153 +++++ .../jdk/test/lib/JDKToolFinder.java | 2 +- .../jdk/test/lib/JDKToolLauncher.java | 4 +- .../classes => }/jdk/test/lib/Platform.java | 7 +- .../classes => }/jdk/test/lib/Utils.java | 58 +- .../jdk/test/lib/apps/LingeredApp.java | 2 +- .../lib/apps/LingeredAppWithDeadlock.java | 2 +- .../cli/CPUSpecificCommandLineOptionTest.java | 65 +++ .../test/lib/cli/CommandLineOptionTest.java | 524 ++++++++++++++++++ .../test/lib/cli/predicate/AndPredicate.java | 41 ++ .../cli/predicate/CPUSpecificPredicate.java | 71 +++ .../test/lib/cli/predicate/NotPredicate.java | 40 ++ .../test/lib/cli/predicate/OrPredicate.java | 42 ++ .../jdk/test/lib/dcmd/CommandExecutor.java | 75 +++ .../lib/dcmd/CommandExecutorException.java | 36 ++ .../jdk/test/lib/dcmd/FileJcmdExecutor.java | 81 +++ test/lib/jdk/test/lib/dcmd/JMXExecutor.java | 187 +++++++ test/lib/jdk/test/lib/dcmd/JcmdExecutor.java | 58 ++ .../test/lib/dcmd/MainClassJcmdExecutor.java | 57 ++ .../jdk/test/lib/dcmd/PidJcmdExecutor.java | 63 +++ .../jdk/test/lib/hprof/HprofParser.java | 2 +- .../classes => }/jdk/test/lib/hprof/README | 0 .../model/AbstractJavaHeapObjectVisitor.java | 2 +- .../test/lib/hprof/model/ArrayTypeCodes.java | 2 +- .../test/lib/hprof/model/HackJavaValue.java | 2 +- .../jdk/test/lib/hprof/model/JavaBoolean.java | 2 +- .../jdk/test/lib/hprof/model/JavaByte.java | 2 +- .../jdk/test/lib/hprof/model/JavaChar.java | 2 +- .../jdk/test/lib/hprof/model/JavaClass.java | 2 +- .../jdk/test/lib/hprof/model/JavaDouble.java | 2 +- .../jdk/test/lib/hprof/model/JavaField.java | 2 +- .../jdk/test/lib/hprof/model/JavaFloat.java | 2 +- .../test/lib/hprof/model/JavaHeapObject.java | 2 +- .../hprof/model/JavaHeapObjectVisitor.java | 2 +- .../jdk/test/lib/hprof/model/JavaInt.java | 2 +- .../lib/hprof/model/JavaLazyReadObject.java | 2 +- .../jdk/test/lib/hprof/model/JavaLong.java | 2 +- .../jdk/test/lib/hprof/model/JavaObject.java | 2 +- .../test/lib/hprof/model/JavaObjectArray.java | 2 +- .../test/lib/hprof/model/JavaObjectRef.java | 2 +- .../jdk/test/lib/hprof/model/JavaShort.java | 2 +- .../jdk/test/lib/hprof/model/JavaStatic.java | 2 +- .../jdk/test/lib/hprof/model/JavaThing.java | 2 +- .../jdk/test/lib/hprof/model/JavaValue.java | 2 +- .../test/lib/hprof/model/JavaValueArray.java | 2 +- .../lib/hprof/model/ReachableExcludes.java | 2 +- .../hprof/model/ReachableExcludesImpl.java | 2 +- .../lib/hprof/model/ReachableObjects.java | 2 +- .../test/lib/hprof/model/ReferenceChain.java | 2 +- .../jdk/test/lib/hprof/model/Root.java | 2 +- .../jdk/test/lib/hprof/model/Snapshot.java | 2 +- .../jdk/test/lib/hprof/model/StackFrame.java | 2 +- .../jdk/test/lib/hprof/model/StackTrace.java | 2 +- .../test/lib/hprof/parser/FileReadBuffer.java | 2 +- .../test/lib/hprof/parser/HprofReader.java | 2 +- .../lib/hprof/parser/MappedReadBuffer.java | 2 +- .../hprof/parser/PositionDataInputStream.java | 2 +- .../lib/hprof/parser/PositionInputStream.java | 2 +- .../jdk/test/lib/hprof/parser/ReadBuffer.java | 2 +- .../jdk/test/lib/hprof/parser/Reader.java | 2 +- .../jdk/test/lib/hprof/util/ArraySorter.java | 2 +- .../jdk/test/lib/hprof/util/Comparer.java | 2 +- .../lib/hprof/util/CompositeEnumeration.java | 2 +- .../jdk/test/lib/hprof/util/Misc.java | 2 +- .../jdk/test/lib/hprof/util/VectorSorter.java | 2 +- test/lib/jdk/test/lib/process/ExitCode.java | 40 ++ .../jdk/test/lib/process/OutputAnalyzer.java | 16 +- .../jdk/test/lib/process/OutputBuffer.java | 2 +- .../jdk/test/lib/process/ProcessTools.java | 47 +- .../jdk/test/lib/process/StreamPumper.java | 2 +- test/lib/jdk/test/lib/util/Pair.java | 68 +++ test/lib/jdk/test/lib/util/Triple.java | 90 +++ .../jdk/test/lib/wrappers/InfiniteLoop.java | 66 +++ .../test/lib/wrappers/TimeLimitedRunner.java | 86 +++ 82 files changed, 2795 insertions(+), 78 deletions(-) create mode 100644 test/lib/ClassFileInstaller.java create mode 100644 test/lib/RedefineClassHelper.java rename test/lib/{share/classes => }/jdk/test/lib/Asserts.java (99%) create mode 100644 test/lib/jdk/test/lib/BuildHelper.java create mode 100644 test/lib/jdk/test/lib/ByteCodeLoader.java create mode 100644 test/lib/jdk/test/lib/DynamicVMOption.java create mode 100644 test/lib/jdk/test/lib/FileInstaller.java create mode 100644 test/lib/jdk/test/lib/InMemoryJavaCompiler.java rename test/lib/{share/classes => }/jdk/test/lib/JDKToolFinder.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/JDKToolLauncher.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/Platform.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/Utils.java (91%) rename test/lib/{share/classes => }/jdk/test/lib/apps/LingeredApp.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/apps/LingeredAppWithDeadlock.java (97%) create mode 100644 test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java create mode 100644 test/lib/jdk/test/lib/cli/CommandLineOptionTest.java create mode 100644 test/lib/jdk/test/lib/cli/predicate/AndPredicate.java create mode 100644 test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java create mode 100644 test/lib/jdk/test/lib/cli/predicate/NotPredicate.java create mode 100644 test/lib/jdk/test/lib/cli/predicate/OrPredicate.java create mode 100644 test/lib/jdk/test/lib/dcmd/CommandExecutor.java create mode 100644 test/lib/jdk/test/lib/dcmd/CommandExecutorException.java create mode 100644 test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java create mode 100644 test/lib/jdk/test/lib/dcmd/JMXExecutor.java create mode 100644 test/lib/jdk/test/lib/dcmd/JcmdExecutor.java create mode 100644 test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java create mode 100644 test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java rename test/lib/{share/classes => }/jdk/test/lib/hprof/HprofParser.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/README (100%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/ArrayTypeCodes.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/HackJavaValue.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaBoolean.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaByte.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaChar.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaClass.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaDouble.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaField.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaFloat.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaHeapObject.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaInt.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaLazyReadObject.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaLong.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaObject.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaObjectArray.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaObjectRef.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaShort.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaStatic.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaThing.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaValue.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/JavaValueArray.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/ReachableExcludes.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/ReachableExcludesImpl.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/ReachableObjects.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/ReferenceChain.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/Root.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/Snapshot.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/StackFrame.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/model/StackTrace.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/FileReadBuffer.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/HprofReader.java (99%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/MappedReadBuffer.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/PositionDataInputStream.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/PositionInputStream.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/ReadBuffer.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/parser/Reader.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/util/ArraySorter.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/util/Comparer.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/util/CompositeEnumeration.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/util/Misc.java (98%) rename test/lib/{share/classes => }/jdk/test/lib/hprof/util/VectorSorter.java (98%) create mode 100644 test/lib/jdk/test/lib/process/ExitCode.java rename test/lib/{share/classes => }/jdk/test/lib/process/OutputAnalyzer.java (97%) rename test/lib/{share/classes => }/jdk/test/lib/process/OutputBuffer.java (96%) rename test/lib/{share/classes => }/jdk/test/lib/process/ProcessTools.java (93%) rename test/lib/{share/classes => }/jdk/test/lib/process/StreamPumper.java (99%) create mode 100644 test/lib/jdk/test/lib/util/Pair.java create mode 100644 test/lib/jdk/test/lib/util/Triple.java create mode 100644 test/lib/jdk/test/lib/wrappers/InfiniteLoop.java create mode 100644 test/lib/jdk/test/lib/wrappers/TimeLimitedRunner.java diff --git a/make/test/BuildTestLib.gmk b/make/test/BuildTestLib.gmk index 382341a47e4..7593ac74766 100644 --- a/make/test/BuildTestLib.gmk +++ b/make/test/BuildTestLib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 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 @@ -48,7 +48,7 @@ TARGETS += $(BUILD_WB_JAR) # test-lib.jar will contain only hprof classes until JDK-8081381 is resolved $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \ SETUP := GENERATE_USINGJDKBYTECODE, \ - SRC := $(TEST_LIB_SOURCE_DIR)/share/classes/jdk/test/lib/hprof, \ + SRC := $(TEST_LIB_SOURCE_DIR)/jdk/test/lib/hprof, \ BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \ JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \ )) diff --git a/test/lib/ClassFileInstaller.java b/test/lib/ClassFileInstaller.java new file mode 100644 index 00000000000..2486bd2ef81 --- /dev/null +++ b/test/lib/ClassFileInstaller.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * Dump a class file for a class on the class path in the current directory, or + * in the specified JAR file. This class is usually used when you build a class + * from a test library, but want to use this class in a sub-process. + * + * For example, to build the following library class: + * test/lib/sun/hotspot/WhiteBox.java + * + * You would use the following tags: + * + * @library /test/lib + * @build sun.hotspot.WhiteBox + * + * JTREG would build the class file under + * ${JTWork}/classes/test/lib/sun/hotspot/WhiteBox.class + * + * With you run your main test class using "@run main MyMainClass", JTREG would setup the + * -classpath to include "${JTWork}/classes/test/lib/", so MyMainClass would be able to + * load the WhiteBox class. + * + * However, if you run a sub process, and do not wish to use the exact same -classpath, + * You can use ClassFileInstaller to ensure that WhiteBox is available in the current + * directory of your test: + * + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * + * Or, you can use the -jar option to store the class in the specified JAR file. If a relative + * path name is given, the JAR file would be relative to the current directory of + * + * @run main ClassFileInstaller -jar myjar.jar sun.hotspot.WhiteBox + */ +public class ClassFileInstaller { + /** + * You can enable debug tracing of ClassFileInstaller by running JTREG with + * jtreg -DClassFileInstaller.debug=true ... + */ + public static boolean DEBUG = Boolean.getBoolean("ClassFileInstaller.debug"); + + /** + * @param args The names of the classes to dump + * @throws Exception + */ + public static void main(String... args) throws Exception { + if (args.length > 1 && args[0].equals("-jar")) { + if (args.length < 2) { + throw new RuntimeException("Usage: ClassFileInstaller \n" + + "where possible options include:\n" + + " -jar Write to the JAR file "); + } + writeJar(args[1], null, args, 2, args.length); + } else { + if (DEBUG) { + System.out.println("ClassFileInstaller: Writing to " + System.getProperty("user.dir")); + } + for (String arg : args) { + writeClassToDisk(arg); + } + } + } + + public static class Manifest { + private InputStream in; + + private Manifest(InputStream in) { + this.in = in; + } + + static Manifest fromSourceFile(String fileName) throws Exception { + String pathName = System.getProperty("test.src") + File.separator + fileName; + return new Manifest(new FileInputStream(pathName)); + } + + // Example: + // String manifest = "Premain-Class: RedefineClassHelper\n" + + // "Can-Redefine-Classes: true\n"; + // ClassFileInstaller.writeJar("redefineagent.jar", + // ClassFileInstaller.Manifest.fromString(manifest), + // "RedefineClassHelper"); + static Manifest fromString(String manifest) throws Exception { + return new Manifest(new ByteArrayInputStream(manifest.getBytes())); + } + + public InputStream getInputStream() { + return in; + } + } + + private static void writeJar(String jarFile, Manifest manifest, String classes[], int from, int to) throws Exception { + if (DEBUG) { + System.out.println("ClassFileInstaller: Writing to " + getJarPath(jarFile)); + } + + (new File(jarFile)).delete(); + FileOutputStream fos = new FileOutputStream(jarFile); + ZipOutputStream zos = new ZipOutputStream(fos); + + // The manifest must be the first or second entry. See comments in JarInputStream + // constructor and JDK-5046178. + if (manifest != null) { + writeToDisk(zos, "META-INF/MANIFEST.MF", manifest.getInputStream()); + } + + for (int i=from; i 0) { + pathName = prependPath + "/" + pathName; + } + writeToDisk(zos, pathName, is); + } + + public static void writeClassToDisk(String className, byte[] bytecode) throws Exception { + writeClassToDisk(null, className, bytecode); + } + private static void writeClassToDisk(ZipOutputStream zos, String className, byte[] bytecode) throws Exception { + writeClassToDisk(zos, className, bytecode, ""); + } + + public static void writeClassToDisk(String className, byte[] bytecode, String prependPath) throws Exception { + writeClassToDisk(null, className, bytecode, prependPath); + } + private static void writeClassToDisk(ZipOutputStream zos, String className, byte[] bytecode, String prependPath) throws Exception { + // Convert dotted class name to a path to a class file + String pathName = className.replace('.', '/').concat(".class"); + if (prependPath.length() > 0) { + pathName = prependPath + "/" + pathName; + } + writeToDisk(zos, pathName, new ByteArrayInputStream(bytecode)); + } + + private static void writeToDisk(ZipOutputStream zos, String pathName, InputStream is) throws Exception { + if (DEBUG) { + System.out.println("ClassFileInstaller: Writing " + pathName); + } + if (zos != null) { + ZipEntry ze = new ZipEntry(pathName); + zos.putNextEntry(ze); + byte[] buf = new byte[1024]; + int len; + while ((len = is.read(buf))>0){ + zos.write(buf, 0, len); + } + } else { + // Create the class file's package directory + Path p = Paths.get(pathName); + if (pathName.contains("/")) { + Files.createDirectories(p.getParent()); + } + // Create the class file + Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING); + } + is.close(); + } +} diff --git a/test/lib/RedefineClassHelper.java b/test/lib/RedefineClassHelper.java new file mode 100644 index 00000000000..75768092365 --- /dev/null +++ b/test/lib/RedefineClassHelper.java @@ -0,0 +1,79 @@ +/* + * 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. + */ + +import java.io.PrintWriter; +import java.lang.instrument.*; +import jdk.test.lib.InMemoryJavaCompiler; + +/* + * Helper class to write tests that redefine classes. + * When main method is run, it will create a redefineagent.jar that can be used + * with the -javaagent option to support redefining classes in jtreg tests. + * + * See sample test in test/testlibrary_tests/RedefineClassTest.java + */ +public class RedefineClassHelper { + + public static Instrumentation instrumentation; + public static void premain(String agentArgs, Instrumentation inst) { + instrumentation = inst; + } + + /** + * Redefine a class + * + * @param clazz Class to redefine + * @param javacode String with the new java code for the class to be redefined + */ + public static void redefineClass(Class clazz, String javacode) throws Exception { + byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode); + redefineClass(clazz, bytecode); + } + + /** + * Redefine a class + * + * @param clazz Class to redefine + * @param bytecode byte[] with the new class + */ + public static void redefineClass(Class clazz, byte[] bytecode) throws Exception { + instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode)); + } + + /** + * Main method to be invoked before test to create the redefineagent.jar + */ + public static void main(String[] args) throws Exception { + ClassFileInstaller.main("RedefineClassHelper"); + + PrintWriter pw = new PrintWriter("MANIFEST.MF"); + pw.println("Premain-Class: RedefineClassHelper"); + pw.println("Can-Redefine-Classes: true"); + pw.close(); + + sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); + if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) { + throw new Exception("jar operation failed"); + } + } +} diff --git a/test/lib/share/classes/jdk/test/lib/Asserts.java b/test/lib/jdk/test/lib/Asserts.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/Asserts.java rename to test/lib/jdk/test/lib/Asserts.java index f0be92ef331..8aa0105d994 100644 --- a/test/lib/share/classes/jdk/test/lib/Asserts.java +++ b/test/lib/jdk/test/lib/Asserts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 diff --git a/test/lib/jdk/test/lib/BuildHelper.java b/test/lib/jdk/test/lib/BuildHelper.java new file mode 100644 index 00000000000..1e9d697b35b --- /dev/null +++ b/test/lib/jdk/test/lib/BuildHelper.java @@ -0,0 +1,106 @@ +/* + * 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 jdk.test.lib; + +import java.io.File; +import java.io.FileReader; +import java.util.Properties; + +public class BuildHelper { + + /** + * Commercial builds should have the BUILD_TYPE set to commercial + * within the release file, found at the root of the JDK. + */ + public static boolean isCommercialBuild() throws Exception { + String buildType = getReleaseProperty("BUILD_TYPE","notFound"); + return buildType.equals("commercial"); + } + + + /** + * Return the value for property key, or defaultValue if no property not found. + * If present, double quotes are trimmed. + */ + public static String getReleaseProperty(String key, String defaultValue) throws Exception { + Properties properties = getReleaseProperties(); + String value = properties.getProperty(key, defaultValue); + return trimDoubleQuotes(value); + } + + /** + * Return the value for property key, or null if no property not found. + * If present, double quotes are trimmed. + */ + public static String getReleaseProperty(String key) throws Exception { + return getReleaseProperty(key, null); + } + + /** + * Get properties from the release file + */ + public static Properties getReleaseProperties() throws Exception { + Properties properties = new Properties(); + properties.load(new FileReader(getReleaseFile())); + return properties; + } + + /** + * Every JDK has a release file in its root. + * @return A handler to the release file. + */ + public static File getReleaseFile() throws Exception { + String jdkPath = getJDKRoot(); + File releaseFile = new File(jdkPath,"release"); + if ( ! releaseFile.canRead() ) { + throw new Exception("Release file is not readable, or it is absent: " + + releaseFile.getCanonicalPath()); + } + return releaseFile; + } + + /** + * Returns path to the JDK under test. + * This path is obtained through the test.jdk property, usually set by JTREG. + */ + public static String getJDKRoot() { + String jdkPath = System.getProperty("test.jdk"); + if (jdkPath == null) { + throw new RuntimeException("System property 'test.jdk' not set. This property is normally set by jtreg. " + + "When running test separately, set this property using '-Dtest.jdk=/path/to/jdk'."); + } + return jdkPath; + } + + /** + * Trim double quotes from the beginning and the end of the given string. + * @param original string to trim. + * @return a new trimmed string. + */ + public static String trimDoubleQuotes(String original) { + if (original == null) { return null; } + String trimmed = original.replaceAll("^\"+|\"+$", ""); + return trimmed; + } +} diff --git a/test/lib/jdk/test/lib/ByteCodeLoader.java b/test/lib/jdk/test/lib/ByteCodeLoader.java new file mode 100644 index 00000000000..14f98f8747b --- /dev/null +++ b/test/lib/jdk/test/lib/ByteCodeLoader.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2013, 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 jdk.test.lib; + +import java.security.SecureClassLoader; + +/** + * {@code ByteCodeLoader} can be used for easy loading of byte code already + * present in memory. + * + * {@code InMemoryCompiler} can be used for compiling source code in a string + * into byte code, which then can be loaded with {@code ByteCodeLoader}. + * + * @see InMemoryCompiler + */ +public class ByteCodeLoader extends SecureClassLoader { + private final String className; + private final byte[] byteCode; + private volatile Class holder; + + /** + * Creates a new {@code ByteCodeLoader} ready to load a class with the + * given name and the given byte code. + * + * @param className The name of the class + * @param byteCode The byte code of the class + */ + public ByteCodeLoader(String className, byte[] byteCode) { + this.className = className; + this.byteCode = byteCode; + } + + @Override + public Class loadClass(String name) throws ClassNotFoundException { + if (!name.equals(className)) { + return super.loadClass(name); + } + if (holder == null) { + synchronized(this) { + if (holder == null) { + holder = findClass(name); + } + } + } + return holder; + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + if (!name.equals(className)) { + throw new ClassNotFoundException(name); + } + + return defineClass(name, byteCode, 0, byteCode.length); + } + + /** + * Utility method for creating a new {@code ByteCodeLoader} and then + * directly load the given byte code. + * + * @param className The name of the class + * @param byteCode The byte code for the class + * @throws ClassNotFoundException if the class can't be loaded + * @return A {@see Class} object representing the class + */ + public static Class load(String className, byte[] byteCode) throws ClassNotFoundException { + return new ByteCodeLoader(className, byteCode).loadClass(className); + } +} diff --git a/test/lib/jdk/test/lib/DynamicVMOption.java b/test/lib/jdk/test/lib/DynamicVMOption.java new file mode 100644 index 00000000000..17f545e126e --- /dev/null +++ b/test/lib/jdk/test/lib/DynamicVMOption.java @@ -0,0 +1,165 @@ +/* + * 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 jdk.test.lib; + +import com.sun.management.HotSpotDiagnosticMXBean; +import java.lang.management.ManagementFactory; + +/** + * A utility class to work with VM options which could be altered during + * execution. + * + * This class is a wrapper around {@code com.sun.management.VMOption}. + * It provides more convenient interface to read/write the values. + * + */ +public class DynamicVMOption { + + private final HotSpotDiagnosticMXBean mxBean; + + /** + * VM option name, like "MinHeapFreeRatio". + */ + public final String name; + + /** + * Creates an instance of DynamicVMOption. + * + * @param name the VM option name + */ + public DynamicVMOption(String name) { + this.name = name; + mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); + } + + /** + * Sets a new value for the option. + * Trying to set not applicable value will cause IllegalArgumentException. + * Behavior with null is undefined, most likely NPE will be thrown. + * + * @param newValue the value to be set + * @see #getValue() + * @throws IllegalArgumentException if newValue is not applicable to the option + */ + public final void setValue(String newValue) { + mxBean.setVMOption(name, newValue); + } + + /** + * Returns the value of option. + * + * @return the current option value + * @see #setValue(java.lang.String) + */ + public final String getValue() { + return mxBean.getVMOption(name).getValue(); + } + + /** + * Returns true, if option is writable, false otherwise. + * + * @return true, if option is writable, false otherwise + */ + public final boolean isWriteable() { + return mxBean.getVMOption(name).isWriteable(); + } + + /** + * Checks if the given value is applicable for the option. + * + * This method tries to set the option to the new value. If no exception + * has been thrown the value is treated as valid. + * + * Calling this method will not change the option value. After an attempt + * to set a new value, the option will be restored to its previous value. + * + * @param value the value to verify + * @return true if option could be set to the given value + */ + public boolean isValidValue(String value) { + boolean isValid = true; + String oldValue = getValue(); + try { + setValue(value); + } catch (NullPointerException e) { + if (value == null) { + isValid = false; + } + } catch (IllegalArgumentException e) { + isValid = false; + } finally { + setValue(oldValue); + } + return isValid; + } + + /** + * Returns the value of the given VM option as String. + * + * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()} + * + * @param name the name of VM option + * @return value as a string + * @see #getValue() + */ + public static String getString(String name) { + return new DynamicVMOption(name).getValue(); + } + + /** + * Returns the value of the given option as int. + * + * @param name the name of VM option + * @return value parsed as integer + * @see #getString(java.lang.String) + * + */ + public static int getInt(String name) { + return Integer.parseInt(getString(name)); + } + + /** + * Sets the VM option to a new value. + * + * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)} + * + * @param name the name of VM option + * @param value the value to be set + * @see #setValue(java.lang.String) + */ + public static void setString(String name, String value) { + new DynamicVMOption(name).setValue(value); + } + + /** + * Sets the VM option value to a new integer value. + * + * @param name the name of VM option + * @param value the integer value to be set + * @see #setString(java.lang.String, java.lang.String) + */ + public static void setInt(String name, int value) { + new DynamicVMOption(name).setValue(Integer.toString(value)); + } + +} diff --git a/test/lib/jdk/test/lib/FileInstaller.java b/test/lib/jdk/test/lib/FileInstaller.java new file mode 100644 index 00000000000..1247deedcb1 --- /dev/null +++ b/test/lib/jdk/test/lib/FileInstaller.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib; + +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; + +/** + * Copy a resource: file or directory recursively, using relative path(src and dst) + * which are applied to test source directory(src) and current directory(dst) + */ +public class FileInstaller { + /** + * @param args source and destination + * @throws IOException if an I/O error occurs + */ + public static void main(String[] args) throws IOException { + if (args.length != 2) { + throw new IllegalArgumentException("Unexpected number of arguments for file copy"); + } + Path src = Paths.get(Utils.TEST_SRC, args[0]).toAbsolutePath(); + Path dst = Paths.get(args[1]).toAbsolutePath(); + if (src.toFile().exists()) { + if (src.toFile().isDirectory()) { + Files.walkFileTree(src, new CopyFileVisitor(src, dst)); + } else { + Path dstDir = dst.getParent(); + if (!dstDir.toFile().exists()) { + Files.createDirectories(dstDir); + } + Files.copy(src, dst, StandardCopyOption.REPLACE_EXISTING); + } + } else { + throw new IOException("Can't find source " + src); + } + } + + private static class CopyFileVisitor extends SimpleFileVisitor { + private final Path copyFrom; + private final Path copyTo; + + public CopyFileVisitor(Path copyFrom, Path copyTo) { + this.copyFrom = copyFrom; + this.copyTo = copyTo; + } + + @Override + public FileVisitResult preVisitDirectory(Path file, + BasicFileAttributes attrs) throws IOException { + Path relativePath = file.relativize(copyFrom); + Path destination = copyTo.resolve(relativePath); + if (!destination.toFile().exists()) { + Files.createDirectories(destination); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) throws IOException { + if (!file.toFile().isFile()) { + return FileVisitResult.CONTINUE; + } + Path relativePath = copyFrom.relativize(file); + Path destination = copyTo.resolve(relativePath); + Files.copy(file, destination, StandardCopyOption.COPY_ATTRIBUTES); + return FileVisitResult.CONTINUE; + } + } +} diff --git a/test/lib/jdk/test/lib/InMemoryJavaCompiler.java b/test/lib/jdk/test/lib/InMemoryJavaCompiler.java new file mode 100644 index 00000000000..5fb78e4441f --- /dev/null +++ b/test/lib/jdk/test/lib/InMemoryJavaCompiler.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2013, 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 jdk.test.lib; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import java.net.URI; +import java.util.Arrays; + +import javax.tools.ForwardingJavaFileManager; +import javax.tools.FileObject; +import javax.tools.JavaCompiler; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; +import javax.tools.JavaFileObject.Kind; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +/** + * {@code InMemoryJavaCompiler} can be used for compiling a {@link + * CharSequence} to a {@code byte[]}. + * + * The compiler will not use the file system at all, instead using a {@link + * ByteArrayOutputStream} for storing the byte code. For the source code, any + * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link + * StringBuffer} or {@link StringBuilder}. + * + * The {@code InMemoryCompiler} can easily be used together with a {@code + * ByteClassLoader} to easily compile and load source code in a {@link String}: + * + *
+ * {@code
+ * import jdk.test.lib.InMemoryJavaCompiler;
+ * import jdk.test.lib.ByteClassLoader;
+ *
+ * class Example {
+ *     public static void main(String[] args) {
+ *         String className = "Foo";
+ *         String sourceCode = "public class " + className + " {" +
+ *                             "    public void bar() {" +
+ *                             "        System.out.println("Hello from bar!");" +
+ *                             "    }" +
+ *                             "}";
+ *         byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
+ *         Class fooClass = ByteClassLoader.load(className, byteCode);
+ *     }
+ * }
+ * }
+ * 
+ */ +public class InMemoryJavaCompiler { + private static class MemoryJavaFileObject extends SimpleJavaFileObject { + private final String className; + private final CharSequence sourceCode; + private final ByteArrayOutputStream byteCode; + + public MemoryJavaFileObject(String className, CharSequence sourceCode) { + super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE); + this.className = className; + this.sourceCode = sourceCode; + this.byteCode = new ByteArrayOutputStream(); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return sourceCode; + } + + @Override + public OutputStream openOutputStream() throws IOException { + return byteCode; + } + + public byte[] getByteCode() { + return byteCode.toByteArray(); + } + + public String getClassName() { + return className; + } + } + + private static class FileManagerWrapper extends ForwardingJavaFileManager { + private MemoryJavaFileObject file; + + public FileManagerWrapper(MemoryJavaFileObject file) { + super(getCompiler().getStandardFileManager(null, null, null)); + this.file = file; + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String className, + Kind kind, FileObject sibling) + throws IOException { + if (!file.getClassName().equals(className)) { + throw new IOException("Expected class with name " + file.getClassName() + + ", but got " + className); + } + return file; + } + } + + /** + * Compiles the class with the given name and source code. + * + * @param className The name of the class + * @param sourceCode The source code for the class with name {@code className} + * @param options additional command line options + * @throws RuntimeException if the compilation did not succeed + * @return The resulting byte code from the compilation + */ + public static byte[] compile(String className, CharSequence sourceCode, String... options) { + MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode); + CompilationTask task = getCompilationTask(file, options); + + if(!task.call()) { + throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); + } + + return file.getByteCode(); + } + + private static JavaCompiler getCompiler() { + return ToolProvider.getSystemJavaCompiler(); + } + + private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) { + return getCompiler().getTask(null, new FileManagerWrapper(file), null, Arrays.asList(options), null, Arrays.asList(file)); + } +} diff --git a/test/lib/share/classes/jdk/test/lib/JDKToolFinder.java b/test/lib/jdk/test/lib/JDKToolFinder.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/JDKToolFinder.java rename to test/lib/jdk/test/lib/JDKToolFinder.java index 3ad008e0005..a9a3598f10d 100644 --- a/test/lib/share/classes/jdk/test/lib/JDKToolFinder.java +++ b/test/lib/jdk/test/lib/JDKToolFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 diff --git a/test/lib/share/classes/jdk/test/lib/JDKToolLauncher.java b/test/lib/jdk/test/lib/JDKToolLauncher.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/JDKToolLauncher.java rename to test/lib/jdk/test/lib/JDKToolLauncher.java index 3948d474ec1..38e7b4530bf 100644 --- a/test/lib/share/classes/jdk/test/lib/JDKToolLauncher.java +++ b/test/lib/jdk/test/lib/JDKToolLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ package jdk.test.lib; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import jdk.test.lib.process.*; +import jdk.test.lib.process.ProcessTools; /** * A utility for constructing command lines for starting JDK tool processes. diff --git a/test/lib/share/classes/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/Platform.java rename to test/lib/jdk/test/lib/Platform.java index 8c55f091467..ec4fa8b63ba 100644 --- a/test/lib/share/classes/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -31,7 +31,7 @@ public class Platform { private static final String osName = System.getProperty("os.name"); private static final String dataModel = System.getProperty("sun.arch.data.model"); private static final String vmVersion = System.getProperty("java.vm.version"); - private static final String javaVersion = System.getProperty("java.version"); + private static final String jdkDebug = System.getProperty("jdk.debug"); private static final String osArch = System.getProperty("os.arch"); private static final String userName = System.getProperty("user.name"); private static final String compiler = System.getProperty("sun.management.compiler"); @@ -113,8 +113,7 @@ public class Platform { } public static boolean isDebugBuild() { - return (vmVersion.toLowerCase().contains("debug") || - javaVersion.toLowerCase().contains("debug")); + return (jdkDebug.toLowerCase().contains("debug")); } public static String getVMVersion() { diff --git a/test/lib/share/classes/jdk/test/lib/Utils.java b/test/lib/jdk/test/lib/Utils.java similarity index 91% rename from test/lib/share/classes/jdk/test/lib/Utils.java rename to test/lib/jdk/test/lib/Utils.java index 95e2bbab48a..aececb0301f 100644 --- a/test/lib/share/classes/jdk/test/lib/Utils.java +++ b/test/lib/jdk/test/lib/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -40,7 +40,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Iterator; +import java.util.Map; +import java.util.HashMap; import java.util.List; +import java.util.Objects; import java.util.Random; import java.util.function.BooleanSupplier; import java.util.concurrent.TimeUnit; @@ -50,8 +53,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import jdk.internal.misc.Unsafe; -import jdk.test.lib.process.*; import static jdk.test.lib.Asserts.assertTrue; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; /** * Common library for various test helper functions. @@ -446,6 +450,23 @@ public final class Utils { return iterator.next(); } + /** + * Returns random element of non empty array + * + * @param a type of array element + * @param array array of elements + * @return random element of array + * @throws IllegalArgumentException if array is empty + */ + public static T getRandomElement(T[] array) + throws IllegalArgumentException { + if (array == null || array.length == 0) { + throw new IllegalArgumentException("Empty or null array"); + } + Random random = getRandomInstance(); + return array[random.nextInt(array.length)]; + } + /** * Wait for condition to be true * @@ -636,5 +657,38 @@ public final class Utils { } return result; } + + public static Object[] getNullValues(Class... types) { + Object[] result = new Object[types.length]; + int i = 0; + for (Class type : types) { + result[i++] = NULL_VALUES.get(type); + } + return result; + } + private static Map, Object> NULL_VALUES = new HashMap<>(); + static { + NULL_VALUES.put(boolean.class, false); + NULL_VALUES.put(byte.class, (byte) 0); + NULL_VALUES.put(short.class, (short) 0); + NULL_VALUES.put(char.class, '\0'); + NULL_VALUES.put(int.class, 0); + NULL_VALUES.put(long.class, 0L); + NULL_VALUES.put(float.class, 0.0f); + NULL_VALUES.put(double.class, 0.0d); + } + + /** + * Returns mandatory property value + * @param propName is a name of property to request + * @return a String with requested property value + */ + public static String getMandatoryProperty(String propName) { + Objects.requireNonNull(propName, "Requested null property"); + String prop = System.getProperty(propName); + Objects.requireNonNull(prop, + String.format("A mandatory property '%s' isn't set", propName)); + return prop; + } } diff --git a/test/lib/share/classes/jdk/test/lib/apps/LingeredApp.java b/test/lib/jdk/test/lib/apps/LingeredApp.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/apps/LingeredApp.java rename to test/lib/jdk/test/lib/apps/LingeredApp.java index d5675a3f635..ac375b62faf 100644 --- a/test/lib/share/classes/jdk/test/lib/apps/LingeredApp.java +++ b/test/lib/jdk/test/lib/apps/LingeredApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/lib/share/classes/jdk/test/lib/apps/LingeredAppWithDeadlock.java b/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/apps/LingeredAppWithDeadlock.java rename to test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java index 85d96f29f95..2b52c1523db 100644 --- a/test/lib/share/classes/jdk/test/lib/apps/LingeredAppWithDeadlock.java +++ b/test/lib/jdk/test/lib/apps/LingeredAppWithDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java new file mode 100644 index 00000000000..121d81d8d95 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java @@ -0,0 +1,65 @@ +/* + * 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 jdk.test.lib.cli; + +import jdk.test.lib.cli.predicate.CPUSpecificPredicate; + +/** + * Base class for command line options tests that + * requires specific CPU arch or specific CPU features. + */ +public abstract class CPUSpecificCommandLineOptionTest + extends CommandLineOptionTest { + /** + * Creates new CPU specific test instance that does not + * require any CPU features. + * + * @param cpuArchPattern Regular expression that should + * match os.arch. + */ + public CPUSpecificCommandLineOptionTest(String cpuArchPattern) { + this(cpuArchPattern, null, null); + } + + /** + * Creates new CPU specific test instance that does not + * require from CPU support of {@code supportedCPUFeatures} features + * and no support of {@code unsupportedCPUFeatures}. + * + * @param cpuArchPattern Regular expression that should + * match os.arch. + * @param supportedCPUFeatures Array with names of features that + * should be supported by CPU. If {@code null}, + * then no features have to be supported. + * @param unsupportedCPUFeatures Array with names of features that + * should not be supported by CPU. + * If {@code null}, then CPU may support any + * features. + */ + public CPUSpecificCommandLineOptionTest(String cpuArchPattern, + String supportedCPUFeatures[], String unsupportedCPUFeatures[]) { + super(new CPUSpecificPredicate(cpuArchPattern, supportedCPUFeatures, + unsupportedCPUFeatures)); + } +} diff --git a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java new file mode 100644 index 00000000000..f794ef36090 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java @@ -0,0 +1,524 @@ +/* + * 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 jdk.test.lib.cli; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.function.BooleanSupplier; + +import jdk.test.lib.process.ExitCode; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + +/** + * Base class for command line option tests. + */ +public abstract class CommandLineOptionTest { + public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS + = "-XX:+UnlockDiagnosticVMOptions"; + public static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS + = "-XX:+UnlockExperimentalVMOptions"; + protected static final String UNRECOGNIZED_OPTION_ERROR_FORMAT + = "Unrecognized VM option '[+-]?%s(=.*)?'"; + protected static final String EXPERIMENTAL_OPTION_ERROR_FORMAT + = "VM option '%s' is experimental and must be enabled via " + + "-XX:\\+UnlockExperimentalVMOptions."; + protected static final String DIAGNOSTIC_OPTION_ERROR_FORMAT + = " VM option '%s' is diagnostic and must be enabled via " + + "-XX:\\+UnlockDiagnosticVMOptions."; + private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s"; + + /** + * Verifies that JVM startup behavior matches our expectations. + * + * @param option an option that should be passed to JVM + * @param expectedMessages an array of patterns that should occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not + * occur in JVM output. If {@code null} then + * JVM output could be empty. + * @param exitErrorMessage message that will be shown if exit code is not + * as expected. + * @param wrongWarningMessage message that will be shown if warning + * messages are not as expected. + * @param exitCode expected exit code. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyJVMStartup(String option, + String expectedMessages[], String unexpectedMessages[], + String exitErrorMessage, String wrongWarningMessage, + ExitCode exitCode) throws Throwable { + CommandLineOptionTest.verifyJVMStartup(expectedMessages, + unexpectedMessages, exitErrorMessage, + wrongWarningMessage, exitCode, false, option); + } + + /** + * Verifies that JVM startup behavior matches our expectations. + * + * @param expectedMessages an array of patterns that should occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not + * occur in JVM output. If {@code null} then + * JVM output could be empty. + * @param exitErrorMessage message that will be shown if exit code is not + * as expected. + * @param wrongWarningMessage message that will be shown if warning + * messages are not as expected. + * @param exitCode expected exit code. + * @param addTestVMOptions if {@code true} then test VM options will be + * passed to VM. + * @param options options that should be passed to VM in addition to mode + * flag. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyJVMStartup(String expectedMessages[], + String unexpectedMessages[], String exitErrorMessage, + String wrongWarningMessage, ExitCode exitCode, + boolean addTestVMOptions, String... options) + throws Throwable { + List finalOptions = new ArrayList<>(); + if (addTestVMOptions) { + Collections.addAll(finalOptions, ProcessTools.getVmInputArgs()); + Collections.addAll(finalOptions, Utils.getTestJavaOpts()); + } + Collections.addAll(finalOptions, options); + finalOptions.add("-version"); + + ProcessBuilder processBuilder + = ProcessTools.createJavaProcessBuilder(finalOptions.toArray( + new String[finalOptions.size()])); + OutputAnalyzer outputAnalyzer + = new OutputAnalyzer(processBuilder.start()); + + try { + outputAnalyzer.shouldHaveExitValue(exitCode.value); + } catch (RuntimeException e) { + String errorMessage = String.format( + "JVM process should have exit value '%d'.%n%s", + exitCode.value, exitErrorMessage); + throw new AssertionError(errorMessage, e); + } + + verifyOutput(expectedMessages, unexpectedMessages, + wrongWarningMessage, outputAnalyzer); + } + + /** + * Verifies that JVM startup behavior matches our expectations. + * + * @param expectedMessages an array of patterns that should occur in JVM + * output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param wrongWarningMessage message that will be shown if messages are + * not as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails. + */ + public static void verifyOutput(String[] expectedMessages, + String[] unexpectedMessages, String wrongWarningMessage, + OutputAnalyzer outputAnalyzer) { + if (expectedMessages != null) { + for (String expectedMessage : expectedMessages) { + try { + outputAnalyzer.shouldMatch(expectedMessage); + } catch (RuntimeException e) { + String errorMessage = String.format( + "Expected message not found: '%s'.%n%s", + expectedMessage, wrongWarningMessage); + throw new AssertionError(errorMessage, e); + } + } + } + + if (unexpectedMessages != null) { + for (String unexpectedMessage : unexpectedMessages) { + try { + outputAnalyzer.shouldNotMatch(unexpectedMessage); + } catch (RuntimeException e) { + String errorMessage = String.format( + "Unexpected message found: '%s'.%n%s", + unexpectedMessage, wrongWarningMessage); + throw new AssertionError(errorMessage, e); + } + } + } + } + + /** + * Verifies that JVM startup behavior matches our expectations when type + * of newly started VM is the same as the type of current. + * + * @param expectedMessages an array of patterns that should occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not + * occur in JVM output. If {@code null} then + * JVM output could be empty. + * @param exitErrorMessage Message that will be shown if exit value is not + * as expected. + * @param wrongWarningMessage message that will be shown if warning + * messages are not as expected. + * @param exitCode expected exit code. + * @param options options that should be passed to VM in addition to mode + * flag. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifySameJVMStartup(String expectedMessages[], + String unexpectedMessages[], String exitErrorMessage, + String wrongWarningMessage, ExitCode exitCode, String... options) + throws Throwable { + List finalOptions = new ArrayList<>(); + finalOptions.add(CommandLineOptionTest.getVMTypeOption()); + Collections.addAll(finalOptions, options); + + CommandLineOptionTest.verifyJVMStartup(expectedMessages, + unexpectedMessages, exitErrorMessage, + wrongWarningMessage, exitCode, false, + finalOptions.toArray(new String[finalOptions.size()])); + } + + /** + * Verifies that value of specified JVM option is the same as + * expected value. + * This method filter out option with {@code optionName} + * name from test java options. + * + * @param optionName a name of tested option. + * @param expectedValue expected value of tested option. + * @param optionErrorString message will be shown if option value is not as + * expected. + * @param additionalVMOpts additional options that should be + * passed to JVM. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyOptionValue(String optionName, + String expectedValue, String optionErrorString, + String... additionalVMOpts) throws Throwable { + verifyOptionValue(optionName, expectedValue, optionErrorString, + true, additionalVMOpts); + } + + /** + * Verifies that value of specified JVM option is the same as + * expected value. + * This method filter out option with {@code optionName} + * name from test java options. + * + * @param optionName a name of tested option. + * @param expectedValue expected value of tested option. + * @param addTestVmOptions if {@code true}, then test VM options + * will be used. + * @param optionErrorString message will be shown if option value is not as + * expected. + * @param additionalVMOpts additional options that should be + * passed to JVM. + * @throws Throwable if verification fails or some other issues + * occur. + */ + public static void verifyOptionValue(String optionName, + String expectedValue, String optionErrorString, + boolean addTestVmOptions, String... additionalVMOpts) + throws Throwable { + List vmOpts = new ArrayList<>(); + + if (addTestVmOptions) { + Collections.addAll(vmOpts, + Utils.getFilteredTestJavaOpts(optionName)); + } + Collections.addAll(vmOpts, additionalVMOpts); + Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version"); + + ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + vmOpts.toArray(new String[vmOpts.size()])); + + OutputAnalyzer outputAnalyzer + = new OutputAnalyzer(processBuilder.start()); + + try { + outputAnalyzer.shouldHaveExitValue(0); + } catch (RuntimeException e) { + String errorMessage = String.format( + "JVM should start with option '%s' without errors.", + optionName); + throw new AssertionError(errorMessage, e); + } + verifyOptionValue(optionName, expectedValue, optionErrorString, + outputAnalyzer); + } + + /** + * Verifies that value of specified JVM option is the same as + * expected value. + * + * @param optionName a name of tested option. + * @param expectedValue expected value of tested option. + * @param optionErrorString message will be shown if option value is not + * as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails + */ + public static void verifyOptionValue(String optionName, + String expectedValue, String optionErrorString, + OutputAnalyzer outputAnalyzer) { + try { + outputAnalyzer.shouldMatch(String.format( + CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, + optionName, expectedValue)); + } catch (RuntimeException e) { + String errorMessage = String.format( + "Option '%s' is expected to have '%s' value%n%s", + optionName, expectedValue, + optionErrorString); + throw new AssertionError(errorMessage, e); + } + } + + /** + * Start VM with given options and values. + * Generates command line option flags from + * {@code optionNames} and {@code optionValues}. + * + * @param optionNames names of options to pass in + * @param optionValues values of option + * @param additionalVMOpts additional options that should be + * passed to JVM. + * @return output from vm process + */ + public static OutputAnalyzer startVMWithOptions(String[] optionNames, + String[] optionValues, + String... additionalVMOpts) throws Throwable { + List vmOpts = new ArrayList<>(); + if (optionNames == null || optionValues == null || optionNames.length != optionValues.length) { + throw new IllegalArgumentException("optionNames and/or optionValues"); + } + + for (int i = 0; i < optionNames.length; i++) { + vmOpts.add(prepareFlag(optionNames[i], optionValues[i])); + } + Collections.addAll(vmOpts, additionalVMOpts); + Collections.addAll(vmOpts, "-version"); + + ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + vmOpts.toArray(new String[vmOpts.size()])); + + return new OutputAnalyzer(processBuilder.start()); + } + + /** + * Verifies from the output that values of specified JVM options were the same as + * expected values. + * + * @param outputAnalyzer search output for expect options and values. + * @param optionNames names of tested options. + * @param expectedValues expected values of tested options. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyOptionValuesFromOutput(OutputAnalyzer outputAnalyzer, + String[] optionNames, + String[] expectedValues) throws Throwable { + outputAnalyzer.shouldHaveExitValue(0); + for (int i = 0; i < optionNames.length; i++) { + outputAnalyzer.shouldMatch(String.format( + CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, + optionNames[i], expectedValues[i])); + } + } + + /** + * Verifies that value of specified JVM options are the same as + * expected values. + * Generates command line option flags from + * {@code optionNames} and {@code expectedValues}. + * + * @param optionNames names of tested options. + * @param expectedValues expected values of tested options. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyOptionValues(String[] optionNames, + String[] expectedValues) throws Throwable { + OutputAnalyzer outputAnalyzer = startVMWithOptions(optionNames, expectedValues, "-XX:+PrintFlagsFinal"); + verifyOptionValuesFromOutput(outputAnalyzer, optionNames, expectedValues); + } + + /** + * Verifies that value of specified JVM when type of newly started VM + * is the same as the type of current. + * This method filter out option with {@code optionName} + * name from test java options. + * Only mode flag will be passed to VM in addition to + * {@code additionalVMOpts} + * + * @param optionName name of tested option. + * @param expectedValue expected value of tested option. + * @param optionErrorString message to show if option has another value + * @param additionalVMOpts additional options that should be + * passed to JVM. + * @throws Throwable if verification fails or some other issues occur. + */ + public static void verifyOptionValueForSameVM(String optionName, + String expectedValue, String optionErrorString, + String... additionalVMOpts) throws Throwable { + List finalOptions = new ArrayList<>(); + finalOptions.add(CommandLineOptionTest.getVMTypeOption()); + Collections.addAll(finalOptions, additionalVMOpts); + + CommandLineOptionTest.verifyOptionValue(optionName, expectedValue, + optionErrorString, false, + finalOptions.toArray(new String[finalOptions.size()])); + } + + /** + * Prepares boolean command line flag with name {@code name} according + * to it's {@code value}. + * + * @param name the name of option to be prepared + * @param value the value of option + * @return prepared command line flag + */ + public static String prepareBooleanFlag(String name, boolean value) { + return String.format("-XX:%c%s", (value ? '+' : '-'), name); + } + + /** + * Prepares numeric command line flag with name {@code name} by setting + * it's value to {@code value}. + * + * @param name the name of option to be prepared + * @param value the value of option + * @return prepared command line flag + */ + public static String prepareNumericFlag(String name, Number value) { + return String.format("-XX:%s=%s", name, value.toString()); + } + + /** + * Prepares generic command line flag with name {@code name} by setting + * it's value to {@code value}. + * + * @param name the name of option to be prepared + * @param value the value of option ("+" or "-" can be used instead of "true" or "false") + * @return prepared command line flag + */ + public static String prepareFlag(String name, String value) { + if (value.equals("+") || value.equalsIgnoreCase("true")) { + return "-XX:+" + name; + } else if (value.equals("-") || value.equalsIgnoreCase("false")) { + return "-XX:-" + name; + } else { + return "-XX:" + name + "=" + value; + } + } + + /** + * Returns message that should occur in VM output if option + * {@code optionName} if unrecognized. + * + * @param optionName the name of option for which message should be returned + * @return message saying that option {@code optionName} is unrecognized + */ + public static String getUnrecognizedOptionErrorMessage(String optionName) { + return String.format( + CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT, + optionName); + } + + /** + * Returns message that should occur in VM output if option + * {@code optionName} is experimental and + * -XX:+UnlockExperimentalVMOptions was not passed to VM. + * + * @param optionName the name of option for which message should be returned + * @return message saying that option {@code optionName} is experimental + */ + public static String getExperimentalOptionErrorMessage(String optionName) { + return String.format( + CommandLineOptionTest.EXPERIMENTAL_OPTION_ERROR_FORMAT, + optionName); + } + + /** + * Returns message that should occur in VM output if option + * {@code optionName} is diagnostic and -XX:+UnlockDiagnosticVMOptions + * was not passed to VM. + * + * @param optionName the name of option for which message should be returned + * @return message saying that option {@code optionName} is diganostic + */ + public static String getDiagnosticOptionErrorMessage(String optionName) { + return String.format( + CommandLineOptionTest.DIAGNOSTIC_OPTION_ERROR_FORMAT, + optionName); + } + + /** + * @return option required to start a new VM with the same type as current. + * @throws RuntimeException when VM type is unknown. + */ + private static String getVMTypeOption() { + if (Platform.isServer()) { + return "-server"; + } else if (Platform.isClient()) { + return "-client"; + } else if (Platform.isMinimal()) { + return "-minimal"; + } else if (Platform.isGraal()) { + return "-graal"; + } + throw new RuntimeException("Unknown VM mode."); + } + + private final BooleanSupplier predicate; + + /** + * Constructs new CommandLineOptionTest that will be executed only if + * predicate {@code predicate} return {@code true}. + * @param predicate a predicate responsible for test's preconditions check. + */ + public CommandLineOptionTest(BooleanSupplier predicate) { + this.predicate = predicate; + } + + /** + * Runs command line option test. + */ + public final void test() throws Throwable { + if (predicate.getAsBoolean()) { + runTestCases(); + } + } + + /** + * @throws Throwable if some issue happened during test cases execution. + */ + protected abstract void runTestCases() throws Throwable; +} diff --git a/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java b/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java new file mode 100644 index 00000000000..1e70abc2e00 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java @@ -0,0 +1,41 @@ +/* + * 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 jdk.test.lib.cli.predicate; + +import java.util.function.BooleanSupplier; + +public class AndPredicate implements BooleanSupplier { + private final BooleanSupplier a; + private final BooleanSupplier b; + + public AndPredicate(BooleanSupplier a, BooleanSupplier b) { + this.a = a; + this.b = b; + } + + @Override + public boolean getAsBoolean() { + return a.getAsBoolean() && b.getAsBoolean(); + } +} diff --git a/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java new file mode 100644 index 00000000000..69f753f5a84 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java @@ -0,0 +1,71 @@ +/* + * 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 jdk.test.lib.cli.predicate; + +import jdk.test.lib.Platform; +import sun.hotspot.cpuinfo.CPUInfo; + +import java.util.function.BooleanSupplier; + +public class CPUSpecificPredicate implements BooleanSupplier { + private final String cpuArchPattern; + private final String supportedCPUFeatures[]; + private final String unsupportedCPUFeatures[]; + + public CPUSpecificPredicate(String cpuArchPattern, + String supportedCPUFeatures[], + String unsupportedCPUFeatures[]) { + this.cpuArchPattern = cpuArchPattern; + this.supportedCPUFeatures = supportedCPUFeatures; + this.unsupportedCPUFeatures = unsupportedCPUFeatures; + } + + @Override + public boolean getAsBoolean() { + if (!Platform.getOsArch().matches(cpuArchPattern)) { + System.out.println("CPU arch " + Platform.getOsArch() + " does not match " + cpuArchPattern); + return false; + } + + if (supportedCPUFeatures != null) { + for (String feature : supportedCPUFeatures) { + if (!CPUInfo.hasFeature(feature)) { + System.out.println("CPU does not support " + feature + + " feature"); + return false; + } + } + } + + if (unsupportedCPUFeatures != null) { + for (String feature : unsupportedCPUFeatures) { + if (CPUInfo.hasFeature(feature)) { + System.out.println("CPU support " + feature + " feature"); + return false; + } + } + } + return true; + } +} diff --git a/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java b/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java new file mode 100644 index 00000000000..481f878e228 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/predicate/NotPredicate.java @@ -0,0 +1,40 @@ +/* + * 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 jdk.test.lib.cli.predicate; + +import java.util.function.BooleanSupplier; + +public class NotPredicate implements BooleanSupplier { + private final BooleanSupplier s; + + public NotPredicate(BooleanSupplier s) { + this.s = s; + } + + @Override + public boolean getAsBoolean() { + return !s.getAsBoolean(); + } +} diff --git a/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java b/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java new file mode 100644 index 00000000000..35f5e979966 --- /dev/null +++ b/test/lib/jdk/test/lib/cli/predicate/OrPredicate.java @@ -0,0 +1,42 @@ +/* + * 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 jdk.test.lib.cli.predicate; + +import java.util.function.BooleanSupplier; + +public class OrPredicate implements BooleanSupplier { + private final BooleanSupplier a; + private final BooleanSupplier b; + + public OrPredicate(BooleanSupplier a, BooleanSupplier b) { + this.a = a; + this.b = b; + } + + @Override + public boolean getAsBoolean() { + return a.getAsBoolean() || b.getAsBoolean(); + } +} diff --git a/test/lib/jdk/test/lib/dcmd/CommandExecutor.java b/test/lib/jdk/test/lib/dcmd/CommandExecutor.java new file mode 100644 index 00000000000..e8c5791f487 --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/CommandExecutor.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import jdk.test.lib.process.OutputAnalyzer; + +/** + * Abstract base class for Diagnostic Command executors + */ +public abstract class CommandExecutor { + + /** + * Execute a diagnostic command + * + * @param cmd The diagnostic command to execute + * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command + * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the + * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in + * stderr, regardless of the specific executor used. + */ + public final OutputAnalyzer execute(String cmd) throws CommandExecutorException { + return execute(cmd, false); + } + + /** + * Execute a diagnostic command + * + * @param cmd The diagnostic command to execute + * @param silent Do not print the command output + * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command + * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the + * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in + * stderr, regardless of the specific executor used. + */ + public final OutputAnalyzer execute(String cmd, boolean silent) throws CommandExecutorException { + if (!silent) { + System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName()); + } + + OutputAnalyzer oa = executeImpl(cmd); + + if (!silent) { + System.out.println("---------------- stdout ----------------"); + System.out.println(oa.getStdout()); + System.out.println("---------------- stderr ----------------"); + System.out.println(oa.getStderr()); + System.out.println("----------------------------------------"); + System.out.println(); + } + return oa; + } + + protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException; +} diff --git a/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java b/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java new file mode 100644 index 00000000000..89aa1b3dee0 --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/CommandExecutorException.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +/** + * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic + * Commands + */ +public class CommandExecutorException extends RuntimeException { + private static final long serialVersionUID = -7039597746579144280L; + + public CommandExecutorException(String message, Throwable e) { + super(message, e); + } +} diff --git a/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java new file mode 100644 index 00000000000..563b65fd20e --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/FileJcmdExecutor.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Arrays; +import java.util.List; + +/** + * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read + * Diagnostic Commands from a file. + */ +public class FileJcmdExecutor extends PidJcmdExecutor { + + /** + * Instantiates a new FileJcmdExecutor targeting the current VM + */ + public FileJcmdExecutor() { + super(); + } + + /** + * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid + * + * @param target Pid of the target VM + */ + public FileJcmdExecutor(String target) { + super(target); + } + + protected List createCommandLine(String cmd) throws CommandExecutorException { + File cmdFile = createTempFile(); + writeCommandToTemporaryFile(cmd, cmdFile); + + return Arrays.asList(jcmdBinary, Long.toString(pid), + "-f", cmdFile.getAbsolutePath()); + } + + private void writeCommandToTemporaryFile(String cmd, File cmdFile) { + try (PrintWriter pw = new PrintWriter(cmdFile)) { + pw.println(cmd); + } catch (IOException e) { + String message = "Could not write to file: " + cmdFile.getAbsolutePath(); + throw new CommandExecutorException(message, e); + } + } + + private File createTempFile() { + try { + File cmdFile = File.createTempFile("input", "jcmd"); + cmdFile.deleteOnExit(); + return cmdFile; + } catch (IOException e) { + throw new CommandExecutorException("Could not create temporary file", e); + } + } + +} diff --git a/test/lib/jdk/test/lib/dcmd/JMXExecutor.java b/test/lib/jdk/test/lib/dcmd/JMXExecutor.java new file mode 100644 index 00000000000..677b5db0def --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/JMXExecutor.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import jdk.test.lib.process.OutputAnalyzer; + +import javax.management.*; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +import java.lang.management.ManagementFactory; + +import java.util.HashMap; + +/** + * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using + * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand. + */ +public class JMXExecutor extends CommandExecutor { + + private final MBeanServerConnection mbs; + + /** + * Instantiates a new JMXExecutor targeting the current VM + */ + public JMXExecutor() { + super(); + mbs = ManagementFactory.getPlatformMBeanServer(); + } + + /** + * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX + * Service URL + * + * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM + */ + public JMXExecutor(String target) { + String urlStr; + + if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) { + /* Matches "hostname:port" */ + urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target); + } else if (target.startsWith("service:")) { + urlStr = target; + } else { + throw new IllegalArgumentException("Could not recognize target string: " + target); + } + + try { + JMXServiceURL url = new JMXServiceURL(urlStr); + JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>()); + mbs = c.getMBeanServerConnection(); + } catch (IOException e) { + throw new CommandExecutorException("Could not initiate connection to target: " + target, e); + } + } + + protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException { + String stdout = ""; + String stderr = ""; + + String[] cmdParts = cmd.split(" ", 2); + String operation = commandToMethodName(cmdParts[0]); + Object[] dcmdArgs = produceArguments(cmdParts); + String[] signature = {String[].class.getName()}; + + ObjectName beanName = getMBeanName(); + + try { + stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature); + } + + /* Failures on the "local" side, the one invoking the command. */ + catch (ReflectionException e) { + Throwable cause = e.getCause(); + if (cause instanceof NoSuchMethodException) { + /* We want JMXExecutor to match the behavior of the other CommandExecutors */ + String message = "Unknown diagnostic command: " + operation; + stderr = exceptionTraceAsString(new IllegalArgumentException(message, e)); + } else { + rethrowExecutorException(operation, dcmdArgs, e); + } + } + + /* Failures on the "local" side, the one invoking the command. */ + catch (InstanceNotFoundException | IOException e) { + rethrowExecutorException(operation, dcmdArgs, e); + } + + /* Failures on the remote side, the one executing the invoked command. */ + catch (MBeanException e) { + stdout = exceptionTraceAsString(e); + } + + return new OutputAnalyzer(stdout, stderr); + } + + private void rethrowExecutorException(String operation, Object[] dcmdArgs, + Exception e) throws CommandExecutorException { + String message = String.format("Could not invoke: %s %s", operation, + String.join(" ", (String[]) dcmdArgs[0])); + throw new CommandExecutorException(message, e); + } + + private ObjectName getMBeanName() throws CommandExecutorException { + String MBeanName = "com.sun.management:type=DiagnosticCommand"; + + try { + return new ObjectName(MBeanName); + } catch (MalformedObjectNameException e) { + String message = "MBean not found: " + MBeanName; + throw new CommandExecutorException(message, e); + } + } + + private Object[] produceArguments(String[] cmdParts) { + Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */ + + if (cmdParts.length == 2) { + dcmdArgs[0] = cmdParts[1].split(" "); + } + return dcmdArgs; + } + + /** + * Convert from diagnostic command to MBean method name + * + * Examples: + * help --> help + * VM.version --> vmVersion + * VM.command_line --> vmCommandLine + */ + private static String commandToMethodName(String cmd) { + String operation = ""; + boolean up = false; /* First letter is to be lower case */ + + /* + * If a '.' or '_' is encountered it is not copied, + * instead the next character will be converted to upper case + */ + for (char c : cmd.toCharArray()) { + if (('.' == c) || ('_' == c)) { + up = true; + } else if (up) { + operation = operation.concat(Character.toString(c).toUpperCase()); + up = false; + } else { + operation = operation.concat(Character.toString(c).toLowerCase()); + } + } + + return operation; + } + + private static String exceptionTraceAsString(Throwable cause) { + StringWriter sw = new StringWriter(); + cause.printStackTrace(new PrintWriter(sw)); + return sw.toString(); + } + +} diff --git a/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java new file mode 100644 index 00000000000..6bf940cda6e --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/JcmdExecutor.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import java.util.List; + +/** + * Base class for Diagnostic Command Executors using the jcmd tool + */ +public abstract class JcmdExecutor extends CommandExecutor { + protected String jcmdBinary; + + protected abstract List createCommandLine(String cmd) throws CommandExecutorException; + + protected JcmdExecutor() { + jcmdBinary = JDKToolFinder.getJDKTool("jcmd"); + } + + protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException { + List commandLine = createCommandLine(cmd); + + try { + System.out.printf("Executing command '%s'%n", commandLine); + OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine)); + System.out.printf("Command returned with exit code %d%n", output.getExitValue()); + + return output; + } catch (Exception e) { + String message = String.format("Caught exception while executing '%s'", commandLine); + throw new CommandExecutorException(message, e); + } + } +} diff --git a/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java new file mode 100644 index 00000000000..84608c11632 --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/MainClassJcmdExecutor.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import java.util.Arrays; +import java.util.List; + +/** + * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool + */ +public class MainClassJcmdExecutor extends JcmdExecutor { + private final String mainClass; + + /** + * Instantiates a new MainClassJcmdExecutor targeting the current VM + */ + public MainClassJcmdExecutor() { + super(); + mainClass = System.getProperty("sun.java.command").split(" ")[0]; + } + + /** + * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class + * + * @param target Main class of the target VM + */ + public MainClassJcmdExecutor(String target) { + super(); + mainClass = target; + } + + protected List createCommandLine(String cmd) throws CommandExecutorException { + return Arrays.asList(jcmdBinary, mainClass, cmd); + } + +} diff --git a/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java b/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java new file mode 100644 index 00000000000..25b3f532fc6 --- /dev/null +++ b/test/lib/jdk/test/lib/dcmd/PidJcmdExecutor.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.dcmd; + +import jdk.test.lib.process.ProcessTools; + +import java.util.Arrays; +import java.util.List; + +/** + * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool + */ +public class PidJcmdExecutor extends JcmdExecutor { + protected final long pid; + + /** + * Instantiates a new PidJcmdExecutor targeting the current VM + */ + public PidJcmdExecutor() { + super(); + try { + pid = ProcessTools.getProcessId(); + } catch (Exception e) { + throw new CommandExecutorException("Could not determine own pid", e); + } + } + + /** + * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid + * + * @param target Pid of the target VM + */ + public PidJcmdExecutor(String target) { + super(); + pid = Long.valueOf(target); + } + + protected List createCommandLine(String cmd) throws CommandExecutorException { + return Arrays.asList(jcmdBinary, Long.toString(pid), cmd); + } + +} diff --git a/test/lib/share/classes/jdk/test/lib/hprof/HprofParser.java b/test/lib/jdk/test/lib/hprof/HprofParser.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/HprofParser.java rename to test/lib/jdk/test/lib/hprof/HprofParser.java index cb39c0d9ac0..88841f9e6d4 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/HprofParser.java +++ b/test/lib/jdk/test/lib/hprof/HprofParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/README b/test/lib/jdk/test/lib/hprof/README similarity index 100% rename from test/lib/share/classes/jdk/test/lib/hprof/README rename to test/lib/jdk/test/lib/hprof/README diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java index dcaf3624085..4624347ff6b 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java +++ b/test/lib/jdk/test/lib/hprof/model/AbstractJavaHeapObjectVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/ArrayTypeCodes.java b/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/ArrayTypeCodes.java rename to test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java index d3c9a9eaeb4..c6ac3ac372a 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/ArrayTypeCodes.java +++ b/test/lib/jdk/test/lib/hprof/model/ArrayTypeCodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/HackJavaValue.java b/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/HackJavaValue.java rename to test/lib/jdk/test/lib/hprof/model/HackJavaValue.java index fda40a9c07f..6da7b2df648 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/HackJavaValue.java +++ b/test/lib/jdk/test/lib/hprof/model/HackJavaValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaBoolean.java b/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaBoolean.java rename to test/lib/jdk/test/lib/hprof/model/JavaBoolean.java index 3c298457856..e96766ddba6 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaBoolean.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaByte.java b/test/lib/jdk/test/lib/hprof/model/JavaByte.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaByte.java rename to test/lib/jdk/test/lib/hprof/model/JavaByte.java index aa32ca532c2..e4a1d330008 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaByte.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaChar.java b/test/lib/jdk/test/lib/hprof/model/JavaChar.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaChar.java rename to test/lib/jdk/test/lib/hprof/model/JavaChar.java index 629af171d9e..7c04f503efd 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaChar.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaClass.java b/test/lib/jdk/test/lib/hprof/model/JavaClass.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaClass.java rename to test/lib/jdk/test/lib/hprof/model/JavaClass.java index c25e8adcf79..c2a9563e0aa 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaClass.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaDouble.java b/test/lib/jdk/test/lib/hprof/model/JavaDouble.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaDouble.java rename to test/lib/jdk/test/lib/hprof/model/JavaDouble.java index 347fd4f9c86..3b643029896 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaDouble.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaDouble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaField.java b/test/lib/jdk/test/lib/hprof/model/JavaField.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaField.java rename to test/lib/jdk/test/lib/hprof/model/JavaField.java index 87dc48e679b..d343f913abd 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaField.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaFloat.java b/test/lib/jdk/test/lib/hprof/model/JavaFloat.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaFloat.java rename to test/lib/jdk/test/lib/hprof/model/JavaFloat.java index 838b72b2ad5..44692125024 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaFloat.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaFloat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObject.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java index 6ab1242473b..dbe54f0ef28 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObject.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaHeapObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java b/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java rename to test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java index d31d382dab8..77607655a8e 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaHeapObjectVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaInt.java b/test/lib/jdk/test/lib/hprof/model/JavaInt.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaInt.java rename to test/lib/jdk/test/lib/hprof/model/JavaInt.java index 4b2e7d2ad8f..9360f858eb8 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaInt.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaInt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaLazyReadObject.java b/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaLazyReadObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java index 3baaf3ca1dd..5428a2b5ede 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaLazyReadObject.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaLazyReadObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaLong.java b/test/lib/jdk/test/lib/hprof/model/JavaLong.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaLong.java rename to test/lib/jdk/test/lib/hprof/model/JavaLong.java index d86dc50658d..28aca95670b 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaLong.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObject.java b/test/lib/jdk/test/lib/hprof/model/JavaObject.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaObject.java rename to test/lib/jdk/test/lib/hprof/model/JavaObject.java index a419348eff8..74bdb0d6c28 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObject.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectArray.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java index 4ed0afeaea6..98ae116cafb 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectArray.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaObjectArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectRef.java b/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectRef.java rename to test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java index 009c03b0dc7..f0958f7db4c 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaObjectRef.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaObjectRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaShort.java b/test/lib/jdk/test/lib/hprof/model/JavaShort.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaShort.java rename to test/lib/jdk/test/lib/hprof/model/JavaShort.java index d3bf75952b3..7c4e46acc02 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaShort.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaShort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaStatic.java b/test/lib/jdk/test/lib/hprof/model/JavaStatic.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaStatic.java rename to test/lib/jdk/test/lib/hprof/model/JavaStatic.java index b9dc399cf8b..79a5b0d64b7 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaStatic.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaStatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaThing.java b/test/lib/jdk/test/lib/hprof/model/JavaThing.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaThing.java rename to test/lib/jdk/test/lib/hprof/model/JavaThing.java index 5b14eb68b94..2a663ab443e 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaThing.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaThing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaValue.java b/test/lib/jdk/test/lib/hprof/model/JavaValue.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaValue.java rename to test/lib/jdk/test/lib/hprof/model/JavaValue.java index 30ac6653d28..e7cad68b4d0 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaValue.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaValueArray.java b/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/model/JavaValueArray.java rename to test/lib/jdk/test/lib/hprof/model/JavaValueArray.java index 7c0c2c6773f..d65780d527f 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/JavaValueArray.java +++ b/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludes.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludes.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java index 6133e539b80..b95183251ab 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludes.java +++ b/test/lib/jdk/test/lib/hprof/model/ReachableExcludes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludesImpl.java b/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludesImpl.java rename to test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java index 8a15e635523..5038f71ddc0 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableExcludesImpl.java +++ b/test/lib/jdk/test/lib/hprof/model/ReachableExcludesImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableObjects.java b/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/ReachableObjects.java rename to test/lib/jdk/test/lib/hprof/model/ReachableObjects.java index da7a4a1e58a..c3fcd7521d4 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/ReachableObjects.java +++ b/test/lib/jdk/test/lib/hprof/model/ReachableObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/ReferenceChain.java b/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/model/ReferenceChain.java rename to test/lib/jdk/test/lib/hprof/model/ReferenceChain.java index b21ed0bb95e..3b217519447 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/ReferenceChain.java +++ b/test/lib/jdk/test/lib/hprof/model/ReferenceChain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/Root.java b/test/lib/jdk/test/lib/hprof/model/Root.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/model/Root.java rename to test/lib/jdk/test/lib/hprof/model/Root.java index 54a893b9dcd..ae7c08bfeb1 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/Root.java +++ b/test/lib/jdk/test/lib/hprof/model/Root.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java b/test/lib/jdk/test/lib/hprof/model/Snapshot.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java rename to test/lib/jdk/test/lib/hprof/model/Snapshot.java index 6150543b36b..fcef29a1b85 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java +++ b/test/lib/jdk/test/lib/hprof/model/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/StackFrame.java b/test/lib/jdk/test/lib/hprof/model/StackFrame.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/model/StackFrame.java rename to test/lib/jdk/test/lib/hprof/model/StackFrame.java index f6e2996b005..723cf64986e 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/StackFrame.java +++ b/test/lib/jdk/test/lib/hprof/model/StackFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/model/StackTrace.java b/test/lib/jdk/test/lib/hprof/model/StackTrace.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/model/StackTrace.java rename to test/lib/jdk/test/lib/hprof/model/StackTrace.java index d581257430c..75c92fc9cdf 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/model/StackTrace.java +++ b/test/lib/jdk/test/lib/hprof/model/StackTrace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/FileReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/FileReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java index 716b9469868..7beb2e7dd28 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/FileReadBuffer.java +++ b/test/lib/jdk/test/lib/hprof/parser/FileReadBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java b/test/lib/jdk/test/lib/hprof/parser/HprofReader.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java rename to test/lib/jdk/test/lib/hprof/parser/HprofReader.java index 15bd6af7fda..693bec6b9b7 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java +++ b/test/lib/jdk/test/lib/hprof/parser/HprofReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/MappedReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/MappedReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java index b3657e6f0c5..c7247fae68f 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/MappedReadBuffer.java +++ b/test/lib/jdk/test/lib/hprof/parser/MappedReadBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/PositionDataInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/PositionDataInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java index b27e1dc1927..8435dd12a3a 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/PositionDataInputStream.java +++ b/test/lib/jdk/test/lib/hprof/parser/PositionDataInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/PositionInputStream.java b/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/PositionInputStream.java rename to test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java index aecc72629ad..0c0e43de8e5 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/PositionInputStream.java +++ b/test/lib/jdk/test/lib/hprof/parser/PositionInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/ReadBuffer.java b/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/ReadBuffer.java rename to test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java index 99c15e5698f..fe548a74ff8 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/ReadBuffer.java +++ b/test/lib/jdk/test/lib/hprof/parser/ReadBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/Reader.java b/test/lib/jdk/test/lib/hprof/parser/Reader.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/parser/Reader.java rename to test/lib/jdk/test/lib/hprof/parser/Reader.java index 19ddad5997c..5263035df72 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/Reader.java +++ b/test/lib/jdk/test/lib/hprof/parser/Reader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/util/ArraySorter.java b/test/lib/jdk/test/lib/hprof/util/ArraySorter.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/util/ArraySorter.java rename to test/lib/jdk/test/lib/hprof/util/ArraySorter.java index 4101529dabb..04dbad7ff0b 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/util/ArraySorter.java +++ b/test/lib/jdk/test/lib/hprof/util/ArraySorter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/util/Comparer.java b/test/lib/jdk/test/lib/hprof/util/Comparer.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/hprof/util/Comparer.java rename to test/lib/jdk/test/lib/hprof/util/Comparer.java index b6ae50364ee..182f37edf61 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/util/Comparer.java +++ b/test/lib/jdk/test/lib/hprof/util/Comparer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/util/CompositeEnumeration.java b/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/hprof/util/CompositeEnumeration.java rename to test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java index 2c49fad85c1..ddebd0fb3ed 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/util/CompositeEnumeration.java +++ b/test/lib/jdk/test/lib/hprof/util/CompositeEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/util/Misc.java b/test/lib/jdk/test/lib/hprof/util/Misc.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/util/Misc.java rename to test/lib/jdk/test/lib/hprof/util/Misc.java index 98592f634e2..e654d71d4ce 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/util/Misc.java +++ b/test/lib/jdk/test/lib/hprof/util/Misc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/share/classes/jdk/test/lib/hprof/util/VectorSorter.java b/test/lib/jdk/test/lib/hprof/util/VectorSorter.java similarity index 98% rename from test/lib/share/classes/jdk/test/lib/hprof/util/VectorSorter.java rename to test/lib/jdk/test/lib/hprof/util/VectorSorter.java index 112d90959b6..fb2ac13e175 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/util/VectorSorter.java +++ b/test/lib/jdk/test/lib/hprof/util/VectorSorter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/test/lib/jdk/test/lib/process/ExitCode.java b/test/lib/jdk/test/lib/process/ExitCode.java new file mode 100644 index 00000000000..bb66da17911 --- /dev/null +++ b/test/lib/jdk/test/lib/process/ExitCode.java @@ -0,0 +1,40 @@ +/* + * 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 jdk.test.lib.process; + +/** + * Exit code values that could be returned by the JVM. + */ +public enum ExitCode { + OK(0), + FAIL(1), + CRASH(134); + + public final int value; + + ExitCode(int value) { + this.value = value; + } +} + diff --git a/test/lib/share/classes/jdk/test/lib/process/OutputAnalyzer.java b/test/lib/jdk/test/lib/process/OutputAnalyzer.java similarity index 97% rename from test/lib/share/classes/jdk/test/lib/process/OutputAnalyzer.java rename to test/lib/jdk/test/lib/process/OutputAnalyzer.java index fc3a4de2905..97d9ae0db50 100644 --- a/test/lib/share/classes/jdk/test/lib/process/OutputAnalyzer.java +++ b/test/lib/jdk/test/lib/process/OutputAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -374,14 +374,14 @@ public final class OutputAnalyzer { * - exit code * Note: the command line is printed by the ProcessTools */ - private void reportDiagnosticSummary() { - String msg = - " stdout: [" + stdout + "];\n" + - " stderr: [" + stderr + "]\n" + - " exitValue = " + getExitValue() + "\n"; + public void reportDiagnosticSummary() { + String msg = + " stdout: [" + stdout + "];\n" + + " stderr: [" + stderr + "]\n" + + " exitValue = " + getExitValue() + "\n"; - System.err.println(msg); - } + System.err.println(msg); + } /** diff --git a/test/lib/share/classes/jdk/test/lib/process/OutputBuffer.java b/test/lib/jdk/test/lib/process/OutputBuffer.java similarity index 96% rename from test/lib/share/classes/jdk/test/lib/process/OutputBuffer.java rename to test/lib/jdk/test/lib/process/OutputBuffer.java index 23976d8272f..a41e8436ba0 100644 --- a/test/lib/share/classes/jdk/test/lib/process/OutputBuffer.java +++ b/test/lib/jdk/test/lib/process/OutputBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 diff --git a/test/lib/share/classes/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java similarity index 93% rename from test/lib/share/classes/jdk/test/lib/process/ProcessTools.java rename to test/lib/jdk/test/lib/process/ProcessTools.java index 3189a0fe277..3f4bbb7fa79 100644 --- a/test/lib/share/classes/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -28,10 +28,13 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.concurrent.CountDownLatch; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -301,6 +304,16 @@ public final class ProcessTools { public static long getProcessId() throws Exception { return ProcessHandle.current().getPid(); } + /** + * Gets the array of strings containing input arguments passed to the VM + * + * @return arguments + */ + public static String[] getVmInputArgs() { + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + List args = runtime.getInputArguments(); + return args.toArray(new String[args.size()]); + } /** * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris) @@ -342,16 +355,10 @@ public final class ProcessTools { args.add(javapath); Collections.addAll(args, getPlatformSpecificVMArgs()); + args.add("-cp"); + args.add(System.getProperty("java.class.path")); + if (addTestVmAndJavaOptions) { - // -cp is needed to make sure the same classpath is used whether the test is - // run in AgentVM mode or OtherVM mode. It was added to the hotspot version - // of this API as part of 8077608. However, for the jdk version it is only - // added when addTestVmAndJavaOptions is true in order to minimize - // disruption to existing JDK tests, which have yet to be tested with -cp - // being added. At some point -cp should always be added to be consistent - // with what the hotspot version does. - args.add("-cp"); - args.add(System.getProperty("java.class.path")); Collections.addAll(args, Utils.getTestJavaOpts()); } @@ -377,6 +384,26 @@ public final class ProcessTools { } } + /** + * Executes a test jvm process, waits for it to finish and returns the process output. + * The default jvm options from the test's run command, jtreg, test.vm.opts and test.java.opts, are added. + * The java from the test.jdk is used to execute the command. + * + * The command line will be like: + * {test.jdk}/bin/java {test.fromRun.opts} {test.vm.opts} {test.java.opts} cmds + * + * @param cmds User specifed arguments. + * @return The output from the process. + */ + public static OutputAnalyzer executeTestJvmAllArgs(String... cmds) throws Throwable { + List argsList = new ArrayList<>(); + String[] testArgs = getVmInputArgs(); + Collections.addAll(argsList, testArgs); + Collections.addAll(argsList, Utils.addTestJavaOpts(cmds)); + ProcessBuilder pb = createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); + return executeProcess(pb); + } + /** * Executes a test jvm process, waits for it to finish and returns the process output. * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added. diff --git a/test/lib/share/classes/jdk/test/lib/process/StreamPumper.java b/test/lib/jdk/test/lib/process/StreamPumper.java similarity index 99% rename from test/lib/share/classes/jdk/test/lib/process/StreamPumper.java rename to test/lib/jdk/test/lib/process/StreamPumper.java index b1780c4ef08..8dd7f0cf0ec 100644 --- a/test/lib/share/classes/jdk/test/lib/process/StreamPumper.java +++ b/test/lib/jdk/test/lib/process/StreamPumper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 diff --git a/test/lib/jdk/test/lib/util/Pair.java b/test/lib/jdk/test/lib/util/Pair.java new file mode 100644 index 00000000000..ca29586b045 --- /dev/null +++ b/test/lib/jdk/test/lib/util/Pair.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.util; + +import java.util.Objects; + +/** + * Pair - a two element tuple + * + * @param first type + * @param second type + */ +public class Pair { + public final F first; + public final S second; + + public Pair(F first, S second) { + this.first = first; + this.second = second; + } + + @Override + public String toString() { + return "(" + first + ":" + second + ")"; + } + + @Override + public boolean equals(Object other) { + if (other instanceof Pair) { + Pair otherPair = (Pair) other; + return Objects.equals(first, otherPair.first) && + Objects.equals(second, otherPair.second); + } + return false; + } + + @Override + public int hashCode() { + if (first == null) { + return (second == null) ? 0 : second.hashCode(); + } else if (second == null) { + return first.hashCode(); + } else { + return first.hashCode() * 17 + second.hashCode(); + } + } +} diff --git a/test/lib/jdk/test/lib/util/Triple.java b/test/lib/jdk/test/lib/util/Triple.java new file mode 100644 index 00000000000..fbc82532286 --- /dev/null +++ b/test/lib/jdk/test/lib/util/Triple.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2015, 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 jdk.test.lib.util; + +import java.util.Objects; + +/** + * Triple - a three element tuple + * + * @param first element type + * @param second element type + * @param third element type + */ +public class Triple { + private final Pair> container; + + /** + * Constructor + * + * @param first first element of the triple + * @param second second element of the triple + * @param third third element of the triple + */ + public Triple(F first, S second, T third) { + container = new Pair<>(first, new Pair<>(second, third)); + } + + /** + * Gets first element of the triple + */ + public F getFirst() { + return container.first; + } + + /** + * Gets second element of the triple + */ + public S getSecond() { + return container.second.first; + } + + /** + * Gets third element of the triple + */ + public T getThird() { + return container.second.second; + } + + @Override + public int hashCode() { + return container.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Triple) { + Triple objTriple = (Triple) obj; + return Objects.equals(container.first, objTriple.container.first) + && Objects.equals(container.second, + objTriple.container.second); + } + return false; + } + + @Override + public String toString() { + return "(" + getFirst() + " : " + getSecond() + " : " + getThird() + ")"; + } +} diff --git a/test/lib/jdk/test/lib/wrappers/InfiniteLoop.java b/test/lib/jdk/test/lib/wrappers/InfiniteLoop.java new file mode 100644 index 00000000000..dbee901f8c0 --- /dev/null +++ b/test/lib/jdk/test/lib/wrappers/InfiniteLoop.java @@ -0,0 +1,66 @@ +/* + * 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 jdk.test.lib.wrappers; + +import java.util.Objects; + +/** + * Class which runs another Runnable in infinite loop with certain pauses + * between cycles. + */ +public class InfiniteLoop implements Runnable { + private final Runnable target; + private final long mills; + + + /** + * @param target a target to run in a loop + * @param mills the length of pause time in milliseconds + * @throws NullPointerException if target is null + * @throws IllegalArgumentException if the value of millis is negative + */ + public InfiniteLoop(Runnable target, long mills) { + Objects.requireNonNull(target); + if (mills < 0) { + throw new IllegalArgumentException("mills < 0"); + } + this.target = target; + this.mills = mills; + } + + @Override + public void run() { + try { + while (true) { + target.run(); + if (mills > 0) { + Thread.sleep(mills); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new Error(e); + } + } +} diff --git a/test/lib/jdk/test/lib/wrappers/TimeLimitedRunner.java b/test/lib/jdk/test/lib/wrappers/TimeLimitedRunner.java new file mode 100644 index 00000000000..73d53b43b12 --- /dev/null +++ b/test/lib/jdk/test/lib/wrappers/TimeLimitedRunner.java @@ -0,0 +1,86 @@ +/* + * 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 jdk.test.lib.wrappers; + +import java.util.Objects; +import java.util.concurrent.Callable; + +/** + * Auxiliary class to run target w/ given timeout. + */ +public class TimeLimitedRunner implements Callable { + private final long stoptime; + private final long timeout; + private final double factor; + private final Callable target; + + /** + * @param timeout a timeout. zero means no time limitation + * @param factor a multiplier used to estimate next iteration time + * @param target a target to run + * @throws NullPointerException if target is null + * @throws IllegalArgumentException if timeout is negative or + factor isn't positive + */ + public TimeLimitedRunner(long timeout, double factor, + Callable target) { + Objects.requireNonNull(target, "target must not be null"); + if (timeout < 0) { + throw new IllegalArgumentException("timeout[" + timeout + "] < 0"); + } + if (factor <= 0d) { + throw new IllegalArgumentException("factor[" + factor + "] <= 0"); + } + this.stoptime = System.currentTimeMillis() + timeout; + this.timeout = timeout; + this.factor = factor; + this.target = target; + } + + /** + * Runs @{linkplan target} while it returns true and timeout isn't exceeded + */ + @Override + public Void call() throws Exception { + long maxDuration = 0L; + long iterStart = System.currentTimeMillis(); + if (timeout != 0 && iterStart > stoptime) { + return null; + } + while (target.call()) { + if (timeout != 0) { + long iterDuration = System.currentTimeMillis() - iterStart; + maxDuration = Math.max(maxDuration, iterDuration); + iterStart = System.currentTimeMillis(); + if (iterStart + (maxDuration * factor) > stoptime) { + System.out.println("Not enough time to continue execution. " + + "Interrupted."); + break; + } + } + } + return null; + } + +} From 3b21f492f9ffe57c5fb658f9e6419a25cd74523a Mon Sep 17 00:00:00 2001 From: Karen Kinnear Date: Fri, 19 Aug 2016 11:32:43 -0400 Subject: [PATCH 19/99] 8163808: Fix asserts and logging for old classfile vtable construction Reviewed-by: coleenp, lfoltan, rprotacio, ctornqvi --- .../share/vm/classfile/classFileParser.cpp | 1 + hotspot/src/share/vm/oops/klassVtable.cpp | 61 ++++-- hotspot/src/share/vm/oops/klassVtable.hpp | 10 +- .../TransitiveOverrideCFV50.java | 200 ++++++++++++++++++ hotspot/test/runtime/logging/VtablesTest.java | 4 +- 5 files changed, 251 insertions(+), 25 deletions(-) create mode 100644 hotspot/test/runtime/TransitiveOverrideCFV50/TransitiveOverrideCFV50.java diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 0028f1ae37d..30262696a8c 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -5844,6 +5844,7 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st _super_klass, _methods, _access_flags, + _major_version, _loader_data->class_loader(), _class_name, _local_interfaces, diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index 73db3001d34..c3118cc24e6 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -60,7 +60,7 @@ bool klassVtable::is_preinitialized_vtable() { void klassVtable::compute_vtable_size_and_num_mirandas( int* vtable_length_ret, int* num_new_mirandas, GrowableArray* all_mirandas, const Klass* super, - Array* methods, AccessFlags class_flags, + Array* methods, AccessFlags class_flags, u2 major_version, Handle classloader, Symbol* classname, Array* local_interfaces, TRAPS) { NoSafepointVerifier nsv; @@ -77,7 +77,7 @@ void klassVtable::compute_vtable_size_and_num_mirandas( assert(methods->at(i)->is_method(), "must be a Method*"); methodHandle mh(THREAD, methods->at(i)); - if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, THREAD)) { + if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, major_version, THREAD)) { vtable_length += vtableEntry::size(); // we need a new entry } } @@ -256,10 +256,15 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) { // In class hierarchies where the accessibility is not increasing (i.e., going from private -> // package_private -> public/protected), the vtable might actually be smaller than our initial - // calculation. - assert(initialized <= _length, "vtable initialization failed"); - for(;initialized < _length; initialized++) { - put_method_at(NULL, initialized); + // calculation, for classfile versions for which we do not do transitive override + // calculations. + if (ik()->major_version() >= VTABLE_TRANSITIVE_OVERRIDE_VERSION) { + assert(initialized == _length, "vtable initialization failed"); + } else { + assert(initialized <= _length, "vtable initialization failed"); + for(;initialized < _length; initialized++) { + table()[initialized].clear(); + } } NOT_PRODUCT(verify(tty, true)); } @@ -298,9 +303,9 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper ResourceMark rm(THREAD); outputStream* logst = Log(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); - logst->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", + logst->print("transitive overriding superclass %s with %s index %d, original flags: ", supersuperklass->internal_name(), - _klass->internal_name(), sig, vtable_index); + sig, vtable_index); super_method->print_linkage_flags(logst); logst->print("overriders flags: "); target_method->print_linkage_flags(logst); @@ -330,11 +335,11 @@ static void log_vtables(int i, bool overrides, methodHandle target_method, outputStream* logst = Log(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); if (overrides) { - logst->print("overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig, i); + logst->print("overriding with %s index %d, original flags: ", + sig, i); } else { - logst->print("NOT overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig, i); + logst->print("NOT overriding with %s index %d, original flags: ", + sig, i); } super_method->print_linkage_flags(logst); logst->print("overriders flags: "); @@ -566,6 +571,7 @@ bool klassVtable::needs_new_vtable_entry(methodHandle target_method, Handle classloader, Symbol* classname, AccessFlags class_flags, + u2 major_version, TRAPS) { if (class_flags.is_interface()) { // Interfaces do not use vtables, except for java.lang.Object methods, @@ -646,8 +652,12 @@ bool klassVtable::needs_new_vtable_entry(methodHandle target_method, } } - // Start with lookup result and continue to search up - k = superk->super(); // haven't found an override match yet; continue to look + // Start with lookup result and continue to search up, for versions supporting transitive override + if (major_version >= VTABLE_TRANSITIVE_OVERRIDE_VERSION) { + k = superk->super(); // haven't found an override match yet; continue to look + } else { + break; + } } // if the target method is public or protected it may have a matching @@ -1500,15 +1510,22 @@ void klassVtable::print() { void vtableEntry::verify(klassVtable* vt, outputStream* st) { NOT_PRODUCT(FlagSetting fs(IgnoreLockingAssertions, true)); - assert(method() != NULL, "must have set method"); - method()->verify(); - // we sub_type, because it could be a miranda method - if (!vt->klass()->is_subtype_of(method()->method_holder())) { -#ifndef PRODUCT - print(); -#endif - fatal("vtableEntry " PTR_FORMAT ": method is from subclass", p2i(this)); + KlassHandle vtklass_h = vt->klass(); + Klass* vtklass = vtklass_h(); + if (vtklass->is_instance_klass() && + (InstanceKlass::cast(vtklass)->major_version() >= klassVtable::VTABLE_TRANSITIVE_OVERRIDE_VERSION)) { + assert(method() != NULL, "must have set method"); } + if (method() != NULL) { + method()->verify(); + // we sub_type, because it could be a miranda method + if (!vtklass_h->is_subtype_of(method()->method_holder())) { +#ifndef PRODUCT + print(); +#endif + fatal("vtableEntry " PTR_FORMAT ": method is from subclass", p2i(this)); + } + } } #ifndef PRODUCT diff --git a/hotspot/src/share/vm/oops/klassVtable.hpp b/hotspot/src/share/vm/oops/klassVtable.hpp index 8d33f7960ee..06e84034214 100644 --- a/hotspot/src/share/vm/oops/klassVtable.hpp +++ b/hotspot/src/share/vm/oops/klassVtable.hpp @@ -90,6 +90,7 @@ class klassVtable : public ResourceObj { const Klass* super, Array* methods, AccessFlags class_flags, + u2 major_version, Handle classloader, Symbol* classname, Array* local_interfaces, @@ -115,8 +116,14 @@ class klassVtable : public ResourceObj { protected: friend class vtableEntry; - private: + + public: + // Transitive overridng rules for class files < JDK1_7 use the older JVMS rules. + // Overriding is determined as we create the vtable, so we use the class file version + // of the class whose vtable we are calculating. enum { VTABLE_TRANSITIVE_OVERRIDE_VERSION = 51 } ; + + private: void copy_vtable_to(vtableEntry* start); int initialize_from_super(KlassHandle super); int index_of(Method* m, int len) const; // same as index_of, but search only up to len @@ -126,6 +133,7 @@ class klassVtable : public ResourceObj { Handle classloader, Symbol* classname, AccessFlags access_flags, + u2 major_version, TRAPS); bool update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, int super_vtable_len, int default_index, bool checkconstraints, TRAPS); diff --git a/hotspot/test/runtime/TransitiveOverrideCFV50/TransitiveOverrideCFV50.java b/hotspot/test/runtime/TransitiveOverrideCFV50/TransitiveOverrideCFV50.java new file mode 100644 index 00000000000..909b694d8bc --- /dev/null +++ b/hotspot/test/runtime/TransitiveOverrideCFV50/TransitiveOverrideCFV50.java @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test 8163808 + * @modules java.base/jdk.internal.org.objectweb.asm + * @run main TransitiveOverrideCFV50 + */ + +import java.util.*; +import java.io.File; +import java.io.FileOutputStream; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.AnnotationVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +/* + * Test mixed classfile version overriding handling. + * Key is to generate P2/C with an older classfile version <=50 + * Correct response is B.m:2 for older classfiles + * This test was added to ensure no assertions in debug + * note: for P2/C classfile version >=51, correct answer becomes C.m:3 + * public class P1.A { public int m() { return 1; } + * + * public class P1.B extends A { int m() { return 2; } + * + * public class P2.c extends P1.B { public int m() { return 3; } + */ + +public class TransitiveOverrideCFV50 implements Opcodes{ + static final String classP1A = "P1.A"; + static final String classP1B = "P1.B"; + static final String classP2C = "P2.C"; + + static final String callerName = classP2C; + + public static void main(String[] args) throws Exception { + ClassLoader cl = new ClassLoader() { + public Class loadClass(String name) throws ClassNotFoundException { + if (findLoadedClass(name) != null) { + return findLoadedClass(name); + } + + if (classP1A.equals(name)) { + byte[] classFile = dumpP1A(); + return defineClass(classP1A, classFile, 0, classFile.length); + } + if (classP1B.equals(name)) { + byte[] classFile = dumpP1B(); + return defineClass(classP1B, classFile, 0, classFile.length); + } + if (classP2C.equals(name)) { + byte[] classFile = dumpP2C(); + return defineClass(classP2C, classFile, 0, classFile.length); + } + + return super.loadClass(name); + } + }; + + cl.loadClass(classP1A); + cl.loadClass(classP1B); + cl.loadClass(classP2C); + + //cl.loadClass(callerName).getDeclaredMethod("test"); + cl.loadClass(callerName).newInstance(); + + int result = (Integer)cl.loadClass(callerName).getDeclaredMethod("test").invoke(null); + if (result != 2) { + throw new RuntimeException("expected B.m:2, got " + result); + } + } + + public static byte[] dumpP1A() { + + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "P1/A", null, "java/lang/Object", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); + mv.visitLdcInsn("A.m"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); + mv.visitIntInsn(BIPUSH, 1); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 1); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + public static byte[] dumpP1B() { + + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "P1/B", null, "P1/A", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "P1/A", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(0, "m", "()I", null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); + mv.visitLdcInsn("B.m"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); + mv.visitIntInsn(BIPUSH, 2); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 1); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + public static byte[] dumpP2C() { + + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "P2/C", null, "P1/B", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "P1/B", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); + mv.visitLdcInsn("P2/C.m"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); + mv.visitIntInsn(BIPUSH, 3); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "()I", null, null); + mv.visitCode(); + mv.visitTypeInsn(NEW, "P2/C"); + mv.visitInsn(DUP); + mv.visitMethodInsn(INVOKESPECIAL, "P2/C", "", "()V", false); + mv.visitMethodInsn(INVOKEVIRTUAL, "P1/A", "m", "()I", false); + mv.visitInsn(IRETURN); + mv.visitMaxs(3, 2); + mv.visitEnd(); + } + + cw.visitEnd(); + + return cw.toByteArray(); + } +} diff --git a/hotspot/test/runtime/logging/VtablesTest.java b/hotspot/test/runtime/logging/VtablesTest.java index b23fec00b3a..ff13389253d 100644 --- a/hotspot/test/runtime/logging/VtablesTest.java +++ b/hotspot/test/runtime/logging/VtablesTest.java @@ -46,10 +46,10 @@ public class VtablesTest { output.shouldContain("copy vtable from ClassA to ClassB"); output.shouldContain("Initializing: ClassB"); output.shouldContain("adding ClassB.Method1()V"); - output.shouldContain("] overriding with ClassB::ClassB.Method2()V"); + output.shouldContain("] overriding with ClassB.Method2()V"); output.shouldContain("invokevirtual resolved method: caller-class:ClassB"); output.shouldContain("invokevirtual selected method: receiver-class:ClassB"); - output.shouldContain("NOT overriding with p2.D::p2.D.nooverride()V"); + output.shouldContain("NOT overriding with p2.D.nooverride()V"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); From 85381e59e55dbd8ea873ddb9be8efa939ee39509 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 19 Aug 2016 14:54:31 -0400 Subject: [PATCH 20/99] 8145964: NoClassDefFound error in transforming lambdas Skip VM anonymous classes in retransformation and give an error for redefinition. Reviewed-by: dholmes, dcubed, never --- hotspot/src/share/vm/prims/jvmti.xml | 25 ++- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 5 +- .../share/vm/prims/jvmtiRedefineClasses.cpp | 11 +- .../RedefineTests/ModifyAnonymous.java | 171 ++++++++++++++++++ 4 files changed, 197 insertions(+), 15 deletions(-) create mode 100644 hotspot/test/runtime/RedefineTests/ModifyAnonymous.java diff --git a/hotspot/src/share/vm/prims/jvmti.xml b/hotspot/src/share/vm/prims/jvmti.xml index 3a06d2fc2b6..48b58c3f7c7 100644 --- a/hotspot/src/share/vm/prims/jvmti.xml +++ b/hotspot/src/share/vm/prims/jvmti.xml @@ -7152,15 +7152,19 @@ class C2 extends C1 implements I2 { returns JNI_FALSE) the class can be neither redefined nor retransformed.

- Primitive classes (for example, java.lang.Integer.TYPE) - and array classes are never modifiable. + Primitive classes (for example, java.lang.Integer.TYPE), + array classes, and some implementation defined classes are never modifiable.

new - If possessed then all classes (except primitive and array classes) - are modifiable. + If possessed then all classes (except primitive, array, and some implementation defined + classes) are modifiable (redefine or retransform). + + + If possessed then all classes (except primitive, array, and some implementation defined + classes) are modifiable with . No effect on the result of the function. @@ -9900,7 +9904,7 @@ myInit() { - Can modify (retransform or redefine) any non-primitive non-array class. + Can modify (retransform or redefine) any modifiable class. See . @@ -10024,7 +10028,8 @@ myInit() { - can be called on any class + can be called on any modifiable class. + See . ( must also be set) @@ -12494,8 +12499,8 @@ myInit() { Otherwise, this event may be sent before the VM is initialized (the start phase). Some classes might not be compatible - with the function (eg. ROMized classes) and this event will not be - generated for these classes. + with the function (eg. ROMized classes or implementation defined classes) and this event will + not be generated for these classes.

The agent must allocate the space for the modified class file data buffer @@ -14498,6 +14503,10 @@ typedef void (JNICALL *jvmtiEventVMInit) - Add new capability can_generate_early_class_hook_events - Add new function GetNamedModule + + Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to + disallow some implementation defined classes. + diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index 5b44ee01085..f1c5f962b17 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -283,7 +283,7 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) { return JVMTI_ERROR_INVALID_CLASS; } - if (java_lang_Class::is_primitive(k_mirror)) { + if (!VM_RedefineClasses::is_modifiable_class(k_mirror)) { return JVMTI_ERROR_UNMODIFIABLE_CLASS; } @@ -294,9 +294,6 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) { if (status & (JVMTI_CLASS_STATUS_ERROR)) { return JVMTI_ERROR_INVALID_CLASS; } - if (status & (JVMTI_CLASS_STATUS_ARRAY)) { - return JVMTI_ERROR_UNMODIFIABLE_CLASS; - } instanceKlassHandle ikh(current_thread, k_oop); if (ikh->get_cached_class_file_bytes() == NULL) { diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index f173e570dce..8a84d0ecf23 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -130,7 +130,7 @@ bool VM_RedefineClasses::doit_prologue() { } oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); - // classes for primitives and arrays cannot be redefined + // classes for primitives and arrays and vm anonymous classes cannot be redefined // check here so following code can assume these classes are InstanceKlass if (!is_modifiable_class(mirror)) { _res = JVMTI_ERROR_UNMODIFIABLE_CLASS; @@ -250,9 +250,14 @@ bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) { if (java_lang_Class::is_primitive(klass_mirror)) { return false; } - Klass* the_class_oop = java_lang_Class::as_Klass(klass_mirror); + Klass* k = java_lang_Class::as_Klass(klass_mirror); // classes for arrays cannot be redefined - if (the_class_oop == NULL || !the_class_oop->is_instance_klass()) { + if (k == NULL || !k->is_instance_klass()) { + return false; + } + + // Cannot redefine or retransform an anonymous class. + if (InstanceKlass::cast(k)->is_anonymous()) { return false; } return true; diff --git a/hotspot/test/runtime/RedefineTests/ModifyAnonymous.java b/hotspot/test/runtime/RedefineTests/ModifyAnonymous.java new file mode 100644 index 00000000000..700a8f04e93 --- /dev/null +++ b/hotspot/test/runtime/RedefineTests/ModifyAnonymous.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib + * @summary Test that retransforming and redefining anonymous classes gets UnmodifiableClassException + * @modules java.base/jdk.internal.misc + * @modules java.instrument + * jdk.jartool/sun.tools.jar + * @run main ModifyAnonymous buildagent + * @run main/othervm -javaagent:redefineagent.jar ModifyAnonymous + */ + +import java.io.FileNotFoundException; +import java.io.PrintWriter; +import java.lang.NoSuchFieldException; +import java.lang.NoSuchMethodException; +import java.lang.RuntimeException; +import java.lang.instrument.ClassDefinition; +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.IllegalClassFormatException; +import java.lang.instrument.Instrumentation; +import java.security.ProtectionDomain; +import jdk.test.lib.*; + +public class ModifyAnonymous { + + public static class LambdaTransformer implements ClassFileTransformer { + @Override + public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, + ProtectionDomain protectionDomain, byte[] classfileBuffer) + throws IllegalClassFormatException { + return null; + } + } + + static Instrumentation inst = null; + static volatile boolean done = false; + + public static void premain(String args, Instrumentation instrumentation) { + + inst = instrumentation; + System.out.println("javaagent in da house!"); + instrumentation.addTransformer(new LambdaTransformer()); + } + + private static void buildAgent() { + try { + ClassFileInstaller.main("ModifyAnonymous"); + } catch (Exception e) { + throw new RuntimeException("Could not write agent classfile", e); + } + + try { + PrintWriter pw = new PrintWriter("MANIFEST.MF"); + pw.println("Premain-Class: ModifyAnonymous"); + pw.println("Agent-Class: ModifyAnonymous"); + pw.println("Can-Retransform-Classes: true"); + pw.println("Can-Redefine-Classes: true"); + pw.close(); + } catch (FileNotFoundException e) { + throw new RuntimeException("Could not write manifest file for the agent", e); + } + + sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); + if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "ModifyAnonymous.class" })) { + throw new RuntimeException("Could not write the agent jar file"); + } + } + + public static class InstanceMethodCallSiteApp { + + public static void test() throws InterruptedException { + for (int i = 0; i < 2; i++) { + InstanceMethodCallSiteApp app = new InstanceMethodCallSiteApp(); + Runnable r = app::doWork; // this creates an anonymous class + while (!done) { + r.run(); + Thread.sleep(10); + } + } + } + + public void doWork() { + System.out.print("."); + } + } + + static void runTest() { + while (!done) { + Class[] allLoadedClasses = inst.getAllLoadedClasses(); + for (Class clazz : allLoadedClasses) { + final String name = clazz.getName(); + if (name.contains("$$Lambda$") && name.contains("App")) { + if (inst.isModifiableClass(clazz)) { + throw new RuntimeException ("Class should not be modifiable"); + } + // Try to modify them anyway. + try { + System.out.println("retransform called for " + name); + inst.retransformClasses(clazz); + } catch(java.lang.instrument.UnmodifiableClassException t) { + System.out.println("PASSED: expecting UnmodifiableClassException"); + t.printStackTrace(); + } + try { + System.out.println("redefine called for " + name); + String newclass = "class Dummy {}"; + byte[] bytecode = InMemoryJavaCompiler.compile("Dummy", newclass); + ClassDefinition cld = new ClassDefinition(clazz, bytecode); + inst.redefineClasses(new ClassDefinition[] { cld }); + } catch(java.lang.instrument.UnmodifiableClassException t) { + System.out.println("PASSED: expecting UnmodifiableClassException"); + t.printStackTrace(); + } catch(java.lang.ClassNotFoundException e) { + throw new RuntimeException ("ClassNotFoundException thrown"); + } + done = true; + } + } + } + } + + public static void main(String argv[]) throws InterruptedException, RuntimeException { + if (argv.length == 1 && argv[0].equals("buildagent")) { + buildAgent(); + return; + } + + if (inst == null) { + throw new RuntimeException("Instrumentation object was null"); + } + + new Thread() { + public void run() { + runTest(); + } + }.start(); + + // Test that NCDFE is not thrown for anonymous class: + // ModifyAnonymous$InstanceMethodCallSiteApp$$Lambda$18 + try { + ModifyAnonymous test = new ModifyAnonymous(); + InstanceMethodCallSiteApp.test(); + } catch (NoClassDefFoundError e) { + throw new RuntimeException("FAILED: NoClassDefFoundError thrown for " + e.getMessage()); + } + System.out.println("PASSED: NoClassDefFound error not thrown"); + } +} From 31cc523eb2f20570be1513d8a79311bde6dbe91d Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Sat, 20 Aug 2016 09:35:40 -0400 Subject: [PATCH 21/99] 8164521: compiler/rangechecks/TestRangeCheckSmearing.java is missing @build for sun.hotspot.WhiteBox Reviewed-by: coleenp --- hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java index 85fd007b41d..a6e285a4737 100644 --- a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java @@ -28,6 +28,7 @@ * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management + * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement From 5f1f4489ac6889f2e7048352cdc43bf961c77552 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Sun, 21 Aug 2016 20:56:37 -0400 Subject: [PATCH 22/99] 8157907: Incorrect inclusion of atomic.hpp instead of atomic.inline.hpp Remove atomic.inline.hpp and move the contents back into atomic.hpp Reviewed-by: stefank, pliden, simonis --- .../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 3 +- .../src/cpu/zero/vm/cppInterpreter_zero.cpp | 2 +- hotspot/src/os/aix/vm/os_aix.cpp | 2 +- hotspot/src/os/bsd/vm/os_bsd.cpp | 2 +- hotspot/src/os/linux/vm/os_linux.cpp | 2 +- hotspot/src/os/solaris/vm/os_solaris.cpp | 2 +- hotspot/src/os/windows/vm/os_windows.cpp | 2 +- .../os/windows/vm/threadCritical_windows.cpp | 4 +- ..._aix_ppc.inline.hpp => atomic_aix_ppc.hpp} | 11 +- ..._bsd_x86.inline.hpp => atomic_bsd_x86.hpp} | 9 +- .../bsd_x86/vm/orderAccess_bsd_x86.inline.hpp | 4 +- ...sd_zero.inline.hpp => atomic_bsd_zero.hpp} | 9 +- ...64.inline.hpp => atomic_linux_aarch64.hpp} | 10 +- .../vm/orderAccess_linux_aarch64.inline.hpp | 4 +- ...ux_ppc.inline.hpp => atomic_linux_ppc.hpp} | 11 +- .../vm/atomic_linux_sparc.inline.hpp | 5 +- ...ux_x86.inline.hpp => atomic_linux_x86.hpp} | 9 +- .../vm/orderAccess_linux_x86.inline.hpp | 4 +- ..._zero.inline.hpp => atomic_linux_zero.hpp} | 9 +- ...rc.inline.hpp => atomic_solaris_sparc.hpp} | 9 +- .../vm/orderAccess_solaris_sparc.inline.hpp | 4 +- ..._x86.inline.hpp => atomic_solaris_x86.hpp} | 9 +- .../vm/orderAccess_solaris_x86.inline.hpp | 4 +- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 2 +- ..._x86.inline.hpp => atomic_windows_x86.hpp} | 9 +- .../vm/orderAccess_windows_x86.inline.hpp | 4 +- hotspot/src/share/vm/asm/assembler.cpp | 4 +- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 2 +- .../share/vm/classfile/classLoaderData.cpp | 2 +- .../src/share/vm/classfile/stringTable.cpp | 2 +- .../src/share/vm/classfile/symbolTable.cpp | 2 +- hotspot/src/share/vm/code/nmethod.cpp | 2 +- .../src/share/vm/compiler/compileBroker.cpp | 2 +- .../gc/cms/concurrentMarkSweepGeneration.cpp | 2 +- .../src/share/vm/gc/cms/parNewGeneration.cpp | 2 +- .../share/vm/gc/g1/collectionSetChooser.cpp | 2 +- hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp | 2 +- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 2 +- .../src/share/vm/gc/g1/g1ConcurrentMark.cpp | 2 +- .../src/share/vm/gc/g1/g1EvacStats.inline.hpp | 4 +- hotspot/src/share/vm/gc/g1/g1HotCardCache.cpp | 4 +- hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp | 4 +- .../vm/gc/g1/g1SATBCardTableModRefBS.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1StringDedup.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1StringDedup.hpp | 3 +- .../src/share/vm/gc/g1/g1StringDedupQueue.cpp | 2 +- .../share/vm/gc/g1/g1StringDedupThread.cpp | 2 +- hotspot/src/share/vm/gc/g1/heapRegion.cpp | 2 +- .../src/share/vm/gc/g1/heapRegion.inline.hpp | 2 +- .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 2 +- hotspot/src/share/vm/gc/g1/sparsePRT.cpp | 2 +- .../src/share/vm/gc/parallel/gcTaskThread.cpp | 2 +- .../share/vm/gc/parallel/mutableNUMASpace.cpp | 5 +- .../src/share/vm/gc/parallel/mutableSpace.cpp | 4 +- .../share/vm/gc/parallel/parMarkBitMap.cpp | 2 +- .../vm/gc/parallel/psCompactionManager.cpp | 2 +- .../vm/gc/parallel/psParallelCompact.cpp | 2 +- .../share/vm/gc/serial/defNewGeneration.cpp | 2 +- .../src/share/vm/gc/shared/cardTableRS.cpp | 2 +- hotspot/src/share/vm/gc/shared/gcLocker.cpp | 4 +- .../src/share/vm/gc/shared/plab.inline.hpp | 4 +- hotspot/src/share/vm/gc/shared/space.cpp | 4 +- hotspot/src/share/vm/gc/shared/taskqueue.cpp | 4 +- .../share/vm/gc/shared/taskqueue.inline.hpp | 4 +- hotspot/src/share/vm/gc/shared/workgroup.cpp | 2 +- .../vm/interpreter/bytecodeInterpreter.cpp | 2 +- .../vm/interpreter/interpreterRuntime.cpp | 2 +- .../src/share/vm/logging/logOutputList.cpp | 4 +- .../src/share/vm/logging/logOutputList.hpp | 3 +- hotspot/src/share/vm/memory/allocation.cpp | 4 +- .../src/share/vm/memory/allocation.inline.hpp | 4 +- hotspot/src/share/vm/memory/metaspace.cpp | 2 +- hotspot/src/share/vm/memory/universe.cpp | 2 +- .../src/share/vm/oops/compiledICHolder.cpp | 4 +- hotspot/src/share/vm/oops/cpCache.cpp | 2 +- hotspot/src/share/vm/oops/instanceKlass.cpp | 2 +- hotspot/src/share/vm/oops/klass.cpp | 2 +- hotspot/src/share/vm/oops/oop.inline.hpp | 2 +- hotspot/src/share/vm/oops/symbol.cpp | 2 +- hotspot/src/share/vm/oops/symbol.hpp | 2 +- hotspot/src/share/vm/opto/runtime.cpp | 2 +- hotspot/src/share/vm/prims/jni.cpp | 2 +- hotspot/src/share/vm/prims/jvm.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiImpl.cpp | 4 +- .../src/share/vm/prims/jvmtiRawMonitor.cpp | 4 +- hotspot/src/share/vm/prims/unsafe.cpp | 2 +- hotspot/src/share/vm/runtime/atomic.hpp | 120 +++++++++++++--- .../src/share/vm/runtime/atomic.inline.hpp | 130 ------------------ .../src/share/vm/runtime/biasedLocking.cpp | 2 +- hotspot/src/share/vm/runtime/handles.cpp | 2 +- .../src/share/vm/runtime/interfaceSupport.cpp | 4 +- hotspot/src/share/vm/runtime/mutex.cpp | 2 +- .../src/share/vm/runtime/objectMonitor.cpp | 2 +- .../share/vm/runtime/orderAccess.inline.hpp | 2 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/safepoint.cpp | 2 +- .../src/share/vm/runtime/sharedRuntime.cpp | 2 +- hotspot/src/share/vm/runtime/sweeper.cpp | 2 +- hotspot/src/share/vm/runtime/synchronizer.cpp | 2 +- hotspot/src/share/vm/runtime/thread.cpp | 2 +- .../src/share/vm/runtime/thread.inline.hpp | 4 +- .../src/share/vm/services/mallocTracker.cpp | 3 +- hotspot/src/share/vm/services/memTracker.hpp | 3 +- .../src/share/vm/services/threadService.cpp | 2 +- .../vm/services/virtualMemoryTracker.cpp | 2 +- hotspot/src/share/vm/shark/sharkRuntime.cpp | 2 +- .../src/share/vm/utilities/accessFlags.cpp | 4 +- hotspot/src/share/vm/utilities/bitMap.cpp | 2 +- .../src/share/vm/utilities/bitMap.inline.hpp | 2 +- hotspot/src/share/vm/utilities/debug.cpp | 2 +- hotspot/src/share/vm/utilities/histogram.cpp | 4 +- hotspot/src/share/vm/utilities/macros.hpp | 20 +++ hotspot/src/share/vm/utilities/vmError.cpp | 2 +- 114 files changed, 292 insertions(+), 340 deletions(-) rename hotspot/src/os_cpu/aix_ppc/vm/{atomic_aix_ppc.inline.hpp => atomic_aix_ppc.hpp} (98%) rename hotspot/src/os_cpu/bsd_x86/vm/{atomic_bsd_x86.inline.hpp => atomic_bsd_x86.hpp} (97%) rename hotspot/src/os_cpu/bsd_zero/vm/{atomic_bsd_zero.inline.hpp => atomic_bsd_zero.hpp} (97%) rename hotspot/src/os_cpu/linux_aarch64/vm/{atomic_linux_aarch64.inline.hpp => atomic_linux_aarch64.hpp} (94%) rename hotspot/src/os_cpu/linux_ppc/vm/{atomic_linux_ppc.inline.hpp => atomic_linux_ppc.hpp} (98%) rename hotspot/src/os_cpu/linux_x86/vm/{atomic_linux_x86.inline.hpp => atomic_linux_x86.hpp} (97%) rename hotspot/src/os_cpu/linux_zero/vm/{atomic_linux_zero.inline.hpp => atomic_linux_zero.hpp} (97%) rename hotspot/src/os_cpu/solaris_sparc/vm/{atomic_solaris_sparc.inline.hpp => atomic_solaris_sparc.hpp} (97%) rename hotspot/src/os_cpu/solaris_x86/vm/{atomic_solaris_x86.inline.hpp => atomic_solaris_x86.hpp} (97%) rename hotspot/src/os_cpu/windows_x86/vm/{atomic_windows_x86.inline.hpp => atomic_windows_x86.hpp} (97%) delete mode 100644 hotspot/src/share/vm/runtime/atomic.inline.hpp diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp index bab62cd4f86..22097092a7a 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,6 +28,7 @@ #include "runtime/globals_extension.hpp" #include "runtime/vm_version.hpp" +#include "utilities/sizes.hpp" class VM_Version : public Abstract_VM_Version { friend class JVMCIVMStructs; diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 9e91f22f266..1fcf7d9984b 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -37,7 +37,7 @@ #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index dffad2b7f3f..620a32737a0 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -52,7 +52,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index a40175df89c..c730942840e 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -42,7 +42,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 5f4f1174c9d..b79f8dd95ad 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -42,7 +42,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 3b9a3793a61..bdb9627485e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -42,7 +42,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 5dfdab012d6..da89dbfb0b1 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -45,7 +45,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os/windows/vm/threadCritical_windows.cpp b/hotspot/src/os/windows/vm/threadCritical_windows.cpp index 3ea83c1acb6..b432f7bb078 100644 --- a/hotspot/src/os/windows/vm/threadCritical_windows.cpp +++ b/hotspot/src/os/windows/vm/threadCritical_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.hpp similarity index 98% rename from hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp rename to hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.hpp index a7462ad395e..efa550bffea 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,11 +23,8 @@ * */ -#ifndef OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP -#define OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP - -#include "runtime/atomic.hpp" -#include "runtime/os.hpp" +#ifndef OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP +#define OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP #ifndef _LP64 #error "Atomic currently only impleneted for PPC64" @@ -479,4 +476,4 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void #undef strasm_nobarrier #undef strasm_nobarrier_clobber_memory -#endif // OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP +#endif // OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP diff --git a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.hpp similarity index 97% rename from hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp rename to hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.hpp index 8310003a8f1..92b5b9311ae 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -22,10 +22,9 @@ * */ -#ifndef OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_INLINE_HPP -#define OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_INLINE_HPP +#ifndef OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_HPP +#define OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // Implementation of class atomic @@ -225,4 +224,4 @@ inline void Atomic::store(jlong store_value, volatile jlong* dest) { #endif // AMD64 -#endif // OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_INLINE_HPP +#endif // OS_CPU_BSD_X86_VM_ATOMIC_BSD_X86_HPP diff --git a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp index bc28eb2b2d4..038d6f985d5 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -25,7 +25,7 @@ #ifndef OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP #define OS_CPU_BSD_X86_VM_ORDERACCESS_BSD_X86_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.hpp similarity index 97% rename from hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp rename to hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.hpp index 4490e49020c..e8083400ec1 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011, 2015, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,10 +23,9 @@ * */ -#ifndef OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP -#define OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP +#ifndef OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_HPP +#define OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // Implementation of class atomic @@ -331,4 +330,4 @@ inline void Atomic::store(jlong store_value, volatile jlong* dest) { os::atomic_copy64((volatile jlong*)&store_value, dest); } -#endif // OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_INLINE_HPP +#endif // OS_CPU_BSD_ZERO_VM_ATOMIC_BSD_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp b/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp similarity index 94% rename from hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp rename to hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp index 95d007fc21b..77dd34a663e 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.inline.hpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,11 +23,9 @@ * */ -#ifndef OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_INLINE_HPP -#define OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_INLINE_HPP +#ifndef OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_HPP +#define OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_HPP -#include "runtime/atomic.hpp" -#include "runtime/os.hpp" #include "vm_version_aarch64.hpp" // Implementation of class atomic @@ -161,4 +159,4 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void inline jlong Atomic::load(volatile jlong* src) { return *src; } -#endif // OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_INLINE_HPP +#endif // OS_CPU_LINUX_AARCH64_VM_ATOMIC_LINUX_AARCH64_HPP diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp b/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp index adeaa0ad1fd..03c6b314d56 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/orderAccess_linux_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -26,7 +26,7 @@ #ifndef OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP #define OS_CPU_LINUX_AARCH64_VM_ORDERACCESS_LINUX_AARCH64_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" #include "vm_version_aarch64.hpp" diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.hpp similarity index 98% rename from hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp rename to hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.hpp index 6c8498c4508..0f4a5a8447d 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,11 +23,8 @@ * */ -#ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP -#define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP - -#include "runtime/atomic.hpp" -#include "runtime/os.hpp" +#ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_HPP +#define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_HPP #ifndef PPC64 #error "Atomic currently only implemented for PPC64" @@ -479,4 +476,4 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void #undef strasm_nobarrier #undef strasm_nobarrier_clobber_memory -#endif // OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP +#endif // OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_HPP diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index b0df28daea3..5830beba77d 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -25,9 +25,6 @@ #ifndef OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP #define OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP -#include "runtime/atomic.hpp" -#include "runtime/os.hpp" - // Implementation of class atomic inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.hpp similarity index 97% rename from hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp rename to hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.hpp index faf0a8043f7..7b51da41ce0 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -22,10 +22,9 @@ * */ -#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP -#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP +#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // Implementation of class atomic @@ -225,4 +224,4 @@ inline void Atomic::store(jlong store_value, volatile jlong* dest) { #endif // AMD64 -#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP +#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index b4aceaf5a91..0f564216e13 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -25,7 +25,7 @@ #ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP #define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp similarity index 97% rename from hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp rename to hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp index 4a9b2c05da9..7c3235ffd06 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011, 2015, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,10 +23,9 @@ * */ -#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP -#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP +#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // Implementation of class atomic @@ -325,4 +324,4 @@ inline void Atomic::store(jlong store_value, volatile jlong* dest) { os::atomic_copy64((volatile jlong*)&store_value, dest); } -#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP +#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.hpp similarity index 97% rename from hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp rename to hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.hpp index 03c4326073a..3c292a4dea0 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -22,10 +22,9 @@ * */ -#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP -#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP +#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // Implementation of class atomic @@ -374,4 +373,4 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* #endif // _GNU_SOURCE -#endif // OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP +#endif // OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 4bf5833a458..7a74147d6a0 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -25,7 +25,7 @@ #ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP #define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" // Compiler version last used for testing: solaris studio 12u3 diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.hpp similarity index 97% rename from hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp rename to hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.hpp index e856b755cf2..44f269912f5 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -22,10 +22,9 @@ * */ -#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP -#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP +#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } @@ -276,4 +275,4 @@ extern "C" { #endif // _GNU_SOURCE -#endif // OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP +#endif // OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index af4e2e29337..b88e715e4d4 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -25,7 +25,7 @@ #ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP #define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index 7713550f374..ef64ff751d0 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -38,7 +38,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/extendedPC.hpp" #include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.hpp similarity index 97% rename from hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp rename to hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.hpp index 3d7662e5cd7..953e13d8ddf 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -22,10 +22,9 @@ * */ -#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP -#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP +#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_HPP -#include "runtime/atomic.hpp" #include "runtime/os.hpp" // The following alternative implementations are needed because @@ -301,4 +300,4 @@ inline void Atomic::store(jlong store_value, jlong* dest) { #pragma warning(default: 4035) // Enables warnings reporting missing return statement -#endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP +#endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index 8481bd93f30..36c1c4a42c0 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -26,7 +26,7 @@ #define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP #include -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index fe8dbb1b401..120b68e39a7 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -26,7 +26,7 @@ #include "asm/codeBuffer.hpp" #include "asm/macroAssembler.hpp" #include "asm/macroAssembler.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/icache.hpp" #include "runtime/os.hpp" #include "runtime/thread.hpp" diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 3ee774ec00f..bbb5ef87c67 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -49,7 +49,7 @@ #include "memory/resourceArea.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 09ddbf40b92..ba1191614b1 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -63,7 +63,7 @@ #include "memory/resourceArea.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutex.hpp" diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index abf662cb403..7d3fe1636f2 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -34,7 +34,7 @@ #include "memory/filemap.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index f4997a7ca70..8f51f527508 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -34,7 +34,7 @@ #include "memory/filemap.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/hashtable.inline.hpp" diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index d09518c011f..db757f7faa0 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -41,7 +41,7 @@ #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiImpl.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index f9768b50d99..a485ddfda61 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -42,7 +42,7 @@ #include "prims/nativeLookup.hpp" #include "prims/whitebox.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index cbbbfbded27..6d78865ac43 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -61,7 +61,7 @@ #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/globals_extension.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index da6b6d623a3..e8f606eecc8 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -50,7 +50,7 @@ #include "memory/resourceArea.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp index cc9dbf46e67..1e757b8009d 100644 --- a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp @@ -26,7 +26,7 @@ #include "gc/g1/collectionSetChooser.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/shared/space.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" // Even though we don't use the GC efficiency in our heuristics as // much as we used to, we still order according to GC efficiency. This diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp index b16ccc6fed0..dcd88be5057 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp @@ -27,7 +27,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/workgroup.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp b/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp index 100b894ecc1..fc6fe469625 100644 --- a/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp @@ -30,7 +30,7 @@ #include "gc/shared/workgroup.hpp" #include "logging/log.hpp" #include "memory/universe.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/globals.hpp" #include "runtime/os.hpp" #include "utilities/bitMap.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index a267098ed86..187603c1eec 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -75,7 +75,7 @@ #include "memory/iterator.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/init.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/vmThread.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp index 454c5989484..27f4071b7bf 100644 --- a/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp @@ -52,7 +52,7 @@ #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/prefetch.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1EvacStats.inline.hpp b/hotspot/src/share/vm/gc/g1/g1EvacStats.inline.hpp index 337d4625707..007f62d3af4 100644 --- a/hotspot/src/share/vm/gc/g1/g1EvacStats.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,7 @@ #define SHARE_VM_GC_G1_G1EVACSTATS_INLINE_HPP #include "gc/g1/g1EvacStats.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" inline void G1EvacStats::add_direct_allocated(size_t value) { Atomic::add_ptr(value, &_direct_allocated); diff --git a/hotspot/src/share/vm/gc/g1/g1HotCardCache.cpp b/hotspot/src/share/vm/gc/g1/g1HotCardCache.cpp index aae9c94f0f6..c18fb36afaf 100644 --- a/hotspot/src/share/vm/gc/g1/g1HotCardCache.cpp +++ b/hotspot/src/share/vm/gc/g1/g1HotCardCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -26,7 +26,7 @@ #include "gc/g1/dirtyCardQueue.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1HotCardCache.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h): _g1h(g1h), _hot_cache(NULL), _use_cache(false), _card_counts(g1h) {} diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp index 3d8866de817..4eed0960dca 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -45,7 +45,7 @@ #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" #include "runtime/synchronizer.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp index c701b700c6a..006a658f5d8 100644 --- a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp @@ -30,7 +30,7 @@ #include "gc/shared/memset_with_concurrent_readers.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedup.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedup.cpp index 8b8ce067eaf..e9f91bd2c1b 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedup.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedup.cpp @@ -31,7 +31,7 @@ #include "gc/g1/g1StringDedupStat.hpp" #include "gc/g1/g1StringDedupTable.hpp" #include "gc/g1/g1StringDedupThread.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" bool G1StringDedup::_enabled = false; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedup.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedup.hpp index 9191613787b..6ed8f22b74a 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedup.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedup.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -84,7 +84,6 @@ #include "memory/allocation.hpp" #include "oops/oop.hpp" -#include "runtime/atomic.hpp" class OopClosure; class BoolObjectClosure; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp index 3bca86a80a5..b029c3f2b40 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp @@ -30,7 +30,7 @@ #include "gc/shared/gcLocker.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/stack.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp index 0bdfc193064..f0b25d3c6a9 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp @@ -31,7 +31,7 @@ #include "gc/g1/suspendibleThreadSet.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" G1StringDedupThread* G1StringDedupThread::_thread = NULL; diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index 13143a32afe..33d8268855d 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -39,7 +39,7 @@ #include "memory/iterator.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" int HeapRegion::LogOfHRGrainBytes = 0; diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp index 248e0befa1d..01c53283579 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp @@ -30,7 +30,7 @@ #include "gc/g1/heapRegion.hpp" #include "gc/shared/space.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" inline HeapWord* G1ContiguousSpace::allocate_impl(size_t min_word_size, size_t desired_word_size, diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index ad4821ae4fd..9aa4da68968 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -33,7 +33,7 @@ #include "memory/allocation.hpp" #include "memory/padded.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" diff --git a/hotspot/src/share/vm/gc/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc/g1/sparsePRT.cpp index cab39b36e91..44e43465ce6 100644 --- a/hotspot/src/share/vm/gc/g1/sparsePRT.cpp +++ b/hotspot/src/share/vm/gc/g1/sparsePRT.cpp @@ -30,7 +30,7 @@ #include "gc/shared/cardTableModRefBS.hpp" #include "gc/shared/space.inline.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" // Check that the size of the SparsePRTEntry is evenly divisible by the maximum diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp index 42e67119e0a..48eb3c4163d 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -30,7 +30,7 @@ #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc/parallel/mutableNUMASpace.cpp index e53d195d639..c4cb76d5c86 100644 --- a/hotspot/src/share/vm/gc/parallel/mutableNUMASpace.cpp +++ b/hotspot/src/share/vm/gc/parallel/mutableNUMASpace.cpp @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -28,7 +27,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/spaceDecorator.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/thread.inline.hpp" MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { diff --git a/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp b/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp index 4db21472ec5..61dc795d484 100644 --- a/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp +++ b/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -26,7 +26,7 @@ #include "gc/parallel/mutableSpace.hpp" #include "gc/shared/spaceDecorator.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp index 39b63acb016..df29bbdcde4 100644 --- a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp @@ -27,7 +27,7 @@ #include "gc/parallel/psCompactionManager.inline.hpp" #include "gc/parallel/psParallelCompact.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "services/memTracker.hpp" #include "utilities/bitMap.inline.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp index 2884b4c7df6..fc3e9088ea9 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp @@ -38,7 +38,7 @@ #include "oops/instanceMirrorKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" PSOldGen* ParCompactionManager::_old_gen = NULL; ParCompactionManager** ParCompactionManager::_manager_array = NULL; diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index d16e510a5f5..ccd464892e4 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -57,7 +57,7 @@ #include "oops/methodData.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/fprofiler.hpp" #include "runtime/safepoint.hpp" #include "runtime/vmThread.hpp" diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index a10a9f18c62..147bc06d305 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -46,7 +46,7 @@ #include "memory/resourceArea.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/java.hpp" #include "runtime/prefetch.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/gc/shared/cardTableRS.cpp b/hotspot/src/share/vm/gc/shared/cardTableRS.cpp index 5e28170a2aa..eabc5156902 100644 --- a/hotspot/src/share/vm/gc/shared/cardTableRS.cpp +++ b/hotspot/src/share/vm/gc/shared/cardTableRS.cpp @@ -29,7 +29,7 @@ #include "gc/shared/space.inline.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.cpp b/hotspot/src/share/vm/gc/shared/gcLocker.cpp index cc847261efd..4b72cd80bfd 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.cpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -27,7 +27,7 @@ #include "gc/shared/gcLocker.inline.hpp" #include "memory/resourceArea.hpp" #include "logging/log.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/thread.inline.hpp" volatile jint GCLocker::_jni_lock_count = 0; diff --git a/hotspot/src/share/vm/gc/shared/plab.inline.hpp b/hotspot/src/share/vm/gc/shared/plab.inline.hpp index 33a9f58007c..6963a7fd913 100644 --- a/hotspot/src/share/vm/gc/shared/plab.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/plab.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,7 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/plab.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" inline HeapWord* PLAB::allocate_aligned(size_t word_sz, unsigned short alignment_in_bytes) { HeapWord* res = CollectedHeap::align_allocation_or_fail(_top, _end, alignment_in_bytes); diff --git a/hotspot/src/share/vm/gc/shared/space.cpp b/hotspot/src/share/vm/gc/shared/space.cpp index c207dcd74b5..db21862989c 100644 --- a/hotspot/src/share/vm/gc/shared/space.cpp +++ b/hotspot/src/share/vm/gc/shared/space.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -35,7 +35,7 @@ #include "gc/shared/spaceDecorator.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/java.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/prefetch.inline.hpp" diff --git a/hotspot/src/share/vm/gc/shared/taskqueue.cpp b/hotspot/src/share/vm/gc/shared/taskqueue.cpp index 57b65fbcc73..2fc94c6304d 100644 --- a/hotspot/src/share/vm/gc/shared/taskqueue.cpp +++ b/hotspot/src/share/vm/gc/shared/taskqueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -26,7 +26,7 @@ #include "gc/shared/taskqueue.hpp" #include "oops/oop.inline.hpp" #include "logging/log.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "runtime/thread.inline.hpp" #include "utilities/debug.hpp" diff --git a/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp b/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp index baa35059bed..8852557c5db 100644 --- a/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -28,7 +28,7 @@ #include "gc/shared/taskqueue.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "utilities/debug.hpp" #include "utilities/stack.inline.hpp" diff --git a/hotspot/src/share/vm/gc/shared/workgroup.cpp b/hotspot/src/share/vm/gc/shared/workgroup.cpp index 84016fe466d..6df874b2510 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.cpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.cpp @@ -28,7 +28,7 @@ #include "gc/shared/workerManager.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "runtime/semaphore.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 179940d7e22..655b58af156 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -39,7 +39,7 @@ #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 0770b397d79..18ac2392abe 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -48,7 +48,7 @@ #include "oops/symbol.hpp" #include "prims/jvmtiExport.hpp" #include "prims/nativeLookup.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/deoptimization.hpp" diff --git a/hotspot/src/share/vm/logging/logOutputList.cpp b/hotspot/src/share/vm/logging/logOutputList.cpp index e2f8a6f1559..bc0565ae766 100644 --- a/hotspot/src/share/vm/logging/logOutputList.cpp +++ b/hotspot/src/share/vm/logging/logOutputList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,7 +25,7 @@ #include "logging/logLevel.hpp" #include "logging/logOutputList.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "utilities/globalDefinitions.hpp" diff --git a/hotspot/src/share/vm/logging/logOutputList.hpp b/hotspot/src/share/vm/logging/logOutputList.hpp index e983cb0d7c2..37b122bee5f 100644 --- a/hotspot/src/share/vm/logging/logOutputList.hpp +++ b/hotspot/src/share/vm/logging/logOutputList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -26,7 +26,6 @@ #include "logging/logLevel.hpp" #include "memory/allocation.hpp" -#include "runtime/atomic.hpp" #include "utilities/globalDefinitions.hpp" class LogOutput; diff --git a/hotspot/src/share/vm/memory/allocation.cpp b/hotspot/src/share/vm/memory/allocation.cpp index f7dea3d6c91..2e32964bf7e 100644 --- a/hotspot/src/share/vm/memory/allocation.cpp +++ b/hotspot/src/share/vm/memory/allocation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -29,7 +29,7 @@ #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "runtime/task.hpp" #include "runtime/threadCritical.hpp" diff --git a/hotspot/src/share/vm/memory/allocation.inline.hpp b/hotspot/src/share/vm/memory/allocation.inline.hpp index 5fe55f4a292..db09c0cfb0e 100644 --- a/hotspot/src/share/vm/memory/allocation.inline.hpp +++ b/hotspot/src/share/vm/memory/allocation.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -25,7 +25,7 @@ #ifndef SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP #define SHARE_VM_MEMORY_ALLOCATION_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "services/memTracker.hpp" #include "utilities/globalDefinitions.hpp" diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index ac7d0f838a3..1801a7c21cf 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -37,7 +37,7 @@ #include "memory/metaspaceTracer.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/globals.hpp" #include "runtime/init.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index a3dff52548f..a261e333883 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -56,7 +56,7 @@ #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/commandLineFlagConstraintList.hpp" #include "runtime/deoptimization.hpp" #include "runtime/fprofiler.hpp" diff --git a/hotspot/src/share/vm/oops/compiledICHolder.cpp b/hotspot/src/share/vm/oops/compiledICHolder.cpp index 9e01e4ea705..55397d06c10 100644 --- a/hotspot/src/share/vm/oops/compiledICHolder.cpp +++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -26,7 +26,7 @@ #include "oops/compiledICHolder.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" volatile int CompiledICHolder::_live_count; volatile int CompiledICHolder::_live_not_claimed_count; diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index ee2425fc615..a30d19dd685 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -32,7 +32,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 1e7b1b1bb3d..d6b2323af28 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -56,7 +56,7 @@ #include "prims/jvmtiRedefineClasses.hpp" #include "prims/jvmtiThreadState.hpp" #include "prims/methodComparator.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index d7fb8924e71..38a613d93b7 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -36,7 +36,7 @@ #include "oops/instanceKlass.hpp" #include "oops/klass.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "trace/traceMacros.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index fe3cd508a9f..578bcc4e520 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -36,7 +36,7 @@ #include "oops/klass.inline.hpp" #include "oops/markOop.inline.hpp" #include "oops/oop.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/oops/symbol.cpp b/hotspot/src/share/vm/oops/symbol.cpp index 74d56db1e7d..f515621efff 100644 --- a/hotspot/src/share/vm/oops/symbol.cpp +++ b/hotspot/src/share/vm/oops/symbol.cpp @@ -29,7 +29,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/symbol.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" Symbol::Symbol(const u1* name, int length, int refcount) { diff --git a/hotspot/src/share/vm/oops/symbol.hpp b/hotspot/src/share/vm/oops/symbol.hpp index b6801f03f9c..468640caa24 100644 --- a/hotspot/src/share/vm/oops/symbol.hpp +++ b/hotspot/src/share/vm/oops/symbol.hpp @@ -26,8 +26,8 @@ #define SHARE_VM_OOPS_SYMBOL_HPP #include "memory/allocation.hpp" -#include "runtime/atomic.hpp" #include "utilities/exceptions.hpp" +#include "utilities/macros.hpp" #include "utilities/utf8.hpp" // A Symbol is a canonicalized string. diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 3626009a15c..d0a3c4b8fd3 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -60,7 +60,7 @@ #include "opto/runtime.hpp" #include "opto/subnode.hpp" #include "prims/jvmtiThreadState.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/fprofiler.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 878bd6623a5..f083a74c7aa 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -59,7 +59,7 @@ #include "prims/jvm_misc.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/fprofiler.hpp" diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 79c450b002d..b66c22bf74e 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -54,7 +54,7 @@ #include "prims/privilegedStack.hpp" #include "prims/stackwalk.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp index 398f5720b13..20905222276 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -36,7 +36,7 @@ #include "prims/jvmtiEventController.inline.hpp" #include "prims/jvmtiImpl.hpp" #include "prims/jvmtiRedefineClasses.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp b/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp index 003f12f0c0a..3ce6cf760b4 100644 --- a/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "prims/jvmtiRawMonitor.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index d7721ec5f55..cb876e02b01 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -32,7 +32,7 @@ #include "prims/jni.h" #include "prims/jvm.h" #include "prims/unsafe.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/atomic.hpp b/hotspot/src/share/vm/runtime/atomic.hpp index c71a2d3f3a5..16195c04384 100644 --- a/hotspot/src/share/vm/runtime/atomic.hpp +++ b/hotspot/src/share/vm/runtime/atomic.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,6 +26,7 @@ #define SHARE_VM_RUNTIME_ATOMIC_HPP #include "memory/allocation.hpp" +#include "utilities/macros.hpp" enum cmpxchg_memory_order { memory_order_relaxed, @@ -119,24 +120,107 @@ class Atomic : AllStatic { inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value, cmpxchg_memory_order order = memory_order_conservative); }; -// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially -// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to -// achieve is to place your short value next to another short value, which doesn't need atomic ops. -// -// Example -// ATOMIC_SHORT_PAIR( -// volatile short _refcount, // needs atomic operation -// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) -// ); +// platform specific in-line definitions - must come before shared definitions -#ifdef VM_LITTLE_ENDIAN - #define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ - non_atomic_decl; \ - atomic_decl -#else - #define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ - atomic_decl; \ - non_atomic_decl +#include OS_CPU_HEADER(atomic) + +// shared in-line definitions + +// size_t casts... +#if (SIZE_MAX != UINTPTR_MAX) +#error size_t is not WORD_SIZE, interesting platform, but missing implementation here #endif +inline size_t Atomic::add(size_t add_value, volatile size_t* dest) { + return (size_t) add_ptr((intptr_t) add_value, (volatile intptr_t*) dest); +} + +inline void Atomic::inc(volatile size_t* dest) { + inc_ptr((volatile intptr_t*) dest); +} + +inline void Atomic::dec(volatile size_t* dest) { + dec_ptr((volatile intptr_t*) dest); +} + +#ifndef VM_HAS_SPECIALIZED_CMPXCHG_BYTE +/* + * This is the default implementation of byte-sized cmpxchg. It emulates jbyte-sized cmpxchg + * in terms of jint-sized cmpxchg. Platforms may override this by defining their own inline definition + * as well as defining VM_HAS_SPECIALIZED_CMPXCHG_BYTE. This will cause the platform specific + * implementation to be used instead. + */ +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte *dest, jbyte comparand, cmpxchg_memory_order order) +{ + assert(sizeof(jbyte) == 1, "assumption."); + uintptr_t dest_addr = (uintptr_t)dest; + uintptr_t offset = dest_addr % sizeof(jint); + volatile jint* dest_int = (volatile jint*)(dest_addr - offset); + jint cur = *dest_int; + jbyte* cur_as_bytes = (jbyte*)(&cur); + jint new_val = cur; + jbyte* new_val_as_bytes = (jbyte*)(&new_val); + new_val_as_bytes[offset] = exchange_value; + while (cur_as_bytes[offset] == comparand) { + jint res = cmpxchg(new_val, dest_int, cur, order); + if (res == cur) break; + cur = res; + new_val = cur; + new_val_as_bytes[offset] = exchange_value; + } + return cur_as_bytes[offset]; +} +#endif // VM_HAS_SPECIALIZED_CMPXCHG_BYTE + +inline unsigned Atomic::xchg(unsigned int exchange_value, volatile unsigned int* dest) { + assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); + return (unsigned int)Atomic::xchg((jint)exchange_value, (volatile jint*)dest); +} + +inline unsigned Atomic::cmpxchg(unsigned int exchange_value, + volatile unsigned int* dest, unsigned int compare_value, + cmpxchg_memory_order order) { + assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); + return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest, + (jint)compare_value, order); +} + +inline jlong Atomic::add(jlong add_value, volatile jlong* dest) { + jlong old = load(dest); + jlong new_value = old + add_value; + while (old != cmpxchg(new_value, dest, old)) { + old = load(dest); + new_value = old + add_value; + } + return old; +} + +inline void Atomic::inc(volatile short* dest) { + // Most platforms do not support atomic increment on a 2-byte value. However, + // if the value occupies the most significant 16 bits of an aligned 32-bit + // word, then we can do this with an atomic add of 0x10000 to the 32-bit word. + // + // The least significant parts of this 32-bit word will never be affected, even + // in case of overflow/underflow. + // + // Use the ATOMIC_SHORT_PAIR macro (see macros.hpp) to get the desired alignment. +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest)); +#endif +} + +inline void Atomic::dec(volatile short* dest) { +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest)); +#endif +} + #endif // SHARE_VM_RUNTIME_ATOMIC_HPP diff --git a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp deleted file mode 100644 index 690be7daaf1..00000000000 --- a/hotspot/src/share/vm/runtime/atomic.inline.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2012, 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. - * - */ - -#ifndef SHARE_VM_RUNTIME_ATOMIC_INLINE_HPP -#define SHARE_VM_RUNTIME_ATOMIC_INLINE_HPP - -#include "runtime/atomic.hpp" -#include "utilities/macros.hpp" - -#include OS_CPU_HEADER_INLINE(atomic) - -// size_t casts... -#if (SIZE_MAX != UINTPTR_MAX) -#error size_t is not WORD_SIZE, interesting platform, but missing implementation here -#endif - -inline size_t Atomic::add(size_t add_value, volatile size_t* dest) { - return (size_t) add_ptr((intptr_t) add_value, (volatile intptr_t*) dest); -} - -inline void Atomic::inc(volatile size_t* dest) { - inc_ptr((volatile intptr_t*) dest); -} - -inline void Atomic::dec(volatile size_t* dest) { - dec_ptr((volatile intptr_t*) dest); -} - -#ifndef VM_HAS_SPECIALIZED_CMPXCHG_BYTE -/* - * This is the default implementation of byte-sized cmpxchg. It emulates jbyte-sized cmpxchg - * in terms of jint-sized cmpxchg. Platforms may override this by defining their own inline definition - * as well as defining VM_HAS_SPECIALIZED_CMPXCHG_BYTE. This will cause the platform specific - * implementation to be used instead. - */ -inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte *dest, jbyte comparand, cmpxchg_memory_order order) -{ - assert(sizeof(jbyte) == 1, "assumption."); - uintptr_t dest_addr = (uintptr_t)dest; - uintptr_t offset = dest_addr % sizeof(jint); - volatile jint* dest_int = (volatile jint*)(dest_addr - offset); - jint cur = *dest_int; - jbyte* cur_as_bytes = (jbyte*)(&cur); - jint new_val = cur; - jbyte* new_val_as_bytes = (jbyte*)(&new_val); - new_val_as_bytes[offset] = exchange_value; - while (cur_as_bytes[offset] == comparand) { - jint res = cmpxchg(new_val, dest_int, cur, order); - if (res == cur) break; - cur = res; - new_val = cur; - new_val_as_bytes[offset] = exchange_value; - } - return cur_as_bytes[offset]; -} -#endif // VM_HAS_SPECIALIZED_CMPXCHG_BYTE - -inline unsigned Atomic::xchg(unsigned int exchange_value, volatile unsigned int* dest) { - assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); - return (unsigned int)Atomic::xchg((jint)exchange_value, (volatile jint*)dest); -} - -inline unsigned Atomic::cmpxchg(unsigned int exchange_value, - volatile unsigned int* dest, unsigned int compare_value, - cmpxchg_memory_order order) { - assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); - return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest, - (jint)compare_value, order); -} - -inline jlong Atomic::add(jlong add_value, volatile jlong* dest) { - jlong old = load(dest); - jlong new_value = old + add_value; - while (old != cmpxchg(new_value, dest, old)) { - old = load(dest); - new_value = old + add_value; - } - return old; -} - -inline void Atomic::inc(volatile short* dest) { - // Most platforms do not support atomic increment on a 2-byte value. However, - // if the value occupies the most significant 16 bits of an aligned 32-bit - // word, then we can do this with an atomic add of 0x10000 to the 32-bit word. - // - // The least significant parts of this 32-bit word will never be affected, even - // in case of overflow/underflow. - // - // Use the ATOMIC_SHORT_PAIR macro to get the desired alignment. -#ifdef VM_LITTLE_ENDIAN - assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); - (void)Atomic::add(0x10000, (volatile int*)(dest-1)); -#else - assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); - (void)Atomic::add(0x10000, (volatile int*)(dest)); -#endif -} - -inline void Atomic::dec(volatile short* dest) { -#ifdef VM_LITTLE_ENDIAN - assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); - (void)Atomic::add(-0x10000, (volatile int*)(dest-1)); -#else - assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); - (void)Atomic::add(-0x10000, (volatile int*)(dest)); -#endif -} - -#endif // SHARE_VM_RUNTIME_ATOMIC_INLINE_HPP diff --git a/hotspot/src/share/vm/runtime/biasedLocking.cpp b/hotspot/src/share/vm/runtime/biasedLocking.cpp index 1d5fd538b8d..84349601766 100644 --- a/hotspot/src/share/vm/runtime/biasedLocking.cpp +++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp @@ -28,7 +28,7 @@ #include "oops/klass.inline.hpp" #include "oops/markOop.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/task.hpp" diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp index baa4e2f508d..a8b6f8b9f01 100644 --- a/hotspot/src/share/vm/runtime/handles.cpp +++ b/hotspot/src/share/vm/runtime/handles.cpp @@ -26,7 +26,7 @@ #include "memory/allocation.inline.hpp" #include "oops/constantPool.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.cpp b/hotspot/src/share/vm/runtime/interfaceSupport.cpp index cd0d20a65e2..db7ad9ce905 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -27,7 +27,7 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "memory/resourceArea.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp index 0fc65b89fb7..86e11841cda 100644 --- a/hotspot/src/share/vm/runtime/mutex.cpp +++ b/hotspot/src/share/vm/runtime/mutex.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/mutex.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp index 7590d90c9e7..bb54827f3d7 100644 --- a/hotspot/src/share/vm/runtime/objectMonitor.cpp +++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp @@ -27,7 +27,7 @@ #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/mutexLocker.hpp" diff --git a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp index 0907a43d71a..f7830c400af 100644 --- a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp +++ b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp @@ -26,7 +26,7 @@ #ifndef SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP #define SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index e9ff778760c..a913fcc226e 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -44,7 +44,7 @@ #include "prims/jvm_misc.hpp" #include "prims/privilegedStack.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 28f00fdbe03..990306dbc45 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -39,7 +39,7 @@ #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 11e7f834dba..c2bf3c00778 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -49,7 +49,7 @@ #include "prims/methodHandles.hpp" #include "prims/nativeLookup.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index 16cf5cde781..c76c3664449 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -30,7 +30,7 @@ #include "compiler/compileBroker.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index ef8a271106a..1bbf68a461d 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -30,7 +30,7 @@ #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index c87de622492..f3481dad820 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -57,7 +57,7 @@ #include "prims/jvmtiThreadState.hpp" #include "prims/privilegedStack.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/commandLineFlagConstraintList.hpp" #include "runtime/commandLineFlagWriteableList.hpp" diff --git a/hotspot/src/share/vm/runtime/thread.inline.hpp b/hotspot/src/share/vm/runtime/thread.inline.hpp index b8c7a142612..bb1fb9c80eb 100644 --- a/hotspot/src/share/vm/runtime/thread.inline.hpp +++ b/hotspot/src/share/vm/runtime/thread.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -27,7 +27,7 @@ #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP_SCOPE -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.inline.hpp" #include "runtime/thread.hpp" diff --git a/hotspot/src/share/vm/services/mallocTracker.cpp b/hotspot/src/share/vm/services/mallocTracker.cpp index ea399401115..16a0cde04c4 100644 --- a/hotspot/src/share/vm/services/mallocTracker.cpp +++ b/hotspot/src/share/vm/services/mallocTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,6 @@ #include "precompiled.hpp" #include "runtime/atomic.hpp" -#include "runtime/atomic.inline.hpp" #include "services/mallocSiteTable.hpp" #include "services/mallocTracker.hpp" #include "services/mallocTracker.inline.hpp" diff --git a/hotspot/src/share/vm/services/memTracker.hpp b/hotspot/src/share/vm/services/memTracker.hpp index f05d39f3b4c..1682cb91f42 100644 --- a/hotspot/src/share/vm/services/memTracker.hpp +++ b/hotspot/src/share/vm/services/memTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -75,7 +75,6 @@ class MemTracker : AllStatic { #else -#include "runtime/atomic.hpp" #include "runtime/threadCritical.hpp" #include "services/mallocTracker.hpp" #include "services/virtualMemoryTracker.hpp" diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index f89ff8b87bc..3bd7a9f70ca 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -31,7 +31,7 @@ #include "oops/instanceKlass.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/thread.hpp" diff --git a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp index 964af28bf5b..c21aa542b2d 100644 --- a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp +++ b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "runtime/threadCritical.hpp" #include "services/memTracker.hpp" diff --git a/hotspot/src/share/vm/shark/sharkRuntime.cpp b/hotspot/src/share/vm/shark/sharkRuntime.cpp index 454c87f657e..fff58022612 100644 --- a/hotspot/src/share/vm/shark/sharkRuntime.cpp +++ b/hotspot/src/share/vm/shark/sharkRuntime.cpp @@ -24,7 +24,7 @@ */ #include "precompiled.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/deoptimization.hpp" #include "runtime/thread.hpp" diff --git a/hotspot/src/share/vm/utilities/accessFlags.cpp b/hotspot/src/share/vm/utilities/accessFlags.cpp index 9cc0f1bb95a..17c47b3e363 100644 --- a/hotspot/src/share/vm/utilities/accessFlags.cpp +++ b/hotspot/src/share/vm/utilities/accessFlags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "utilities/accessFlags.hpp" void AccessFlags::atomic_set_bits(jint bits) { diff --git a/hotspot/src/share/vm/utilities/bitMap.cpp b/hotspot/src/share/vm/utilities/bitMap.cpp index c9c8c73a92c..b0b7d567f8e 100644 --- a/hotspot/src/share/vm/utilities/bitMap.cpp +++ b/hotspot/src/share/vm/utilities/bitMap.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/copy.hpp" #include "utilities/debug.hpp" diff --git a/hotspot/src/share/vm/utilities/bitMap.inline.hpp b/hotspot/src/share/vm/utilities/bitMap.inline.hpp index 1b3a9bb11f0..ae890e90cde 100644 --- a/hotspot/src/share/vm/utilities/bitMap.inline.hpp +++ b/hotspot/src/share/vm/utilities/bitMap.inline.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_VM_UTILITIES_BITMAP_INLINE_HPP #define SHARE_VM_UTILITIES_BITMAP_INLINE_HPP -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "utilities/bitMap.hpp" inline void BitMap::set_bit(idx_t bit) { diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 95fd3b67e44..d48479c303d 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -38,7 +38,7 @@ #include "oops/oop.inline.hpp" #include "prims/privilegedStack.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/frame.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/share/vm/utilities/histogram.cpp b/hotspot/src/share/vm/utilities/histogram.cpp index f4d7091cd22..6787fce2f33 100644 --- a/hotspot/src/share/vm/utilities/histogram.cpp +++ b/hotspot/src/share/vm/utilities/histogram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "utilities/histogram.hpp" #ifdef ASSERT diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp index ebcaaee043d..9904650b01d 100644 --- a/hotspot/src/share/vm/utilities/macros.hpp +++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -486,4 +486,24 @@ #define OS_CPU_HEADER(basename) XSTR(OS_CPU_HEADER_STEM(basename).hpp) #define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp) +// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially +// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to +// achieve is to place your short value next to another short value, which doesn't need atomic ops. +// +// Example +// ATOMIC_SHORT_PAIR( +// volatile short _refcount, // needs atomic operation +// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) +// ); + +#ifdef VM_LITTLE_ENDIAN + #define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + non_atomic_decl; \ + atomic_decl +#else + #define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + atomic_decl; \ + non_atomic_decl +#endif + #endif // SHARE_VM_UTILITIES_MACROS_HPP diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 4a2ac95995b..8ae3d5222e3 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -31,7 +31,7 @@ #include "logging/logConfiguration.hpp" #include "prims/whitebox.hpp" #include "runtime/arguments.hpp" -#include "runtime/atomic.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/frame.inline.hpp" #include "runtime/init.hpp" #include "runtime/os.hpp" From abc62e705ce45e3821ac1c80c687eb9beefeab52 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Mon, 22 Aug 2016 16:48:04 +0200 Subject: [PATCH 23/99] 8163413: gc/metaspace/TestMetaspacePerfCounters failure Reviewed-by: ehelin, dfazunen --- .../metaspace/TestMetaspacePerfCounters.java | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java index e86819c75b4..9db2d02193b 100644 --- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java +++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java @@ -21,6 +21,7 @@ * questions. */ +import java.lang.management.GarbageCollectorMXBean; import java.util.List; import java.util.ArrayList; @@ -28,6 +29,8 @@ import jdk.test.lib.ByteCodeLoader; import jdk.test.lib.InMemoryJavaCompiler; import jdk.test.lib.Platform; +import sun.management.ManagementFactoryHelper; + import static jdk.test.lib.Asserts.*; /* @test TestMetaspacePerfCounters @@ -38,7 +41,7 @@ import static jdk.test.lib.Asserts.*; * space exists and works. * @modules java.base/jdk.internal.misc * java.compiler - * java.management + * java.management/sun.management * jdk.jvmstat/sun.jvmstat.monitor * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters @@ -51,6 +54,7 @@ import static jdk.test.lib.Asserts.*; public class TestMetaspacePerfCounters { public static Class fooClass = null; private static final String[] counterNames = {"minCapacity", "maxCapacity", "capacity", "used"}; + private static final List gcBeans = ManagementFactoryHelper.getGarbageCollectorMXBeans(); public static void main(String[] args) throws Exception { String metaspace = "sun.gc.metaspace"; @@ -68,10 +72,27 @@ public class TestMetaspacePerfCounters { } private static void checkPerfCounters(String ns) throws Exception { - long minCapacity = getMinCapacity(ns); - long maxCapacity = getMaxCapacity(ns); - long capacity = getCapacity(ns); - long used = getUsed(ns); + long gcCountBefore; + long gcCountAfter; + long minCapacity; + long maxCapacity; + long capacity; + long used; + + // The perf counter values are updated during GC and to be able to + // do the assertions below we need to ensure that the values are from + // the same GC cycle. + do { + gcCountBefore = currentGCCount(); + + minCapacity = getMinCapacity(ns); + maxCapacity = getMaxCapacity(ns); + capacity = getCapacity(ns); + used = getUsed(ns); + + gcCountAfter = currentGCCount(); + assertGTE(gcCountAfter, gcCountBefore); + } while(gcCountAfter > gcCountBefore); assertGTE(minCapacity, 0L); assertGTE(used, minCapacity); @@ -130,4 +151,12 @@ public class TestMetaspacePerfCounters { private static long getUsed(String ns) throws Exception { return PerfCounters.findByName(ns + ".used").longValue(); } + + private static long currentGCCount() { + long gcCount = 0; + for (GarbageCollectorMXBean bean : gcBeans) { + gcCount += bean.getCollectionCount(); + } + return gcCount; + } } From fca8d5b7b1d8f6beb3cfd18048d03cc8cce7889d Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Mon, 22 Aug 2016 11:06:18 -0400 Subject: [PATCH 24/99] 8163973: VM Anonymous classes should not call Class File Load Hooks Ensures CFLH's are not called for VM anonymous classes Reviewed-by: lfoltan, dholmes, coleenp, vlivanov, acorn --- .../src/share/vm/classfile/klassFactory.cpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/hotspot/src/share/vm/classfile/klassFactory.cpp b/hotspot/src/share/vm/classfile/klassFactory.cpp index 6eb6ccc9405..4d08ea3329c 100644 --- a/hotspot/src/share/vm/classfile/klassFactory.cpp +++ b/hotspot/src/share/vm/classfile/klassFactory.cpp @@ -31,12 +31,12 @@ #include "prims/jvmtiEnvBase.hpp" #include "trace/traceMacros.hpp" -static ClassFileStream* prologue(ClassFileStream* stream, - Symbol* name, - ClassLoaderData* loader_data, - Handle protection_domain, - JvmtiCachedClassFileData** cached_class_file, - TRAPS) { +static ClassFileStream* check_class_file_load_hook(ClassFileStream* stream, + Symbol* name, + ClassLoaderData* loader_data, + Handle protection_domain, + JvmtiCachedClassFileData** cached_class_file, + TRAPS) { assert(stream != NULL, "invariant"); @@ -102,8 +102,6 @@ instanceKlassHandle KlassFactory::create_from_stream(ClassFileStream* stream, assert(loader_data != NULL, "invariant"); assert(THREAD->is_Java_thread(), "must be a JavaThread"); - bool changed_by_loadhook = false; - ResourceMark rm; HandleMark hm; @@ -111,12 +109,15 @@ instanceKlassHandle KlassFactory::create_from_stream(ClassFileStream* stream, ClassFileStream* old_stream = stream; - stream = prologue(stream, - name, - loader_data, - protection_domain, - &cached_class_file, - CHECK_NULL); + // Skip this processing for VM anonymous classes + if (host_klass == NULL) { + stream = check_class_file_load_hook(stream, + name, + loader_data, + protection_domain, + &cached_class_file, + CHECK_NULL); + } ClassFileParser parser(stream, name, From 1d929d1259b02dde9e1237459e0499a6575c3c20 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Tue, 23 Aug 2016 13:20:51 -0400 Subject: [PATCH 25/99] 8155964: Create a set of tests for verifying the Minimal VM Reviewed-by: gtriantafill, dholmes, lmesnik, cjplummer --- hotspot/test/TEST.groups | 5 ++ hotspot/test/runtime/MinimalVM/CDS.java | 55 ++++++++++++++++++ hotspot/test/runtime/MinimalVM/CheckJNI.java | 43 ++++++++++++++ .../runtime/MinimalVM/Instrumentation.java | 45 +++++++++++++++ hotspot/test/runtime/MinimalVM/JMX.java | 55 ++++++++++++++++++ hotspot/test/runtime/MinimalVM/JVMTI.java | 47 +++++++++++++++ hotspot/test/runtime/MinimalVM/NMT.java | 57 +++++++++++++++++++ hotspot/test/runtime/MinimalVM/Xprof.java | 44 ++++++++++++++ 8 files changed, 351 insertions(+) create mode 100644 hotspot/test/runtime/MinimalVM/CDS.java create mode 100644 hotspot/test/runtime/MinimalVM/CheckJNI.java create mode 100644 hotspot/test/runtime/MinimalVM/Instrumentation.java create mode 100644 hotspot/test/runtime/MinimalVM/JMX.java create mode 100644 hotspot/test/runtime/MinimalVM/JVMTI.java create mode 100644 hotspot/test/runtime/MinimalVM/NMT.java create mode 100644 hotspot/test/runtime/MinimalVM/Xprof.java diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index c87769b91e1..2fdda388eea 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -407,6 +407,11 @@ hotspot_runtime_tier2_platform_agnostic = \ runtime/SelectionResolution \ -:hotspot_fast_runtime +hotspot_runtime_minimalvm = \ + runtime/MinimalVM \ + runtime/ErrorHandling \ + runtime/logging + #All tests that depends on nashorn extension. # needs_nashorn = \ diff --git a/hotspot/test/runtime/MinimalVM/CDS.java b/hotspot/test/runtime/MinimalVM/CDS.java new file mode 100644 index 00000000000..e166d961fac --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/CDS.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @run driver CDS + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class CDS { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb; + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:dump"); + new OutputAnalyzer(pb.start()) + .shouldContain("Shared spaces are not supported in this VM") + .shouldHaveExitValue(1); + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:on"); + new OutputAnalyzer(pb.start()) + .shouldContain("Shared spaces are not supported in this VM") + .shouldHaveExitValue(1); + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xshare:auto", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Shared spaces are not supported in this VM") + .shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/MinimalVM/CheckJNI.java b/hotspot/test/runtime/MinimalVM/CheckJNI.java new file mode 100644 index 00000000000..14219653574 --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/CheckJNI.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @run driver CheckJNI + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class CheckJNI { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xcheck:jni", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Minimal VM warning: JNI CHECKING is not supported in this VM") + .shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/MinimalVM/Instrumentation.java b/hotspot/test/runtime/MinimalVM/Instrumentation.java new file mode 100644 index 00000000000..c5c56cead35 --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/Instrumentation.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * java.instrument + * @run driver Instrumentation + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class Instrumentation { + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-minimal", "-javaagent:redefineagent.jar", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Instrumentation agents are not supported in this VM") + .shouldHaveExitValue(1); + } +} diff --git a/hotspot/test/runtime/MinimalVM/JMX.java b/hotspot/test/runtime/MinimalVM/JMX.java new file mode 100644 index 00000000000..e57325ebaa7 --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/JMX.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @library /test/lib + * @run main/othervm JMX + */ + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class JMX { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb; + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:+ManagementServer", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("ManagementServer is not supported in this VM.") + .shouldHaveExitValue(1); + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Dcom.sun.management ", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("-Dcom.sun.management is not supported in this VM.") + .shouldHaveExitValue(1); + + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), Long.toString(ProcessTools.getProcessId()), "VM.print_threads"}); + new OutputAnalyzer(pb.start()) + .shouldContain("Could not find any processes matching ") + .shouldHaveExitValue(1); + } +} diff --git a/hotspot/test/runtime/MinimalVM/JVMTI.java b/hotspot/test/runtime/MinimalVM/JVMTI.java new file mode 100644 index 00000000000..ef3f481d15d --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/JVMTI.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @run driver JVMTI + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class JVMTI { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-minimal", + "-agentlib:jdwp=server=y,transport=dt_socket,address=5000,suspend=n", + "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Debugging agents are not supported in this VM") + .shouldHaveExitValue(1); + + } +} diff --git a/hotspot/test/runtime/MinimalVM/NMT.java b/hotspot/test/runtime/MinimalVM/NMT.java new file mode 100644 index 00000000000..815fa6d0195 --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/NMT.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @run driver NMT + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class NMT { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb; + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=detail", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Native Memory Tracking is not supported in this VM") + .shouldHaveExitValue(1); + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=summary", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Native Memory Tracking is not supported in this VM") + .shouldHaveExitValue(1); + + pb = ProcessTools.createJavaProcessBuilder("-minimal", "-XX:NativeMemoryTracking=off", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Native Memory Tracking is not supported in this VM") + .shouldHaveExitValue(1); + + + } +} diff --git a/hotspot/test/runtime/MinimalVM/Xprof.java b/hotspot/test/runtime/MinimalVM/Xprof.java new file mode 100644 index 00000000000..dd3e337cc66 --- /dev/null +++ b/hotspot/test/runtime/MinimalVM/Xprof.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.flavor == "minimal" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @run driver Xprof + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class Xprof { + + public static void main(String args[]) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xprof", "-version"); + new OutputAnalyzer(pb.start()) + .shouldContain("Flat profiling is not supported in this VM.") + .shouldHaveExitValue(1); + + } +} From c98e599afa9307d601f4aba91c35384deae24ea7 Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Tue, 23 Aug 2016 19:21:48 +0200 Subject: [PATCH 26/99] 8164523: Clean up metadata for event based tracing Reviewed-by: mlarsson, mgronlun --- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 2 +- hotspot/src/share/vm/ci/ciEnv.cpp | 6 +- hotspot/src/share/vm/ci/ciMethod.cpp | 8 +- hotspot/src/share/vm/ci/ciMethod.hpp | 2 +- .../share/vm/classfile/systemDictionary.cpp | 1 - .../src/share/vm/compiler/compileBroker.cpp | 3 +- .../src/share/vm/gc/g1/heapRegionTracer.cpp | 2 +- .../src/share/vm/gc/shared/allocTracer.cpp | 8 +- .../src/share/vm/gc/shared/gcTraceSend.cpp | 43 +-- .../vm/gc/shared/objectCountEventSender.cpp | 2 +- hotspot/src/share/vm/opto/bytecodeInfo.cpp | 2 +- hotspot/src/share/vm/opto/compile.hpp | 4 +- hotspot/src/share/vm/prims/unsafe.cpp | 2 +- hotspot/src/share/vm/runtime/globals.cpp | 4 +- .../src/share/vm/runtime/objectMonitor.cpp | 4 +- hotspot/src/share/vm/runtime/safepoint.cpp | 2 +- hotspot/src/share/vm/runtime/sweeper.cpp | 2 +- hotspot/src/share/vm/runtime/synchronizer.cpp | 2 +- hotspot/src/share/vm/trace/traceDataTypes.hpp | 1 - hotspot/src/share/vm/trace/traceMacros.hpp | 1 - hotspot/src/share/vm/trace/traceevents.xml | 330 +++++++++--------- .../src/share/vm/trace/tracerelationdecls.xml | 10 +- hotspot/src/share/vm/trace/tracetypes.xml | 108 +++--- 23 files changed, 271 insertions(+), 278 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 7120e76c874..d78cdc81cf2 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -4255,7 +4255,7 @@ void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool succes #if INCLUDE_TRACE EventCompilerInlining event; if (event.should_commit()) { - event.set_compileID(compilation()->env()->task()->compile_id()); + event.set_compileId(compilation()->env()->task()->compile_id()); event.set_message(msg); event.set_succeeded(success); event.set_bci(bci()); diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 323b75a5016..024909b1cbc 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -1149,10 +1149,10 @@ void ciEnv::record_failure(const char* reason) { void ciEnv::report_failure(const char* reason) { // Create and fire JFR event - EventCompilerFailure event; + EventCompilationFailure event; if (event.should_commit()) { - event.set_compileID(compile_id()); - event.set_failure(reason); + event.set_compileId(compile_id()); + event.set_failureMessage(reason); event.commit(); } } diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index a54c0a724de..4860427786f 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -1410,11 +1410,11 @@ void ciMethod::print_impl(outputStream* st) { } #if INCLUDE_TRACE -TraceStructCiMethod ciMethod::to_trace_struct() const { - TraceStructCiMethod result; - result.set_class(holder()->name()->as_utf8()); +TraceStructCalleeMethod ciMethod::to_trace_struct() const { + TraceStructCalleeMethod result; + result.set_type(holder()->name()->as_utf8()); result.set_name(name()->as_utf8()); - result.set_signature(signature()->as_symbol()->as_utf8()); + result.set_descriptor(signature()->as_symbol()->as_utf8()); return result; } #endif diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 7a56f1cf2a5..94e6ac523c7 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -342,7 +342,7 @@ class ciMethod : public ciMetadata { void print_short_name(outputStream* st = tty); #if INCLUDE_TRACE - TraceStructCiMethod to_trace_struct() const; + TraceStructCalleeMethod to_trace_struct() const; #endif }; diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 033980e3d78..70f9e6a169f 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1641,7 +1641,6 @@ void SystemDictionary::define_instance_class(instanceKlassHandle k, TRAPS) { JvmtiExport::post_class_load((JavaThread *) THREAD, k()); } - TRACE_KLASS_DEFINITION(k, THREAD); class_define_event(k); } diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index a485ddfda61..b3bc80c6a51 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1755,7 +1755,7 @@ void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, Even assert(task->compile_id() != CICrashAt, "just as planned"); if (event.should_commit()) { event.set_method(task->method()); - event.set_compileID(task->compile_id()); + event.set_compileId(task->compile_id()); event.set_compileLevel(task->comp_level()); event.set_succeded(task->is_success()); event.set_isOsr(task->osr_bci() != CompileBroker::standard_entry_bci); @@ -2399,4 +2399,3 @@ void CompileBroker::print_last_compile() { } } } - diff --git a/hotspot/src/share/vm/gc/g1/heapRegionTracer.cpp b/hotspot/src/share/vm/gc/g1/heapRegionTracer.cpp index ec3febd2f64..35baa9d5d66 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionTracer.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionTracer.cpp @@ -39,7 +39,7 @@ void HeapRegionTracer::send_region_type_change(uint index, e.set_to(to); e.set_start(start); e.set_used(used); - e.set_allocContext(allocationContext); + e.set_allocationContext(allocationContext); e.commit(); } } diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.cpp b/hotspot/src/share/vm/gc/shared/allocTracer.cpp index af427a8289f..5f79a3310b3 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.cpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.cpp @@ -29,18 +29,18 @@ #include "utilities/globalDefinitions.hpp" void AllocTracer::send_allocation_outside_tlab_event(KlassHandle klass, size_t alloc_size) { - EventAllocObjectOutsideTLAB event; + EventObjectAllocationOutsideTLAB event; if (event.should_commit()) { - event.set_class(klass()); + event.set_objectClass(klass()); event.set_allocationSize(alloc_size); event.commit(); } } void AllocTracer::send_allocation_in_new_tlab_event(KlassHandle klass, size_t tlab_size, size_t alloc_size) { - EventAllocObjectInNewTLAB event; + EventObjectAllocationInNewTLAB event; if (event.should_commit()) { - event.set_class(klass()); + event.set_objectClass(klass()); event.set_allocationSize(alloc_size); event.set_tlabSize(tlab_size); event.commit(); diff --git a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp index e51e8fe8f54..046db77d4d5 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp @@ -43,7 +43,7 @@ typedef uintptr_t TraceAddress; void GCTracer::send_garbage_collection_event() const { - EventGCGarbageCollection event(UNTIMED); + EventGarbageCollection event(UNTIMED); if (event.should_commit()) { event.set_gcId(GCId::current()); event.set_name(_shared_gc_info.name()); @@ -91,7 +91,7 @@ void GCTracer::send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspa } void ParallelOldTracer::send_parallel_old_event() const { - EventGCParallelOld e(UNTIMED); + EventParallelOldGarbageCollection e(UNTIMED); if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_densePrefix((TraceAddress)_parallel_old_gc_info.dense_prefix()); @@ -102,7 +102,7 @@ void ParallelOldTracer::send_parallel_old_event() const { } void YoungGCTracer::send_young_gc_event() const { - EventGCYoungGarbageCollection e(UNTIMED); + EventYoungGarbageCollection e(UNTIMED); if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_tenuringThreshold(_tenuring_threshold); @@ -127,7 +127,7 @@ void YoungGCTracer::send_promotion_in_new_plab_event(Klass* klass, size_t obj_si EventPromoteObjectInNewPLAB event; if (event.should_commit()) { event.set_gcId(GCId::current()); - event.set_class(klass); + event.set_objectClass(klass); event.set_objectSize(obj_size); event.set_tenured(tenured); event.set_tenuringAge(age); @@ -142,7 +142,7 @@ void YoungGCTracer::send_promotion_outside_plab_event(Klass* klass, size_t obj_s EventPromoteObjectOutsidePLAB event; if (event.should_commit()) { event.set_gcId(GCId::current()); - event.set_class(klass); + event.set_objectClass(klass); event.set_objectSize(obj_size); event.set_tenured(tenured); event.set_tenuringAge(age); @@ -151,7 +151,7 @@ void YoungGCTracer::send_promotion_outside_plab_event(Klass* klass, size_t obj_s } void OldGCTracer::send_old_gc_event() const { - EventGCOldGarbageCollection e(UNTIMED); + EventOldGarbageCollection e(UNTIMED); if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_starttime(_shared_gc_info.start_timestamp()); @@ -173,7 +173,7 @@ void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_in EventPromotionFailed e; if (e.should_commit()) { e.set_gcId(GCId::current()); - e.set_data(to_trace_struct(pf_info)); + e.set_promotionFailed(to_trace_struct(pf_info)); e.set_thread(pf_info.thread_trace_id()); e.commit(); } @@ -190,7 +190,7 @@ void OldGCTracer::send_concurrent_mode_failure_event() { #if INCLUDE_ALL_GCS void G1NewTracer::send_g1_young_gc_event() { - EventGCG1GarbageCollection e(UNTIMED); + EventG1GarbageCollection e(UNTIMED); if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_type(_g1_young_gc_info.type()); @@ -201,7 +201,7 @@ void G1NewTracer::send_g1_young_gc_event() { } void G1MMUTracer::send_g1_mmu_event(double timeSlice, double gcTime, double maxTime) { - EventGCG1MMU e; + EventG1MMU e; if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_timeSlice(timeSlice); @@ -212,15 +212,15 @@ void G1MMUTracer::send_g1_mmu_event(double timeSlice, double gcTime, double maxT } void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) { - EventEvacuationInfo e; + EventEvacuationInformation e; if (e.should_commit()) { e.set_gcId(GCId::current()); e.set_cSetRegions(info->collectionset_regions()); e.set_cSetUsedBefore(info->collectionset_used_before()); e.set_cSetUsedAfter(info->collectionset_used_after()); e.set_allocationRegions(info->allocation_regions()); - e.set_allocRegionsUsedBefore(info->alloc_regions_used_before()); - e.set_allocRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied()); + e.set_allocationRegionsUsedBefore(info->alloc_regions_used_before()); + e.set_allocationRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied()); e.set_bytesCopied(info->bytes_copied()); e.set_regionsFreed(info->regions_freed()); e.commit(); @@ -231,13 +231,14 @@ void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_in EventEvacuationFailed e; if (e.should_commit()) { e.set_gcId(GCId::current()); - e.set_data(to_trace_struct(ef_info)); + e.set_evacuationFailed(to_trace_struct(ef_info)); e.commit(); } } -static TraceStructG1EvacStats create_g1_evacstats(unsigned gcid, const G1EvacSummary& summary) { - TraceStructG1EvacStats s; +static TraceStructG1EvacuationStatistics +create_g1_evacstats(unsigned gcid, const G1EvacSummary& summary) { + TraceStructG1EvacuationStatistics s; s.set_gcId(gcid); s.set_allocated(summary.allocated() * HeapWordSize); s.set_wasted(summary.wasted() * HeapWordSize); @@ -252,17 +253,17 @@ static TraceStructG1EvacStats create_g1_evacstats(unsigned gcid, const G1EvacSum } void G1NewTracer::send_young_evacuation_statistics(const G1EvacSummary& summary) const { - EventGCG1EvacuationYoungStatistics surv_evt; + EventG1EvacuationYoungStatistics surv_evt; if (surv_evt.should_commit()) { - surv_evt.set_stats(create_g1_evacstats(GCId::current(), summary)); + surv_evt.set_statistics(create_g1_evacstats(GCId::current(), summary)); surv_evt.commit(); } } void G1NewTracer::send_old_evacuation_statistics(const G1EvacSummary& summary) const { - EventGCG1EvacuationOldStatistics old_evt; + EventG1EvacuationOldStatistics old_evt; if (old_evt.should_commit()) { - old_evt.set_stats(create_g1_evacstats(GCId::current(), summary)); + old_evt.set_statistics(create_g1_evacstats(GCId::current(), summary)); old_evt.commit(); } } @@ -273,7 +274,7 @@ void G1NewTracer::send_basic_ihop_statistics(size_t threshold, size_t last_allocation_size, double last_allocation_duration, double last_marking_length) { - EventGCG1BasicIHOP evt; + EventG1BasicIHOP evt; if (evt.should_commit()) { evt.set_gcId(GCId::current()); evt.set_threshold(threshold); @@ -295,7 +296,7 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold, double predicted_allocation_rate, double predicted_marking_length, bool prediction_active) { - EventGCG1AdaptiveIHOP evt; + EventG1AdaptiveIHOP evt; if (evt.should_commit()) { evt.set_gcId(GCId::current()); evt.set_threshold(threshold); diff --git a/hotspot/src/share/vm/gc/shared/objectCountEventSender.cpp b/hotspot/src/share/vm/gc/shared/objectCountEventSender.cpp index 4146a809d3b..d9ca9294da6 100644 --- a/hotspot/src/share/vm/gc/shared/objectCountEventSender.cpp +++ b/hotspot/src/share/vm/gc/shared/objectCountEventSender.cpp @@ -40,7 +40,7 @@ void ObjectCountEventSender::send(const KlassInfoEntry* entry, const Ticks& time EventObjectCountAfterGC event(UNTIMED); event.set_gcId(GCId::current()); - event.set_class(entry->klass()); + event.set_objectClass(entry->klass()); event.set_count(entry->count()); event.set_totalSize(entry->words() * BytesPerWord); event.set_endtime(timestamp); diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 9882317cf0b..4c5ee040585 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -508,7 +508,7 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, #if INCLUDE_TRACE EventCompilerInlining event; if (event.should_commit()) { - event.set_compileID(C->compile_id()); + event.set_compileId(C->compile_id()); event.set_message(inline_msg); event.set_succeeded(success); event.set_bci(caller_bci); diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index f2f8c4630db..651166c50d8 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -729,7 +729,7 @@ class Compile : public Phase { if (event.should_commit()) { event.set_starttime(C->_latest_stage_start_counter); event.set_phase((u1) cpt); - event.set_compileID(C->_compile_id); + event.set_compileId(C->_compile_id); event.set_phaseLevel(level); event.commit(); } @@ -748,7 +748,7 @@ class Compile : public Phase { if (event.should_commit()) { event.set_starttime(C->_latest_stage_start_counter); event.set_phase((u1) PHASE_END); - event.set_compileID(C->_compile_id); + event.set_compileId(C->_compile_id); event.set_phaseLevel(level); event.commit(); } diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index cb876e02b01..55a968170a5 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1047,7 +1047,7 @@ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, if (event.should_commit()) { oop obj = thread->current_park_blocker(); - event.set_klass((obj != NULL) ? obj->klass() : NULL); + event.set_parkedClass((obj != NULL) ? obj->klass() : NULL); event.set_timeout(time); event.set_address((obj != NULL) ? (TYPE_ADDRESS) cast_from_oop(obj) : 0); event.commit(); diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index b0a0d798bd7..68ec6b058cc 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -975,8 +975,8 @@ template static void trace_flag_changed(const char* name, const T old_value, const T new_value, const Flag::Flags origin) { E e; e.set_name(name); - e.set_old_value(old_value); - e.set_new_value(new_value); + e.set_oldValue(old_value); + e.set_newValue(new_value); e.set_origin(origin); e.commit(); } diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp index bb54827f3d7..e765ee011eb 100644 --- a/hotspot/src/share/vm/runtime/objectMonitor.cpp +++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp @@ -390,7 +390,7 @@ void ObjectMonitor::enter(TRAPS) { } if (event.should_commit()) { - event.set_klass(((oop)this->object())->klass()); + event.set_monitorClass(((oop)this->object())->klass()); event.set_previousOwner((TYPE_THREAD)_previous_owner_tid); event.set_address((TYPE_ADDRESS)(uintptr_t)(this->object_addr())); event.commit(); @@ -1381,7 +1381,7 @@ void ObjectMonitor::post_monitor_wait_event(EventJavaMonitorWait* event, jlong timeout, bool timedout) { assert(event != NULL, "invariant"); - event->set_klass(((oop)this->object())->klass()); + event->set_monitorClass(((oop)this->object())->klass()); event->set_timeout(timeout); event->set_address((TYPE_ADDRESS)this->object_addr()); event->set_notifier(notifier_tid); diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 990306dbc45..50cae3cc396 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -173,7 +173,7 @@ void SafepointSynchronize::begin() { // block itself when it attempts transitions to a new state. // { - EventSafepointStateSync sync_event; + EventSafepointStateSynchronization sync_event; int initial_running = 0; _state = _synchronizing; diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index c76c3664449..60fc91c43e6 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -485,7 +485,7 @@ void NMethodSweeper::sweep_code_cache() { if (event.should_commit()) { event.set_starttime(sweep_start_counter); event.set_endtime(sweep_end_counter); - event.set_sweepIndex(_traversals); + event.set_sweepId(_traversals); event.set_sweptCount(swept_count); event.set_flushedCount(flushed_count); event.set_zombifiedCount(zombified_count); diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 1bbf68a461d..b9004d62860 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -1819,7 +1819,7 @@ static void post_monitor_inflate_event(EventJavaMonitorInflate& event, const ObjectSynchronizer::InflateCause cause) { #if INCLUDE_TRACE assert(event.should_commit(), "check outside"); - event.set_klass(obj->klass()); + event.set_monitorClass(obj->klass()); event.set_address((TYPE_ADDRESS)(uintptr_t)(void*)obj); event.set_cause((u1)cause); event.commit(); diff --git a/hotspot/src/share/vm/trace/traceDataTypes.hpp b/hotspot/src/share/vm/trace/traceDataTypes.hpp index 5df07eb1bbe..31be0589f3f 100644 --- a/hotspot/src/share/vm/trace/traceDataTypes.hpp +++ b/hotspot/src/share/vm/trace/traceDataTypes.hpp @@ -32,7 +32,6 @@ enum { CONTENT_TYPE_NONE = 0, CONTENT_TYPE_CLASS = 20, - CONTENT_TYPE_UTF8 = 21, CONTENT_TYPE_THREAD = 22, CONTENT_TYPE_STACKTRACE = 23, CONTENT_TYPE_BYTES = 24, diff --git a/hotspot/src/share/vm/trace/traceMacros.hpp b/hotspot/src/share/vm/trace/traceMacros.hpp index a69acef1f70..67f71f3493c 100644 --- a/hotspot/src/share/vm/trace/traceMacros.hpp +++ b/hotspot/src/share/vm/trace/traceMacros.hpp @@ -30,7 +30,6 @@ typedef u8 traceid; #define EVENT_THREAD_EXIT(thread) #define EVENT_THREAD_DESTRUCT(thread) #define TRACE_KLASS_CREATION(k, p, t) -#define TRACE_KLASS_DEFINITION(k, t) #define TRACE_INIT_KLASS_ID(k) #define TRACE_REMOVE_KLASS_ID(k) diff --git a/hotspot/src/share/vm/trace/traceevents.xml b/hotspot/src/share/vm/trace/traceevents.xml index 10671cfc136..f3b6447127a 100644 --- a/hotspot/src/share/vm/trace/traceevents.xml +++ b/hotspot/src/share/vm/trace/traceevents.xml @@ -76,111 +76,112 @@ Declares a structure type that can be used in other events. - + - + - + - + - + - + - - - + + + - + + has_thread="true" has_stacktrace="true" is_instant="false"> + has_thread="true" has_stacktrace="true" is_instant="true"> + has_thread="true" is_instant="true"> - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + - - - + is_instant="true"> + + + @@ -200,7 +201,7 @@ Declares a structure type that can be used in other events. - + @@ -213,7 +214,7 @@ Declares a structure type that can be used in other events. - + @@ -244,7 +245,7 @@ Declares a structure type that can be used in other events. - + @@ -258,7 +259,7 @@ Declares a structure type that can be used in other events. - + @@ -271,7 +272,7 @@ Declares a structure type that can be used in other events. - + @@ -280,53 +281,53 @@ Declares a structure type that can be used in other events. - - + - - + - - + - - + - - + - - - - - + + + + + - - + + - - + + @@ -334,7 +335,7 @@ Declares a structure type that can be used in other events. - + @@ -347,14 +348,14 @@ Declares a structure type that can be used in other events. - - + + - - + + @@ -366,48 +367,48 @@ Declares a structure type that can be used in other events. - - + + - - + + - - + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -415,10 +416,10 @@ Declares a structure type that can be used in other events. - - + + @@ -426,81 +427,76 @@ Declares a structure type that can be used in other events. - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - + + description="Information about a G1 heap region type change" is_instant="true"> - - + + - - - - - + + has_thread="true" is_requestable="false" is_constant="false"> - + @@ -509,39 +505,39 @@ Declares a structure type that can be used in other events. + has_thread="true" is_requestable="false" is_constant="false"> - + - - - + + + - - - - + + + + - + has_thread="true" is_instant="true"> + - + - + - + has_thread="true" is_requestable="false" is_constant="false"> + @@ -550,7 +546,7 @@ Declares a structure type that can be used in other events. + has_thread="true" is_requestable="false" is_constant="false" is_instant="true"> @@ -564,14 +560,14 @@ Declares a structure type that can be used in other events. - + - - + @@ -579,46 +575,46 @@ Declares a structure type that can be used in other events. - + - + - - + + - + + description="Execution of a VM Operation" has_thread="true"> - - - - + + + + - - + + - - + + diff --git a/hotspot/src/share/vm/trace/tracerelationdecls.xml b/hotspot/src/share/vm/trace/tracerelationdecls.xml index 06a83aab418..472c5c61c8a 100644 --- a/hotspot/src/share/vm/trace/tracerelationdecls.xml +++ b/hotspot/src/share/vm/trace/tracerelationdecls.xml @@ -27,9 +27,9 @@ - - - - - + + + + + diff --git a/hotspot/src/share/vm/trace/tracetypes.xml b/hotspot/src/share/vm/trace/tracetypes.xml index c4c3ddbf959..003b9016bac 100644 --- a/hotspot/src/share/vm/trace/tracetypes.xml +++ b/hotspot/src/share/vm/trace/tracetypes.xml @@ -43,7 +43,7 @@ jvm_type means defining a new one for our own use. Example: (GcMode) - + This creates a content type CONTENT_TYPE_GCMODE @@ -61,131 +61,131 @@ Now we can use the content + data type in declaring event fields. - - - - + + + + - + - + - + - + - - + + - - + - + - + - + - + - + - + - + - + - + - + - - + - + - + - + - + - + + type="U8" jvm_type="MODULE"> - + + type="U8" jvm_type="PACKAGE"> @@ -288,8 +288,9 @@ Now we can use the content + data type in declaring event fields. - - + @@ -325,8 +326,7 @@ Now we can use the content + data type in declaring event fields. + type="u8" sizeop="sizeof(u8)"/> - + - + - + - + - + - + - + - + From 160021d374b323966a59220c3f99ff6d1d65d8ad Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 23 Aug 2016 13:44:59 -0400 Subject: [PATCH 27/99] 8038797: JVMTI FollowReferences does not report roots reachable from nmethods Also follow nmethods found on the execution stack. Reviewed-by: dlong, mgerdin --- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index fa9d5131e31..b2cf5660865 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -3119,6 +3119,11 @@ inline bool VM_HeapWalkOperation::collect_stack_roots(JavaThread* java_thread, } } + // Follow oops from compiled nmethod + if (jvf->cb() != NULL && jvf->cb()->is_nmethod()) { + blk->set_context(thread_tag, tid, depth, method); + jvf->cb()->as_nmethod()->oops_do(blk); + } } else { blk->set_context(thread_tag, tid, depth, method); if (is_top_frame) { From f2dafaefc7c00b38bd44b8469a67d3f8adb5f916 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Tue, 23 Aug 2016 21:49:33 -0400 Subject: [PATCH 28/99] 8163146: Remove os::check_heap on Windows Reviewed-by: gtriantafill, coleenp, stuefe --- hotspot/src/os/aix/vm/os_aix.cpp | 4 -- hotspot/src/os/bsd/vm/os_bsd.cpp | 5 -- hotspot/src/os/linux/vm/os_linux.cpp | 4 -- hotspot/src/os/solaris/vm/os_solaris.cpp | 4 -- hotspot/src/os/windows/vm/os_windows.cpp | 69 ------------------- hotspot/src/share/vm/memory/universe.cpp | 6 -- hotspot/src/share/vm/memory/universe.hpp | 3 +- hotspot/src/share/vm/runtime/globals.hpp | 12 +--- hotspot/src/share/vm/runtime/os.cpp | 4 -- hotspot/src/share/vm/runtime/os.hpp | 1 - hotspot/src/share/vm/runtime/vmThread.cpp | 1 - .../TestVerifyBeforeAndAfterGCFlags.java | 4 +- 12 files changed, 4 insertions(+), 113 deletions(-) diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 620a32737a0..6c668c16870 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -3800,10 +3800,6 @@ int os::stat(const char *path, struct stat *sbuf) { return ::stat(pathbuf, sbuf); } -bool os::check_heap(bool force) { - return true; -} - // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { DIR *dir = NULL; diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index c730942840e..39cfd207cc6 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3780,11 +3780,6 @@ int os::compare_file_modified_times(const char* file1, const char* file2) { return diff; } - -bool os::check_heap(bool force) { - return true; -} - // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { DIR *dir = NULL; diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index b79f8dd95ad..9248eb72e35 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -5174,10 +5174,6 @@ int os::stat(const char *path, struct stat *sbuf) { return ::stat(pathbuf, sbuf); } -bool os::check_heap(bool force) { - return true; -} - // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { DIR *dir = NULL; diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index bdb9627485e..825a679dc19 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4589,10 +4589,6 @@ void os::make_polling_page_readable(void) { } } -// OS interface. - -bool os::check_heap(bool force) { return true; } - // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { DIR *dir = NULL; diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index da89dbfb0b1..24b39189e76 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -5258,75 +5258,6 @@ int os::fork_and_exec(char* cmd) { } } -//-------------------------------------------------------------------------------------------------- -// Non-product code - -static int mallocDebugIntervalCounter = 0; -static int mallocDebugCounter = 0; - -// For debugging possible bugs inside HeapWalk (a ring buffer) -#define SAVE_COUNT 8 -static PROCESS_HEAP_ENTRY saved_heap_entries[SAVE_COUNT]; -static int saved_heap_entry_index; - -bool os::check_heap(bool force) { - if (++mallocDebugCounter < MallocVerifyStart && !force) return true; - if (++mallocDebugIntervalCounter >= MallocVerifyInterval || force) { - // Note: HeapValidate executes two hardware breakpoints when it finds something - // wrong; at these points, eax contains the address of the offending block (I think). - // To get to the exlicit error message(s) below, just continue twice. - // - // Note: we want to check the CRT heap, which is not necessarily located in the - // process default heap. - HANDLE heap = (HANDLE) _get_heap_handle(); - if (!heap) { - return true; - } - - // If we fail to lock the heap, then gflags.exe has been used - // or some other special heap flag has been set that prevents - // locking. We don't try to walk a heap we can't lock. - if (HeapLock(heap) != 0) { - PROCESS_HEAP_ENTRY phe; - phe.lpData = NULL; - memset(saved_heap_entries, 0, sizeof(saved_heap_entries)); - saved_heap_entry_index = 0; - int count = 0; - - while (HeapWalk(heap, &phe) != 0) { - count ++; - if ((phe.wFlags & PROCESS_HEAP_ENTRY_BUSY) && - !HeapValidate(heap, 0, phe.lpData)) { - tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter); - tty->print_cr("corrupted block near address %#x, length %d, count %d", phe.lpData, phe.cbData, count); - HeapUnlock(heap); - fatal("corrupted C heap"); - } else { - // Save previous seen entries in a ring buffer. We have seen strange - // heap corruption fatal errors that produced mdmp files, but when we load - // these mdmp files in WinDBG, "!heap -triage" shows no error. - // We can examine the saved_heap_entries[] array in the mdmp file to - // diagnose such seemingly spurious errors reported by HeapWalk. - saved_heap_entries[saved_heap_entry_index++] = phe; - if (saved_heap_entry_index >= SAVE_COUNT) { - saved_heap_entry_index = 0; - } - } - } - DWORD err = GetLastError(); - if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED && - (err == ERROR_INVALID_FUNCTION && phe.lpData != NULL)) { - HeapUnlock(heap); - fatal("heap walk aborted with error %d", err); - } - HeapUnlock(heap); - } - mallocDebugIntervalCounter = 0; - } - return true; -} - - bool os::find(address addr, outputStream* st) { int offset = -1; bool result = false; diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index a261e333883..1e434d1b79a 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1129,8 +1129,6 @@ void Universe::initialize_verify_flags() { verify_flags |= Verify_MetaspaceAux; } else if (strcmp(token, "jni_handles") == 0) { verify_flags |= Verify_JNIHandles; - } else if (strcmp(token, "c-heap") == 0) { - verify_flags |= Verify_CHeap; } else if (strcmp(token, "codecache_oops") == 0) { verify_flags |= Verify_CodeCacheOops; } else { @@ -1208,10 +1206,6 @@ void Universe::verify(VerifyOption option, const char* prefix) { log_debug(gc, verify)("JNIHandles"); JNIHandles::verify(); } - if (should_verify_subset(Verify_CHeap)) { - log_debug(gc, verify)("C-heap"); - os::check_heap(); - } if (should_verify_subset(Verify_CodeCacheOops)) { log_debug(gc, verify)("CodeCache Oops"); CodeCache::verify_oops(); diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 924809b5704..054b11aa873 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -480,8 +480,7 @@ class Universe: AllStatic { Verify_ClassLoaderDataGraph = 64, Verify_MetaspaceAux = 128, Verify_JNIHandles = 256, - Verify_CHeap = 512, - Verify_CodeCacheOops = 1024, + Verify_CodeCacheOops = 512, Verify_All = -1 }; static void initialize_verify_flags(); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 89314669efd..20b62a688ea 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -2242,7 +2242,7 @@ public: "in a comma separated string. Sub-systems are: " \ "threads, heap, symbol_table, string_table, codecache, " \ "dictionary, classloader_data_graph, metaspace, jni_handles, " \ - "c-heap, codecache_oops") \ + "codecache_oops") \ \ diagnostic(bool, GCParallelVerificationEnabled, true, \ "Enable parallel memory system verification") \ @@ -3008,16 +3008,6 @@ public: notproduct(intx, ZombieALotInterval, 5, \ "Number of exits until ZombieALot kicks in") \ \ - diagnostic(intx, MallocVerifyInterval, 0, \ - "If non-zero, verify C heap after every N calls to " \ - "malloc/realloc/free") \ - range(0, max_intx) \ - \ - diagnostic(intx, MallocVerifyStart, 0, \ - "If non-zero, start verifying C heap after Nth call to " \ - "malloc/realloc/free") \ - range(0, max_intx) \ - \ diagnostic(uintx, MallocMaxTestWords, 0, \ "If non-zero, maximum number of words that malloc/realloc can " \ "allocate (for testing only)") \ diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index a913fcc226e..7089f6a6629 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -596,8 +596,6 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { } #endif - NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); - // For the test flag -XX:MallocMaxTestWords if (has_reached_max_malloc_test_peak(size)) { return NULL; @@ -658,7 +656,6 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa // NMT support void* membase = MemTracker::malloc_base(memblock); verify_memory(membase); - NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); if (size == 0) { return NULL; } @@ -695,7 +692,6 @@ void os::free(void *memblock) { } void* membase = MemTracker::record_free(memblock); verify_memory(membase); - NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); GuardedMemory guarded(membase); size_t size = guarded.get_user_size(); diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 0cf1bd6e068..431e7b2a985 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -709,7 +709,6 @@ class os: AllStatic { static void* realloc (void *memblock, size_t size, MEMFLAGS flag); static void free (void *memblock); - static bool check_heap(bool force = false); // verify C heap integrity static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup // Like strdup, but exit VM when strdup() returns NULL static char* strdup_check_oom(const char*, MEMFLAGS flags = mtInternal); diff --git a/hotspot/src/share/vm/runtime/vmThread.cpp b/hotspot/src/share/vm/runtime/vmThread.cpp index d7c0137a1f4..5b3fda00fd9 100644 --- a/hotspot/src/share/vm/runtime/vmThread.cpp +++ b/hotspot/src/share/vm/runtime/vmThread.cpp @@ -279,7 +279,6 @@ void VMThread::run() { HandleMark hm(VMThread::vm_thread()); // Among other things, this ensures that Eden top is correct. Universe::heap()->prepare_for_verify(); - os::check_heap(); // Silent verification so as not to pollute normal output, // unless we really asked for it. Universe::verify(); diff --git a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java index f2291ee7a49..db2be6d6468 100644 --- a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java +++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -43,12 +43,12 @@ import jdk.test.lib.process.ProcessTools; public class TestVerifyBeforeAndAfterGCFlags { - // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] + // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand code cache ] public static final String VERIFY_BEFORE_GC_PATTERN = "Verifying Before GC"; // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; - // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] + // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand code cache ] public static final String VERIFY_AFTER_GC_PATTERN = "Verifying After GC"; // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; From 3b1c3587d9480447972ebcd7e1e52d9e046ebf0f Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Wed, 24 Aug 2016 20:38:21 +0200 Subject: [PATCH 29/99] =?UTF-8?q?8164208:=20Update=20tests=20with=20redefi?= =?UTF-8?q?ne=20classes=20UL=20options=20and=20tags=E2=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: coleenp, gtriantafill --- hotspot/test/runtime/RedefineObject/TestRedefineObject.java | 2 +- hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java | 2 +- .../RedefineRunningMethodsWithResolutionErrors.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java index 7479dff7839..1b50e0efbb8 100644 --- a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java +++ b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java @@ -42,7 +42,7 @@ import jdk.test.lib.process.OutputAnalyzer; * @build Agent * @run main ClassFileInstaller Agent * @run main TestRedefineObject - * @run main/othervm -javaagent:agent.jar -XX:TraceRedefineClasses=5 Agent + * @run main/othervm -javaagent:agent.jar -Xlog:redefine+class+load=debug,redefine+class+timer=info Agent */ public class TestRedefineObject { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java index 25aaa16a90d..d1c5545492e 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java +++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethods.java @@ -31,7 +31,7 @@ * java.instrument * jdk.jartool/sun.tools.jar * @run main RedefineClassHelper - * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethods + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace RedefineRunningMethods */ public class RedefineRunningMethods { diff --git a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java index 4d068a25711..3560e9472c0 100644 --- a/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java +++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithResolutionErrors.java @@ -31,7 +31,7 @@ * java.instrument * jdk.jartool/sun.tools.jar * @run main RedefineClassHelper - * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethodsWithResolutionErrors + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace RedefineRunningMethodsWithResolutionErrors */ import jdk.internal.org.objectweb.asm.ClassWriter; From e316907948335f3641e0c1fcecdd1012f6091a13 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Wed, 24 Aug 2016 19:54:03 -0400 Subject: [PATCH 30/99] 8157904: Atomic::cmpxchg for jbyte is missing a fence on initial failure Reviewed-by: simonis, aph, kbarrett --- hotspot/src/share/vm/runtime/atomic.hpp | 45 ++++++++++++------- .../share/vm/utilities/globalDefinitions.hpp | 9 +++- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/hotspot/src/share/vm/runtime/atomic.hpp b/hotspot/src/share/vm/runtime/atomic.hpp index 16195c04384..a685b6070e8 100644 --- a/hotspot/src/share/vm/runtime/atomic.hpp +++ b/hotspot/src/share/vm/runtime/atomic.hpp @@ -150,26 +150,39 @@ inline void Atomic::dec(volatile size_t* dest) { * as well as defining VM_HAS_SPECIALIZED_CMPXCHG_BYTE. This will cause the platform specific * implementation to be used instead. */ -inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte *dest, jbyte comparand, cmpxchg_memory_order order) -{ - assert(sizeof(jbyte) == 1, "assumption."); - uintptr_t dest_addr = (uintptr_t)dest; - uintptr_t offset = dest_addr % sizeof(jint); - volatile jint* dest_int = (volatile jint*)(dest_addr - offset); +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, + jbyte compare_value, cmpxchg_memory_order order) { + STATIC_ASSERT(sizeof(jbyte) == 1); + volatile jint* dest_int = + static_cast(align_ptr_down(dest, sizeof(jint))); + size_t offset = pointer_delta(dest, dest_int, 1); jint cur = *dest_int; - jbyte* cur_as_bytes = (jbyte*)(&cur); - jint new_val = cur; - jbyte* new_val_as_bytes = (jbyte*)(&new_val); - new_val_as_bytes[offset] = exchange_value; - while (cur_as_bytes[offset] == comparand) { - jint res = cmpxchg(new_val, dest_int, cur, order); - if (res == cur) break; + jbyte* cur_as_bytes = reinterpret_cast(&cur); + + // current value may not be what we are looking for, so force it + // to that value so the initial cmpxchg will fail if it is different + cur_as_bytes[offset] = compare_value; + + // always execute a real cmpxchg so that we get the required memory + // barriers even on initial failure + do { + // value to swap in matches current value ... + jint new_value = cur; + // ... except for the one jbyte we want to update + reinterpret_cast(&new_value)[offset] = exchange_value; + + jint res = cmpxchg(new_value, dest_int, cur, order); + if (res == cur) break; // success + + // at least one jbyte in the jint changed value, so update + // our view of the current jint cur = res; - new_val = cur; - new_val_as_bytes[offset] = exchange_value; - } + // if our jbyte is still as cur we loop and try again + } while (cur_as_bytes[offset] == compare_value); + return cur_as_bytes[offset]; } + #endif // VM_HAS_SPECIALIZED_CMPXCHG_BYTE inline unsigned Atomic::xchg(unsigned int exchange_value, volatile unsigned int* dest) { diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index aec8ab9d7bc..a7ebde3ed54 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -327,11 +327,12 @@ inline address_word castable_address(void* x) { return address_w // and then additions like // ... top() + size ... // are safe because we know that top() is at least size below end(). -inline size_t pointer_delta(const void* left, - const void* right, +inline size_t pointer_delta(const volatile void* left, + const volatile void* right, size_t element_size) { return (((uintptr_t) left) - ((uintptr_t) right)) / element_size; } + // A version specialized for HeapWord*'s. inline size_t pointer_delta(const HeapWord* left, const HeapWord* right) { return pointer_delta(left, right, sizeof(HeapWord)); @@ -516,6 +517,10 @@ inline void* align_ptr_down(void* ptr, size_t alignment) { return (void*)align_size_down((intptr_t)ptr, (intptr_t)alignment); } +inline volatile void* align_ptr_down(volatile void* ptr, size_t alignment) { + return (volatile void*)align_size_down((intptr_t)ptr, (intptr_t)alignment); +} + // Align metaspace objects by rounding up to natural word boundary inline intptr_t align_metadata_size(intptr_t size) { From 6bcba7521ca56dd076a97caa49d914743897b648 Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Mon, 29 Aug 2016 13:44:43 -0700 Subject: [PATCH 31/99] 8164837: fix jdeprscan TestLoad and TestScan failures on Windows Reviewed-by: darcy --- .../share/classes/com/sun/tools/jdeprscan/Main.java | 2 +- langtools/test/ProblemList.txt | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java index 28d4b33e886..a30add77b00 100644 --- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java +++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java @@ -181,7 +181,7 @@ public class Main implements DiagnosticListener { .filter(name -> !name.endsWith("package-info.class")) .filter(name -> !name.endsWith("module-info.class")) .map(s -> s.replaceAll("\\.class$", "")) - .map(s -> s.replace('/', '.')) + .map(s -> s.replace(File.separatorChar, '.')) .collect(toList())); } diff --git a/langtools/test/ProblemList.txt b/langtools/test/ProblemList.txt index a90395e8734..8ed5359b3be 100644 --- a/langtools/test/ProblemList.txt +++ b/langtools/test/ProblemList.txt @@ -77,10 +77,3 @@ tools/sjavac/ClasspathDependencies.java 8158002 generic-all Requires i ########################################################################### # # jdeps - -########################################################################### -# -# jdeprscan - -tools/jdeprscan/tests/jdk/jdeprscan/TestLoad.java 8164837 windows-all probably line breaks or encoding -tools/jdeprscan/tests/jdk/jdeprscan/TestScan.java 8164837 windows-all probably line breaks or encoding From 8120ff31101ef5651b04a486933db7c27dc959aa Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 30 Aug 2016 17:47:46 -0700 Subject: [PATCH 32/99] 8160851: Remove old launcher module-related options Reviewed-by: jjg, alanb --- .../com/sun/tools/javac/comp/Modules.java | 6 +- .../com/sun/tools/javac/file/Locations.java | 2 +- .../com/sun/tools/javac/main/Option.java | 24 +++---- .../javac/platform/PlatformDescription.java | 2 +- .../javac/platform/PlatformProvider.java | 4 +- .../tools/javac/platform/package-info.java | 2 +- .../tools/javac/resources/compiler.properties | 14 ++-- .../tools/javac/resources/javac.properties | 4 +- .../com/sun/tools/sjavac/options/Option.java | 8 +-- .../sun/tools/javadoc/main/ToolOption.java | 70 ------------------ .../jdk/javadoc/internal/tool/ToolOption.java | 72 +------------------ .../classes/com/sun/tools/jdeprscan/Main.java | 10 +-- .../com/sun/tools/jdeps/DepsAnalyzer.java | 2 +- .../sun/tools/jdeps/JdepsConfiguration.java | 4 +- .../com/sun/tools/jdeps/JdepsTask.java | 2 +- 15 files changed, 40 insertions(+), 186 deletions(-) diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java index d24b79529e8..8e464ef9fc6 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java @@ -1090,7 +1090,7 @@ public class Modules extends JCTree.Visitor { Set requiresPublic = requiresPublicCache.get(msym); if (requiresPublic == null) { - //the module graph may contain cycles involving automatic modules or -XaddReads edges + //the module graph may contain cycles involving automatic modules or --add-reads edges requiresPublic = new HashSet<>(); Set seen = new HashSet<>(); @@ -1192,7 +1192,7 @@ public class Modules extends JCTree.Visitor { } // Terminology comes from - // -XaddExports:module/package=target,... + // --add-exports module/package=target,... // Compare to // module module { exports package to target, ... } String moduleName = em.group(1); @@ -1245,7 +1245,7 @@ public class Modules extends JCTree.Visitor { } // Terminology comes from - // -XaddReads:target-module=source-module,... + // --add-reads target-module=source-module,... // Compare to // module target-module { requires source-module; ... } String targetName = rm.group(1); diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java index ef7f1ce0236..422f72f13d8 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java @@ -810,7 +810,7 @@ public class Locations { * SYSTEM_MODULES and MODULE_PATH. * * The Location can be specified to accept overriding classes from the - * {@code -Xpatch:= } parameter. + * {@code --patch-module = } parameter. */ private class ModuleLocationHandler extends LocationHandler implements Location { protected final String name; diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java index f20ff057191..6d39408b095 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java @@ -183,15 +183,15 @@ public enum Option { SOURCE_PATH("--source-path -sourcepath", "opt.arg.path", "opt.sourcepath", STANDARD, FILEMANAGER), - MODULE_SOURCE_PATH("--module-source-path -modulesourcepath", "opt.arg.mspath", "opt.modulesourcepath", STANDARD, FILEMANAGER), + MODULE_SOURCE_PATH("--module-source-path", "opt.arg.mspath", "opt.modulesourcepath", STANDARD, FILEMANAGER), - MODULE_PATH("--module-path -p -modulepath -mp", "opt.arg.path", "opt.modulepath", STANDARD, FILEMANAGER), + MODULE_PATH("--module-path -p", "opt.arg.path", "opt.modulepath", STANDARD, FILEMANAGER), - UPGRADE_MODULE_PATH("--upgrade-module-path -upgrademodulepath", "opt.arg.path", "opt.upgrademodulepath", STANDARD, FILEMANAGER), + UPGRADE_MODULE_PATH("--upgrade-module-path", "opt.arg.path", "opt.upgrademodulepath", STANDARD, FILEMANAGER), - SYSTEM("--system -system", "opt.arg.jdk", "opt.system", STANDARD, FILEMANAGER), + SYSTEM("--system", "opt.arg.jdk", "opt.system", STANDARD, FILEMANAGER), - PATCH_MODULE("--patch-module -Xpatch:", "opt.arg.patch", "opt.patch", EXTENDED, FILEMANAGER) { + PATCH_MODULE("--patch-module", "opt.arg.patch", "opt.patch", EXTENDED, FILEMANAGER) { // The deferred filemanager diagnostics mechanism assumes a single value per option, // but --patch-module can be used multiple times, once per module. Therefore we compose // a value for the option containing the last value specified for each module, and separate @@ -273,7 +273,7 @@ public enum Option { PROCESSOR_PATH("--processor-path -processorpath", "opt.arg.path", "opt.processorpath", STANDARD, FILEMANAGER), - PROCESSOR_MODULE_PATH("--processor-module-path -processormodulepath", "opt.arg.path", "opt.processormodulepath", STANDARD, FILEMANAGER), + PROCESSOR_MODULE_PATH("--processor-module-path", "opt.arg.path", "opt.processormodulepath", STANDARD, FILEMANAGER), PARAMETERS("-parameters","opt.parameters", STANDARD, BASIC), @@ -311,7 +311,7 @@ public enum Option { } }, - RELEASE("--release -release", "opt.arg.release", "opt.release", STANDARD, BASIC) { + RELEASE("--release", "opt.arg.release", "opt.release", STANDARD, BASIC) { @Override protected void help(Log log) { Iterable providers = @@ -566,7 +566,7 @@ public enum Option { } }, - ADD_EXPORTS("--add-exports -XaddExports:", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) { + ADD_EXPORTS("--add-exports", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) { @Override public boolean process(OptionHelper helper, String option, String arg) { String prev = helper.get(ADD_EXPORTS); @@ -575,7 +575,7 @@ public enum Option { } }, - ADD_READS("--add-reads -XaddReads:", "opt.arg.addReads", "opt.addReads", EXTENDED, BASIC) { + ADD_READS("--add-reads", "opt.arg.addReads", "opt.addReads", EXTENDED, BASIC) { @Override public boolean process(OptionHelper helper, String option, String arg) { String prev = helper.get(ADD_READS); @@ -598,9 +598,9 @@ public enum Option { MODULE("--module -m", "opt.arg.m", "opt.m", STANDARD, BASIC), - ADD_MODULES("--add-modules -addmods", "opt.arg.addmods", "opt.addmods", STANDARD, BASIC), + ADD_MODULES("--add-modules", "opt.arg.addmods", "opt.addmods", STANDARD, BASIC), - LIMIT_MODULES("--limit-modules -limitmods", "opt.arg.limitmods", "opt.limitmods", STANDARD, BASIC), + LIMIT_MODULES("--limit-modules", "opt.arg.limitmods", "opt.limitmods", STANDARD, BASIC), // This option exists only for the purpose of documenting itself. // It's actually implemented by the CommandLine class. @@ -645,7 +645,7 @@ public enum Option { } }, - MULTIRELEASE("--multi-release -multi-release", "opt.arg.multi-release", "opt.multi-release", HIDDEN, FILEMANAGER), + MULTIRELEASE("--multi-release", "opt.arg.multi-release", "opt.multi-release", HIDDEN, FILEMANAGER), INHERIT_RUNTIME_ENVIRONMENT("--inherit-runtime-environment", "opt.inherit_runtime_environment", EXTENDED, BASIC) { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformDescription.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformDescription.java index fa1fab05401..4db3712b207 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformDescription.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformDescription.java @@ -36,7 +36,7 @@ import javax.annotation.processing.Processor; import com.sun.source.util.Plugin; -/**A description of settings needed for a particular {@code -release name} option. +/**A description of settings needed for a particular {@code --release name} option. * *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformProvider.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformProvider.java index db273a4cbc5..b552c6acf22 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformProvider.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/PlatformProvider.java @@ -25,7 +25,7 @@ package com.sun.tools.javac.platform; -/** A collection of platform descriptions that can be selected using {@code -release name} +/** A collection of platform descriptions that can be selected using {@code --release name} * command line option. * Register in {@code META-INF/services/com.sun.tools.javac.platform.PlatformProvider}. * @@ -36,7 +36,7 @@ package com.sun.tools.javac.platform; */ public interface PlatformProvider { - /**Names of platforms supported by this provider. Each returned name can be used as the key for -release. + /**Names of platforms supported by this provider. Each returned name can be used as the key for --release. * * @return the platform keys */ diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java index f843a8adc52..d236ea181f4 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java @@ -24,7 +24,7 @@ */ /** - * An internal API for plugging in -release implementations. + * An internal API for plugging in --release implementations. * *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index dcb7b2e7fee..f46d344ad18 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -2780,10 +2780,10 @@ compiler.err.module-info.with.xmodule.classpath=\ illegal combination of -Xmodule and module-info on classpath compiler.err.xmodule.no.module.sourcepath=\ - illegal combination of -Xmodule and -modulesourcepath + illegal combination of -Xmodule and --module-source-path compiler.err.processorpath.no.processormodulepath=\ - illegal combination of -processorpath and -processormodulepath + illegal combination of -processorpath and --processor-module-path # 0: symbol compiler.err.package.in.other.module=\ @@ -2817,22 +2817,22 @@ compiler.err.duplicate.module.on.path=\ # 0: string compiler.err.xaddexports.malformed.entry=\ - bad value for -XaddExports: {0} + bad value for --add-exports {0} # 0: string compiler.err.xaddexports.too.many=\ - multiple -XaddExports options for {0} + multiple --add-exports options for {0} # 0: string compiler.err.xaddreads.malformed.entry=\ - bad value for -XaddReads: {0} + bad value for --add-reads {0} # 0: string compiler.err.xaddreads.too.many=\ - multiple -XaddReads options for {0} + multiple --add-reads options for {0} compiler.err.addmods.all.module.path.invalid=\ - -addmods ALL-MODULE-PATH can only be used when compiling the unnamed module + --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module compiler.misc.locn.module_source_path=\ module source path diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties index 6d17bc7ef89..05874ad9087 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties @@ -390,10 +390,10 @@ javac.version={0} {1} javac.fullVersion={0} full version "{1}" javac.err.release.bootclasspath.conflict=\ - option {0} cannot be used together with -release + option {0} cannot be used together with --release javac.err.unsupported.release.version=\ release version {0} not supported javac.err.release.not.standard.file.manager=\ - -release option specified, but the provided JavaFileManager is not a StandardJavaFileManager. + --release option specified, but the provided JavaFileManager is not a StandardJavaFileManager. diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java index fb07a4fdae0..13df6ef4d8e 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java @@ -85,13 +85,7 @@ public enum Option { helper.modulepath(paths); } }, - MODULEPATH("-modulepath", "An alias for -modulepath") { - @Override - protected void processMatching(ArgumentIterator iter, OptionHelper helper) { - MODULE_PATH.processMatching(iter, helper); - } - }, - P("-p", "An alias for -modulepath") { + P("-p", "An alias for --module-path") { @Override protected void processMatching(ArgumentIterator iter, OptionHelper helper) { MODULE_PATH.processMatching(iter, helper); diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java index 0838966e1c4..d3d7073f9f0 100644 --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java @@ -104,13 +104,6 @@ public enum ToolOption { } }, - MODULESOURCEPATH("-modulesourcepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.MODULE_SOURCE_PATH, arg); - } - }, - MODULE_SOURCE_PATH("--module-source-path", true) { @Override public void process(Helper helper, String arg) { @@ -118,13 +111,6 @@ public enum ToolOption { } }, - UPGRADEMODULEPATH("-upgrademodulepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.UPGRADE_MODULE_PATH, arg); - } - }, - UPGRADE_MODULE_PATH("--upgrade-module-path", true) { @Override public void process(Helper helper, String arg) { @@ -132,13 +118,6 @@ public enum ToolOption { } }, - SYSTEM("-system", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.SYSTEM, arg); - } - }, - SYSTEM_("--system", true) { @Override public void process(Helper helper, String arg) { @@ -146,13 +125,6 @@ public enum ToolOption { } }, - MODULEPATH("-modulepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.MODULE_PATH, arg); - } - }, - MODULE_PATH("--module-path", true) { @Override public void process(Helper helper, String arg) { @@ -167,13 +139,6 @@ public enum ToolOption { } }, - ADDMODS("-addmods", true) { - @Override - public void process(Helper helper, String arg) { - helper.setCompilerOpt(opt, arg); - } - }, - ADD_MODULES("--add-modules", true) { @Override public void process(Helper helper, String arg) { @@ -181,13 +146,6 @@ public enum ToolOption { } }, - LIMITMODS("-limitmods", true) { - @Override - public void process(Helper helper, String arg) { - helper.setCompilerOpt(opt, arg); - } - }, - LIMIT_MODULES("--limit-modules", true) { @Override public void process(Helper helper, String arg) { @@ -210,13 +168,6 @@ public enum ToolOption { } }, - RELEASE_OLD("-release", true) { - @Override - public void process(Helper helper, String arg) { - helper.setCompilerOpt("--release", arg); - } - }, - SOURCE("-source", true) { @Override public void process(Helper helper, String arg) { @@ -238,13 +189,6 @@ public enum ToolOption { } }, - XADDREADS("-XaddReads:", false) { - @Override - public void process(Helper helper, String arg) { - Option.ADD_READS.process(helper.getOptionHelper(), arg); - } - }, - ADD_READS("--add-reads", true) { @Override public void process(Helper helper, String arg) { @@ -252,13 +196,6 @@ public enum ToolOption { } }, - ADDEXPORTS("-XaddExports:", false) { - @Override - public void process(Helper helper, String arg) { - Option.ADD_EXPORTS.process(helper.getOptionHelper(), arg); - } - }, - ADD_EXPORTS("--add-exports", true) { @Override public void process(Helper helper, String arg) { @@ -273,13 +210,6 @@ public enum ToolOption { } }, - XPATCH("-Xpatch:", false) { - @Override - public void process(Helper helper, String arg) { - Option.XMODULE.process(helper.getOptionHelper(), arg); - } - }, - PATCH_MODULE("--patch-module", true) { @Override public void process(Helper helper, String arg) { diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java index fd07699fa83..0f5cf65cbe2 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java @@ -106,13 +106,6 @@ public enum ToolOption { } }, - MODULESOURCEPATH("-modulesourcepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.MODULE_SOURCE_PATH, arg); - } - }, - MODULE_SOURCE_PATH("--module-source-path", true) { @Override public void process(Helper helper, String arg) { @@ -120,13 +113,6 @@ public enum ToolOption { } }, - UPGRADEMODULEPATH("-upgrademodulepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.UPGRADE_MODULE_PATH, arg); - } - }, - UPGRADE_MODULE_PATH("--upgrade-module-path", true) { @Override public void process(Helper helper, String arg) { @@ -134,27 +120,13 @@ public enum ToolOption { } }, - SYSTEM("-system", true) { + SYSTEM("--system", true) { @Override public void process(Helper helper, String arg) { helper.setFileManagerOpt(Option.SYSTEM, arg); } }, - SYSTEM_("--system", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.SYSTEM, arg); - } - }, - - MODULEPATH("-modulepath", true) { - @Override - public void process(Helper helper, String arg) { - helper.setFileManagerOpt(Option.MODULE_PATH, arg); - } - }, - MODULE_PATH("--module-path", true) { @Override public void process(Helper helper, String arg) { @@ -169,13 +141,6 @@ public enum ToolOption { } }, - ADDMODS("-addmods", true) { - @Override - public void process(Helper helper, String arg) { - Option.ADD_MODULES.process(helper.getOptionHelper(), opt, arg); - } - }, - ADD_MODULES("--add-modules", true) { @Override public void process(Helper helper, String arg) { @@ -183,13 +148,6 @@ public enum ToolOption { } }, - LIMITMODS("-limitmods", true) { - @Override - public void process(Helper helper, String arg) { - Option.LIMIT_MODULES.process(helper.getOptionHelper(), opt, arg); - } - }, - LIMIT_MODULES("--limit-modules", true) { @Override public void process(Helper helper, String arg) { @@ -218,13 +176,6 @@ public enum ToolOption { } }, - RELEASE_OLD("-release", true) { - @Override - public void process(Helper helper, String arg) { - Option.RELEASE.process(helper.getOptionHelper(), opt, arg); - } - }, - SOURCE("-source", true) { @Override public void process(Helper helper, String arg) { @@ -246,13 +197,6 @@ public enum ToolOption { } }, - XADDREADS("-XaddReads:", false) { - @Override - public void process(Helper helper, String arg) { - Option.ADD_READS.process(helper.getOptionHelper(), arg); - } - }, - ADD_READS("--add-reads", true) { @Override public void process(Helper helper, String arg) { @@ -260,13 +204,6 @@ public enum ToolOption { } }, - ADDEXPORTS("-XaddExports:", false) { - @Override - public void process(Helper helper, String arg) { - Option.ADD_EXPORTS.process(helper.getOptionHelper(), arg); - } - }, - ADD_EXPORTS("--add-exports", true) { @Override public void process(Helper helper, String arg) { @@ -281,13 +218,6 @@ public enum ToolOption { } }, - XPATCH("-Xpatch:", false) { - @Override - public void process(Helper helper, String arg) { - Option.XMODULE.process(helper.getOptionHelper(), arg); - } - }, - PATCH_MODULE("--patch-module", true) { @Override public void process(Helper helper, String arg) { diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java index a30add77b00..3a024981393 100644 --- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java +++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java @@ -81,7 +81,7 @@ import javax.lang.model.element.TypeElement; * - more rigorous GNU style option parsing; use joptsimple? * * FUTURES: - * - add module support: -addmods, -modulepath, module arg + * - add module support: --add-modules, --module-path, module arg * - load deprecation declarations from a designated class library instead * of the JDK * - load deprecation declarations from a module @@ -331,7 +331,7 @@ public class Main implements DiagnosticListener { * @throws IOException if an I/O error occurs */ boolean processSelf(Collection classes) throws IOException { - options.add("-addmods"); + options.add("--add-modules"); options.add("java.se.ee,jdk.xml.bind"); // TODO why jdk.xml.bind? if (classes.isEmpty()) { @@ -360,7 +360,7 @@ public class Main implements DiagnosticListener { * @return success value */ boolean processRelease(String release, Collection classes) throws IOException { - options.addAll(List.of("-release", release)); + options.addAll(List.of("--release", release)); if (release.equals("9")) { List rootMods = List.of("java.se", "java.se.ee"); @@ -368,7 +368,7 @@ public class Main implements DiagnosticListener { JavaCompiler.CompilationTask task = compiler.getTask(null, fm, this, // options - List.of("-addmods", String.join(",", rootMods)), + List.of("--add-modules", String.join(",", rootMods)), // classes List.of("java.lang.Object"), null); @@ -377,7 +377,7 @@ public class Main implements DiagnosticListener { return false; } Map> types = proc.getPublicTypes(); - options.add("-addmods"); + options.add("--add-modules"); options.add(String.join(",", rootMods)); return doClassNames( types.values().stream() diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DepsAnalyzer.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DepsAnalyzer.java index 128e2ea7456..2975813c14f 100644 --- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DepsAnalyzer.java +++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DepsAnalyzer.java @@ -56,7 +56,7 @@ import static java.util.stream.Collectors.*; * 1. archives specified in the command line arguments * 2. observable modules matching the source filter * 3. classpath archives matching the source filter or target filter - * 4. -addmods and -m root modules + * 4. --add-modules and -m root modules */ public class DepsAnalyzer { final JdepsConfiguration configuration; diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java index 2975651e373..3c4632a8078 100644 --- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java +++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java @@ -127,7 +127,7 @@ public class JdepsConfiguration implements AutoCloseable { } } - // all roots specified in -addmods or -m are included + // all roots specified in --add-modules or -m are included // as the initial set for analysis. roots.stream() .map(nameToModule::get) @@ -342,7 +342,7 @@ public class JdepsConfiguration implements AutoCloseable { SystemModuleFinder(String javaHome) throws IOException { if (javaHome == null) { - // -system none + // --system none this.fileSystem = null; this.root = null; this.systemModules = Collections.emptyMap(); diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java index 2cdca8bb839..38e1d08c6ef 100644 --- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java +++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java @@ -313,7 +313,7 @@ class JdepsTask { } }, - // Another alternative to list modules in -addmods option + // Another alternative to list modules in --add-modules option new HiddenOption(true, "--include-system-modules") { void process(JdepsTask task, String opt, String arg) throws BadArgs { task.options.includeSystemModulePattern = Pattern.compile(arg); From 2a62da3a6385a11353acf5f9fb87bf3e19471c8b Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 30 Aug 2016 20:49:41 -0700 Subject: [PATCH 33/99] 8165109: langtools/test switches to use new CLI options Reviewed-by: jjg, amlu --- .../test/jdk/javadoc/tool/ReleaseOption.java | 10 +++++----- .../T8139474/DashRelease7DashVerboseTest.java | 4 ++-- .../ProcessorPathNoProcessorModulePath.java | 2 +- .../MultiReleaseJarAwareSJFM.java | 2 +- .../MultiReleaseJar/MultiReleaseJarTest.java | 16 ++++++++-------- .../AnachronisticModuleInfoTest.java | 2 +- .../javac/modules/UpgradeModulePathTest.java | 2 +- .../javac/options/release/ReleaseOption.java | 4 ++-- .../options/release/ReleaseOptionClashes.java | 4 ++-- .../options/release/ReleaseOptionThroughAPI.java | 4 ++-- .../javac/platform/PlatformProviderTest.java | 4 ++-- .../tools/javac/sym/ElementStructureTest.java | 2 +- langtools/test/tools/javac/synthesize/Main.java | 2 +- langtools/test/tools/javadoc/ReleaseOption.java | 10 +++++----- .../test/tools/lib/toolbox/ModuleBuilder.java | 2 +- 15 files changed, 35 insertions(+), 35 deletions(-) diff --git a/langtools/test/jdk/javadoc/tool/ReleaseOption.java b/langtools/test/jdk/javadoc/tool/ReleaseOption.java index 9761af3f039..774b10ed658 100644 --- a/langtools/test/jdk/javadoc/tool/ReleaseOption.java +++ b/langtools/test/jdk/javadoc/tool/ReleaseOption.java @@ -33,7 +33,7 @@ import jdk.javadoc.internal.tool.Main; /** * @test * @bug 8086737 - * @summary Test -release option in javadoc + * @summary Test --release option in javadoc * @run main ReleaseOption * @modules jdk.javadoc/jdk.javadoc.internal.tool */ @@ -43,10 +43,10 @@ public class ReleaseOption { } void run() { - doRunTest(0, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "-release", "7"); - doRunTest(0, out -> !out.contains("compiler.err.doesnt.exist: java.util.stream"), "-release", "8"); - doRunTest(1, out -> true, "-release", "7", "-source", "7"); - doRunTest(1, out -> true, "-release", "7", "-bootclasspath", "any"); + doRunTest(0, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "7"); + doRunTest(0, out -> !out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "8"); + doRunTest(1, out -> true, "--release", "7", "-source", "7"); + doRunTest(1, out -> true, "--release", "7", "-bootclasspath", "any"); } void doRunTest(int expectedResult, Predicate validate, String... args) { diff --git a/langtools/test/tools/javac/T8139474/DashRelease7DashVerboseTest.java b/langtools/test/tools/javac/T8139474/DashRelease7DashVerboseTest.java index 5e0c19cddb3..38f9f583884 100644 --- a/langtools/test/tools/javac/T8139474/DashRelease7DashVerboseTest.java +++ b/langtools/test/tools/javac/T8139474/DashRelease7DashVerboseTest.java @@ -24,8 +24,8 @@ /* * @test * bug 8139474 - * @summary -release 7 -verbose causes Javac exception - * @compile -release 7 -verbose DashRelease7DashVerboseTest.java + * @summary --release 7 -verbose causes Javac exception + * @compile --release 7 -verbose DashRelease7DashVerboseTest.java */ public class DashRelease7DashVerboseTest {} diff --git a/langtools/test/tools/javac/diags/examples/ProcessorPathNoProcessorModulePath/ProcessorPathNoProcessorModulePath.java b/langtools/test/tools/javac/diags/examples/ProcessorPathNoProcessorModulePath/ProcessorPathNoProcessorModulePath.java index 2e5d323df34..11c404cff50 100644 --- a/langtools/test/tools/javac/diags/examples/ProcessorPathNoProcessorModulePath/ProcessorPathNoProcessorModulePath.java +++ b/langtools/test/tools/javac/diags/examples/ProcessorPathNoProcessorModulePath/ProcessorPathNoProcessorModulePath.java @@ -22,6 +22,6 @@ */ // key: compiler.err.processorpath.no.processormodulepath -// options: -processormodulepath mods -processorpath mods +// options: --processor-module-path mods -processorpath mods class ProcessorPathNoProcessorModulePath {} diff --git a/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java b/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java index ae83a78ee7b..d89b16c577d 100644 --- a/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java +++ b/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java @@ -174,7 +174,7 @@ public class MultiReleaseJarAwareSJFM { jfm.setLocation(jloc, List.of(new File("multi-release.jar"))); if (version.length() > 0) { - jfm.handleOption("-multi-release", List.of(version).iterator()); + jfm.handleOption("--multi-release", List.of(version).iterator()); } CustomClassLoader cldr = new CustomClassLoader(jfm); diff --git a/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java b/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java index 39e14ab1057..ce2ce4530f8 100644 --- a/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java +++ b/langtools/test/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java @@ -135,12 +135,12 @@ public class MultiReleaseJarTest { } @Test(dataProvider="modes") - // javac -d classes -release 8 -cp multi-release.jar Main.java -> succeeds + // javac -d classes --release 8 -cp multi-release.jar Main.java -> succeeds public void main1Release8(Task.Mode mode) throws Exception { tb.writeFile("Main.java", main1); Task.Result result = new JavacTask(tb, mode) .outdir("classes") - .options("-release", "8") + .options("--release", "8") .classpath("multi-release.jar") .files("Main.java") .run(); @@ -149,12 +149,12 @@ public class MultiReleaseJarTest { } @Test(dataProvider="modes") - // javac -d classes -release 9 -cp multi-release.jar Main.java -> fails + // javac -d classes --release 9 -cp multi-release.jar Main.java -> fails public void main1Release9(Task.Mode mode) throws Exception { tb.writeFile("Main.java", main1); Task.Result result = new JavacTask(tb, mode) .outdir("classes") - .options("-release", "9") + .options("--release", "9") .classpath("multi-release.jar") .files("Main.java") .run(Task.Expect.FAIL, 1); @@ -177,12 +177,12 @@ public class MultiReleaseJarTest { } @Test(dataProvider="modes") - // javac -d classes -release 8 -cp multi-release.jar Main.java -> fails + // javac -d classes --release 8 -cp multi-release.jar Main.java -> fails public void main2Release8(Task.Mode mode) throws Exception { tb.writeFile("Main.java", main2); Task.Result result = new JavacTask(tb, mode) .outdir("classes") - .options("-release", "8") + .options("--release", "8") .classpath("multi-release.jar") .files("Main.java") .run(Task.Expect.FAIL, 1); @@ -191,12 +191,12 @@ public class MultiReleaseJarTest { } @Test(dataProvider="modes") - // javac -d classes -release 9 -cp multi-release.jar Main.java -> succeeds + // javac -d classes --release 9 -cp multi-release.jar Main.java -> succeeds public void main2Release9(Task.Mode mode) throws Exception { tb.writeFile("Main.java", main2); Task.Result result = new JavacTask(tb, mode) .outdir("classes") - .options("-release", "9") + .options("--release", "9") .classpath("multi-release.jar") .files("Main.java") .run(); diff --git a/langtools/test/tools/javac/modules/AnachronisticModuleInfo/AnachronisticModuleInfoTest.java b/langtools/test/tools/javac/modules/AnachronisticModuleInfo/AnachronisticModuleInfoTest.java index 0ac82ece5e0..5553983e709 100644 --- a/langtools/test/tools/javac/modules/AnachronisticModuleInfo/AnachronisticModuleInfoTest.java +++ b/langtools/test/tools/javac/modules/AnachronisticModuleInfo/AnachronisticModuleInfoTest.java @@ -78,7 +78,7 @@ public class AnachronisticModuleInfoTest extends TestRunner { String log = new JavacTask(tb, Task.Mode.CMDLINE) .options("-XDrawDiagnostics", - "-upgrademodulepath", modulePath) + "--upgrade-module-path", modulePath) .files(findJavaFiles(src)) .run(Task.Expect.FAIL) .writeAll() diff --git a/langtools/test/tools/javac/modules/UpgradeModulePathTest.java b/langtools/test/tools/javac/modules/UpgradeModulePathTest.java index cd83ef49734..1a923e940f8 100644 --- a/langtools/test/tools/javac/modules/UpgradeModulePathTest.java +++ b/langtools/test/tools/javac/modules/UpgradeModulePathTest.java @@ -23,7 +23,7 @@ /* * @test - * @summary tests for -upgrademodulepath + * @summary tests for --upgrade-module-path * @library /tools/lib * @modules * jdk.compiler/com.sun.tools.javac.api diff --git a/langtools/test/tools/javac/options/release/ReleaseOption.java b/langtools/test/tools/javac/options/release/ReleaseOption.java index 58f3a1d1cb1..2a7566aeb2e 100644 --- a/langtools/test/tools/javac/options/release/ReleaseOption.java +++ b/langtools/test/tools/javac/options/release/ReleaseOption.java @@ -1,9 +1,9 @@ /** * @test /nodynamiccopyright/ * @bug 8072480 - * @summary Verify that javac rejects Java 8 program with -release 7 + * @summary Verify that javac rejects Java 8 program with --release 7 * @compile ReleaseOption.java - * @compile/fail/ref=ReleaseOption-release7.out -XDrawDiagnostics -release 7 ReleaseOption.java + * @compile/fail/ref=ReleaseOption-release7.out -XDrawDiagnostics --release 7 ReleaseOption.java */ interface ReleaseOption extends java.util.stream.Stream { diff --git a/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java b/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java index f16e5081935..80c8f6c4d8d 100644 --- a/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java +++ b/langtools/test/tools/javac/options/release/ReleaseOptionClashes.java @@ -24,7 +24,7 @@ /** * @test * @bug 8072480 - * @summary Verify option clash between -release and -source is reported correctly. + * @summary Verify option clash between --release and -source is reported correctly. * @modules jdk.compiler/com.sun.tools.javac.util */ @@ -62,7 +62,7 @@ public class ReleaseOptionClashes { useRawMessages.setBoolean(null, true); ByteArrayOutputStream out = new ByteArrayOutputStream(); List options = new ArrayList<>(); - options.addAll(Arrays.asList("-release", "7")); + options.addAll(Arrays.asList("--release", "7")); options.addAll(Arrays.asList(args)); options.add(System.getProperty("test.src") + File.separator + "ReleaseOptionClashes.java"); compiler.run(null, null, out, options.toArray(new String[0])); diff --git a/langtools/test/tools/javac/options/release/ReleaseOptionThroughAPI.java b/langtools/test/tools/javac/options/release/ReleaseOptionThroughAPI.java index 705b395e6f6..3196e8cbcbf 100644 --- a/langtools/test/tools/javac/options/release/ReleaseOptionThroughAPI.java +++ b/langtools/test/tools/javac/options/release/ReleaseOptionThroughAPI.java @@ -24,7 +24,7 @@ /** * @test * @bug 8072480 - * @summary Verify that javac can handle -release when invoked using the Compiler API + * @summary Verify that javac can handle --release when invoked using the Compiler API */ import java.io.IOException; @@ -50,7 +50,7 @@ public class ReleaseOptionThroughAPI { PrintWriter outWriter = new PrintWriter(out)) { Iterable input = fm.getJavaFileObjects(System.getProperty("test.src") + "/ReleaseOption.java"); - List options = Arrays.asList("-release", "7", "-XDrawDiagnostics"); + List options = Arrays.asList("--release", "7", "-XDrawDiagnostics"); compiler.getTask(outWriter, fm, null, options, null, input).call(); String expected = diff --git a/langtools/test/tools/javac/platform/PlatformProviderTest.java b/langtools/test/tools/javac/platform/PlatformProviderTest.java index 52cb7e3bb4d..2481d02d2dd 100644 --- a/langtools/test/tools/javac/platform/PlatformProviderTest.java +++ b/langtools/test/tools/javac/platform/PlatformProviderTest.java @@ -101,7 +101,7 @@ public class PlatformProviderTest implements PlatformProvider { "-J--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED", "-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", "-XDrawDiagnostics", - "-release", + "--release", platformSpec, System.getProperty("test.src") + "/PlatformProviderTestSource.java") .run(); @@ -135,7 +135,7 @@ public class PlatformProviderTest implements PlatformProvider { .options("-J--class-path=" + System.getProperty("test.classes"), "-J--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED", "-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", - "-release", + "--release", "fail", System.getProperty("test.src") + "/PlatformProviderTestSource.java") .run(Task.Expect.FAIL); diff --git a/langtools/test/tools/javac/sym/ElementStructureTest.java b/langtools/test/tools/javac/sym/ElementStructureTest.java index 55bc75d20e2..7a85c824be4 100644 --- a/langtools/test/tools/javac/sym/ElementStructureTest.java +++ b/langtools/test/tools/javac/sym/ElementStructureTest.java @@ -255,7 +255,7 @@ public class ElementStructureTest { } void run(Writer output, String version) throws Exception { - List options = Arrays.asList("-release", version, "-classpath", ""); + List options = Arrays.asList("--release", version, "-classpath", ""); List files = Arrays.asList(new ToolBox.JavaSource("Test", "")); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, null, null, options, null, files); diff --git a/langtools/test/tools/javac/synthesize/Main.java b/langtools/test/tools/javac/synthesize/Main.java index 5817142cc41..d92cff2a96e 100644 --- a/langtools/test/tools/javac/synthesize/Main.java +++ b/langtools/test/tools/javac/synthesize/Main.java @@ -99,7 +99,7 @@ public class Main if (stdBootClassPath) { args.add("-Xmodule:java.base"); } else { - args.add("-system"); + args.add("--system"); args.add("none"); files.add("module-info.java"); } diff --git a/langtools/test/tools/javadoc/ReleaseOption.java b/langtools/test/tools/javadoc/ReleaseOption.java index d786e36e512..54e505c3bf1 100644 --- a/langtools/test/tools/javadoc/ReleaseOption.java +++ b/langtools/test/tools/javadoc/ReleaseOption.java @@ -34,7 +34,7 @@ import com.sun.tools.javadoc.Main; /** * @test * @bug 8086737 - * @summary Test -release option in javadoc + * @summary Test --release option in javadoc * @run main ReleaseOption */ public class ReleaseOption { @@ -43,10 +43,10 @@ public class ReleaseOption { } void run() { - doRunTest(0, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "-release", "7"); - doRunTest(0, out -> !out.contains("compiler.err.doesnt.exist: java.util.stream"), "-release", "8"); - doRunTest(1, out -> true, "-release", "7", "-source", "7"); - doRunTest(1, out -> true, "-release", "7", "-bootclasspath", "any"); + doRunTest(0, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "7"); + doRunTest(0, out -> !out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "8"); + doRunTest(1, out -> true, "--release", "7", "-source", "7"); + doRunTest(1, out -> true, "--release", "7", "-bootclasspath", "any"); } void doRunTest(int expectedResult, Predicate validate, String... args) { diff --git a/langtools/test/tools/lib/toolbox/ModuleBuilder.java b/langtools/test/tools/lib/toolbox/ModuleBuilder.java index fc2b0440a57..8c7390261a2 100644 --- a/langtools/test/tools/lib/toolbox/ModuleBuilder.java +++ b/langtools/test/tools/lib/toolbox/ModuleBuilder.java @@ -205,7 +205,7 @@ public class ModuleBuilder { .collect(Collectors.joining(File.pathSeparator)); new JavacTask(tb) .outdir(Files.createDirectories(modules.resolve(name))) - .options("-mp", mp) + .options("--module-path", mp) .files(tb.findJavaFiles(moduleSrc)) .run() .writeAll(); From 7dceb3e785400ac7a2f7cc0c4694ccdc65470e2f Mon Sep 17 00:00:00 2001 From: Robert Field Date: Wed, 31 Aug 2016 10:35:51 -0700 Subject: [PATCH 34/99] 8164518: JShell: Add failover case of explicitly listening to "localhost" Reviewed-by: jlahoda --- .../share/classes/jdk/jshell/JShell.java | 5 +- .../execution/JDIDefaultExecutionControl.java | 17 +++++-- .../jdk/jshell/execution/JDIInitiator.java | 9 +++- .../JDILaunchingExecutionControlTest.java | 46 +++++++++++++++++++ .../JDIListeningExecutionControlTest.java | 4 +- ...isteningLocalhostExecutionControlTest.java | 46 +++++++++++++++++++ .../jdk/jshell/UserJDIUserRemoteTest.java | 2 +- 7 files changed, 116 insertions(+), 13 deletions(-) create mode 100644 langtools/test/jdk/jshell/JDILaunchingExecutionControlTest.java create mode 100644 langtools/test/jdk/jshell/JDIListeningLocalhostExecutionControlTest.java diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java index a0ec79e9469..fd97832b676 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java @@ -51,8 +51,6 @@ import jdk.jshell.spi.ExecutionControl.EngineTerminationException; import jdk.jshell.spi.ExecutionControl.ExecutionControlException; import jdk.jshell.spi.ExecutionEnv; import static jdk.jshell.execution.Util.failOverExecutionControlGenerator; -import static java.util.stream.Collectors.collectingAndThen; -import static java.util.stream.Collectors.toList; import static jdk.jshell.Util.expunge; /** @@ -120,7 +118,8 @@ public class JShell implements AutoCloseable { this.executionControlGenerator = b.executionControlGenerator==null ? failOverExecutionControlGenerator( JDIDefaultExecutionControl.launch(), - JDIDefaultExecutionControl.listen()) + JDIDefaultExecutionControl.listen("localhost"), + JDIDefaultExecutionControl.listen(null)) : b.executionControlGenerator; this.maps = new SnippetMaps(this); diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java index 75f644efebd..bdf0873acab 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java @@ -77,17 +77,19 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { * @return the generator */ public static ExecutionControl.Generator launch() { - return env -> create(env, true); + return env -> create(env, true, null); } /** * Creates an ExecutionControl instance based on a JDI * {@code ListeningConnector}. * + * @param host explicit hostname to use, if null use discovered + * hostname, applies to listening only (!isLaunch) * @return the generator */ - public static ExecutionControl.Generator listen() { - return env -> create(env, false); + public static ExecutionControl.Generator listen(String host) { + return env -> create(env, false, host); } /** @@ -100,10 +102,15 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { * * @param env the context passed by * {@link jdk.jshell.spi.ExecutionControl#start(jdk.jshell.spi.ExecutionEnv) } + * @param isLaunch does JDI do the launch? That is, LaunchingConnector, + * otherwise we start explicitly and use ListeningConnector + * @param host explicit hostname to use, if null use discovered + * hostname, applies to listening only (!isLaunch) * @return the channel * @throws IOException if there are errors in set-up */ - private static JDIDefaultExecutionControl create(ExecutionEnv env, boolean isLaunch) throws IOException { + private static JDIDefaultExecutionControl create(ExecutionEnv env, + boolean isLaunch, String host) throws IOException { try (final ServerSocket listener = new ServerSocket(0)) { // timeout after 60 seconds listener.setSoTimeout(60000); @@ -111,7 +118,7 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { // Set-up the JDI connection JDIInitiator jdii = new JDIInitiator(port, - env.extraRemoteVMOptions(), REMOTE_AGENT, isLaunch); + env.extraRemoteVMOptions(), REMOTE_AGENT, isLaunch, host); VirtualMachine vm = jdii.vm(); Process process = jdii.process(); diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java index 2c7b8d02a58..37d51db8c55 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIInitiator.java @@ -56,9 +56,11 @@ public class JDIInitiator { * @param remoteAgent full class name of remote agent to launch * @param isLaunch does JDI do the launch? That is, LaunchingConnector, * otherwise we start explicitly and use ListeningConnector + * @param host explicit hostname to use, if null use discovered + * hostname, applies to listening only (!isLaunch) */ - public JDIInitiator(int port, List remoteVMOptions, - String remoteAgent, boolean isLaunch) { + public JDIInitiator(int port, List remoteVMOptions, String remoteAgent, + boolean isLaunch, String host) { this.remoteAgent = remoteAgent; String connectorName = isLaunch @@ -72,6 +74,9 @@ public class JDIInitiator { = isLaunch ? launchArgs(port, String.join(" ", remoteVMOptions)) : new HashMap<>(); + if (host != null && !isLaunch) { + argumentName2Value.put("localAddress", host); + } this.connectorArgs = mergeConnectorArgs(connector, argumentName2Value); this.vm = isLaunch ? launchTarget() diff --git a/langtools/test/jdk/jshell/JDILaunchingExecutionControlTest.java b/langtools/test/jdk/jshell/JDILaunchingExecutionControlTest.java new file mode 100644 index 00000000000..3baa5378d7b --- /dev/null +++ b/langtools/test/jdk/jshell/JDILaunchingExecutionControlTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8164518 + * @summary Tests for standard JDI connector (without failover) -- launching + * @modules jdk.jshell/jdk.jshell.execution + * @build KullaTesting ExecutionControlTestBase + * @run testng JDILaunchingExecutionControlTest + */ + + +import org.testng.annotations.Test; +import org.testng.annotations.BeforeMethod; +import jdk.jshell.execution.JDIDefaultExecutionControl; + +@Test +public class JDILaunchingExecutionControlTest extends ExecutionControlTestBase { + + @BeforeMethod + @Override + public void setUp() { + setUp(builder -> builder.executionEngine(JDIDefaultExecutionControl.launch())); + } +} diff --git a/langtools/test/jdk/jshell/JDIListeningExecutionControlTest.java b/langtools/test/jdk/jshell/JDIListeningExecutionControlTest.java index dda377f6017..2540b90a1e3 100644 --- a/langtools/test/jdk/jshell/JDIListeningExecutionControlTest.java +++ b/langtools/test/jdk/jshell/JDIListeningExecutionControlTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8131029 8159935 8160127 + * @bug 8131029 8159935 8160127 8164518 * @summary Tests for alternate JDI connector -- listening * @modules jdk.jshell/jdk.jshell.execution * @build KullaTesting ExecutionControlTestBase @@ -41,6 +41,6 @@ public class JDIListeningExecutionControlTest extends ExecutionControlTestBase { @BeforeMethod @Override public void setUp() { - setUp(builder -> builder.executionEngine(JDIDefaultExecutionControl.listen())); + setUp(builder -> builder.executionEngine(JDIDefaultExecutionControl.listen(null))); } } diff --git a/langtools/test/jdk/jshell/JDIListeningLocalhostExecutionControlTest.java b/langtools/test/jdk/jshell/JDIListeningLocalhostExecutionControlTest.java new file mode 100644 index 00000000000..52a4487c674 --- /dev/null +++ b/langtools/test/jdk/jshell/JDIListeningLocalhostExecutionControlTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8164518 + * @summary Tests for alternate JDI connector -- listening to "localhost" + * @modules jdk.jshell/jdk.jshell.execution + * @build KullaTesting ExecutionControlTestBase + * @run testng JDIListeningLocalhostExecutionControlTest + */ + + +import org.testng.annotations.Test; +import org.testng.annotations.BeforeMethod; +import jdk.jshell.execution.JDIDefaultExecutionControl; + +@Test +public class JDIListeningLocalhostExecutionControlTest extends ExecutionControlTestBase { + + @BeforeMethod + @Override + public void setUp() { + setUp(builder -> builder.executionEngine(JDIDefaultExecutionControl.listen("localhost"))); + } +} diff --git a/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java b/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java index e1e658ab44b..06cc2f9816a 100644 --- a/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java +++ b/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java @@ -159,7 +159,7 @@ class MyExecutionControl extends JDIExecutionControl { + System.getProperty("path.separator") + System.getProperty("user.dir")); JDIInitiator jdii = new JDIInitiator(port, - opts, REMOTE_AGENT, true); + opts, REMOTE_AGENT, true, null); VirtualMachine vm = jdii.vm(); Process process = jdii.process(); From 11de22e133261f420970aa61590de962b86f8a07 Mon Sep 17 00:00:00 2001 From: Shinya Yoshida Date: Thu, 1 Sep 2016 11:07:00 +0900 Subject: [PATCH 35/99] 8164825: jshell tool: Completion for subcommand Reviewed-by: jlahoda --- .../tool/ContinuousCompletionProvider.java | 97 ++++++++++++++++ .../jdk/internal/jshell/tool/Feedback.java | 16 +++ .../jdk/internal/jshell/tool/JShellTool.java | 104 ++++++++++++------ .../jdk/jshell/CommandCompletionTest.java | 77 ++++++++++++- 4 files changed, 262 insertions(+), 32 deletions(-) create mode 100644 langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ContinuousCompletionProvider.java diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ContinuousCompletionProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ContinuousCompletionProvider.java new file mode 100644 index 00000000000..0fc6f6ca8a5 --- /dev/null +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ContinuousCompletionProvider.java @@ -0,0 +1,97 @@ +/* + * 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. 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. + */ + +package jdk.internal.jshell.tool; + +import java.util.List; +import static java.util.Comparator.comparing; +import java.util.Map; +import java.util.function.BiPredicate; +import java.util.function.Supplier; +import static java.util.stream.Collectors.toList; +import java.util.stream.Stream; +import jdk.internal.jshell.tool.JShellTool.CompletionProvider; +import jdk.jshell.SourceCodeAnalysis; +import jdk.jshell.SourceCodeAnalysis.Suggestion; + +class ContinuousCompletionProvider implements CompletionProvider { + + static final BiPredicate STARTSWITH_MATCHER = + (word, input) -> word.startsWith(input); + static final BiPredicate PERFECT_MATCHER = + (word, input) -> word.equals(input); + + private final Supplier> wordCompletionProviderSupplier; + private final BiPredicate matcher; + + ContinuousCompletionProvider( + Map wordCompletionProvider, + BiPredicate matcher) { + this(() -> wordCompletionProvider, matcher); + } + + ContinuousCompletionProvider( + Supplier> wordCompletionProviderSupplier, + BiPredicate matcher) { + this.wordCompletionProviderSupplier = wordCompletionProviderSupplier; + this.matcher = matcher; + } + + @Override + public List completionSuggestions(String input, int cursor, int[] anchor) { + String prefix = input.substring(0, cursor); + int space = prefix.indexOf(' '); + + Stream result; + + Map wordCompletionProvider = wordCompletionProviderSupplier.get(); + + if (space == (-1)) { + result = wordCompletionProvider.keySet().stream() + .distinct() + .filter(key -> key.startsWith(prefix)) + .map(key -> new JShellTool.ArgSuggestion(key + " ")); + anchor[0] = 0; + } else { + String rest = prefix.substring(space + 1); + String word = prefix.substring(0, space); + + List candidates = wordCompletionProvider.entrySet().stream() + .filter(e -> matcher.test(e.getKey(), word)) + .map(Map.Entry::getValue) + .collect(toList()); + if (candidates.size() == 1) { + result = candidates.get(0).completionSuggestions(rest, cursor - space - 1, anchor).stream(); + } else { + result = Stream.empty(); + } + anchor[0] += space + 1; + } + + return result.sorted(comparing(Suggestion::continuation)) + .collect(toList()); + } + +} diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java index 7f78c2f9962..b6d97b30215 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java @@ -35,9 +35,14 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; +import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toMap; +import static jdk.internal.jshell.tool.ContinuousCompletionProvider.PERFECT_MATCHER; +import jdk.internal.jshell.tool.JShellTool.CompletionProvider; +import static jdk.internal.jshell.tool.JShellTool.EMPTY_COMPLETION_PROVIDER; /** * Feedback customization support @@ -146,6 +151,17 @@ class Feedback { .forEach(m -> m.readOnly = true); } + JShellTool.CompletionProvider modeCompletions() { + return modeCompletions(EMPTY_COMPLETION_PROVIDER); + } + + JShellTool.CompletionProvider modeCompletions(CompletionProvider successor) { + return new ContinuousCompletionProvider( + () -> modeMap.keySet().stream() + .collect(toMap(Function.identity(), m -> successor)), + PERFECT_MATCHER); + } + { for (FormatCase e : FormatCase.all) selectorMap.put(e.name().toLowerCase(Locale.US), e); diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java index fa83c0fd40e..da8d4b0de7e 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -112,6 +112,7 @@ import static jdk.internal.jshell.debug.InternalDebugControl.DBG_DEP; import static jdk.internal.jshell.debug.InternalDebugControl.DBG_EVNT; import static jdk.internal.jshell.debug.InternalDebugControl.DBG_FMGR; import static jdk.internal.jshell.debug.InternalDebugControl.DBG_GEN; +import static jdk.internal.jshell.tool.ContinuousCompletionProvider.STARTSWITH_MATCHER; /** * Command line REPL tool for Java using the JShell API. @@ -909,6 +910,7 @@ public class JShellTool implements MessageHandler { interface CompletionProvider { List completionSuggestions(String input, int cursor, int[] anchor); + } enum CommandKind { @@ -953,14 +955,31 @@ public class JShellTool implements MessageHandler { } - private static final CompletionProvider EMPTY_COMPLETION_PROVIDER = new FixedCompletionProvider(); + static final CompletionProvider EMPTY_COMPLETION_PROVIDER = new FixedCompletionProvider(); private static final CompletionProvider KEYWORD_COMPLETION_PROVIDER = new FixedCompletionProvider("-all ", "-start ", "-history "); private static final CompletionProvider RELOAD_OPTIONS_COMPLETION_PROVIDER = new FixedCompletionProvider("-restore", "-quiet"); + private static final CompletionProvider SET_MODE_OPTIONS_COMPLETION_PROVIDER = new FixedCompletionProvider("-command", "-quiet", "-delete"); private static final CompletionProvider FILE_COMPLETION_PROVIDER = fileCompletions(p -> true); private final Map commands = new LinkedHashMap<>(); private void registerCommand(Command cmd) { commands.put(cmd.command, cmd); } + + private static CompletionProvider skipWordThenCompletion(CompletionProvider completionProvider) { + return (input, cursor, anchor) -> { + List result = Collections.emptyList(); + + int space = input.indexOf(' '); + if (space != -1) { + String rest = input.substring(space + 1); + result = completionProvider.completionSuggestions(rest, cursor - space - 1, anchor); + anchor[0] += space + 1; + } + + return result; + }; + } + private static CompletionProvider fileCompletions(Predicate accept) { return (code, cursor, anchor) -> { int lastSlash = code.lastIndexOf('/'); @@ -1037,6 +1056,31 @@ public class JShellTool implements MessageHandler { }; } + private static CompletionProvider orMostSpecificCompletion( + CompletionProvider left, CompletionProvider right) { + return (code, cursor, anchor) -> { + int[] leftAnchor = {-1}; + int[] rightAnchor = {-1}; + + List leftSuggestions = left.completionSuggestions(code, cursor, leftAnchor); + List rightSuggestions = right.completionSuggestions(code, cursor, rightAnchor); + + List suggestions = new ArrayList<>(); + + if (leftAnchor[0] >= rightAnchor[0]) { + anchor[0] = leftAnchor[0]; + suggestions.addAll(leftSuggestions); + } + + if (leftAnchor[0] <= rightAnchor[0]) { + anchor[0] = rightAnchor[0]; + suggestions.addAll(rightSuggestions); + } + + return suggestions; + }; + } + // Snippet lists Stream allSnippets() { @@ -1123,10 +1167,26 @@ public class JShellTool implements MessageHandler { EMPTY_COMPLETION_PROVIDER)); registerCommand(new Command("/set", arg -> cmdSet(arg), - new FixedCompletionProvider(SET_SUBCOMMANDS))); + new ContinuousCompletionProvider(Map.of( + // need more completion for format for usability + "format", feedback.modeCompletions(), + "truncation", feedback.modeCompletions(), + "feedback", feedback.modeCompletions(), + "mode", skipWordThenCompletion(orMostSpecificCompletion( + feedback.modeCompletions(SET_MODE_OPTIONS_COMPLETION_PROVIDER), + SET_MODE_OPTIONS_COMPLETION_PROVIDER)), + "prompt", feedback.modeCompletions(), + "editor", fileCompletions(Files::isExecutable), + "start", FILE_COMPLETION_PROVIDER), + STARTSWITH_MATCHER))); registerCommand(new Command("/retain", arg -> cmdRetain(arg), - new FixedCompletionProvider(RETAIN_SUBCOMMANDS))); + new ContinuousCompletionProvider(Map.of( + "feedback", feedback.modeCompletions(), + "mode", feedback.modeCompletions(), + "editor", fileCompletions(Files::isExecutable), + "start", FILE_COMPLETION_PROVIDER), + STARTSWITH_MATCHER))); registerCommand(new Command("/?", "help.quest", arg -> cmdHelp(arg), @@ -1151,36 +1211,18 @@ public class JShellTool implements MessageHandler { registerCommand(new Command("shortcuts", "help.shortcuts", CommandKind.HELP_SUBJECT)); + + commandCompletions = new ContinuousCompletionProvider( + commands.values().stream() + .filter(c -> c.kind.shouldSuggestCompletions) + .collect(toMap(c -> c.command, c -> c.completions)), + STARTSWITH_MATCHER); } + private ContinuousCompletionProvider commandCompletions; + public List commandCompletionSuggestions(String code, int cursor, int[] anchor) { - String prefix = code.substring(0, cursor); - int space = prefix.indexOf(' '); - Stream result; - - if (space == (-1)) { - result = commands.values() - .stream() - .distinct() - .filter(cmd -> cmd.kind.shouldSuggestCompletions) - .map(cmd -> cmd.command) - .filter(key -> key.startsWith(prefix)) - .map(key -> new ArgSuggestion(key + " ")); - anchor[0] = 0; - } else { - String arg = prefix.substring(space + 1); - String cmd = prefix.substring(0, space); - Command[] candidates = findCommand(cmd, c -> true); - if (candidates.length == 1) { - result = candidates[0].completions.completionSuggestions(arg, cursor - space, anchor).stream(); - anchor[0] += space + 1; - } else { - result = Stream.empty(); - } - } - - return result.sorted((s1, s2) -> s1.continuation().compareTo(s2.continuation())) - .collect(Collectors.toList()); + return commandCompletions.completionSuggestions(code, cursor, anchor); } public String commandDocumentation(String code, int cursor) { @@ -2484,7 +2526,7 @@ public class JShellTool implements MessageHandler { } } - private static class ArgSuggestion implements Suggestion { + static class ArgSuggestion implements Suggestion { private final String continuation; diff --git a/langtools/test/jdk/jshell/CommandCompletionTest.java b/langtools/test/jdk/jshell/CommandCompletionTest.java index 6544084a133..ad01de44959 100644 --- a/langtools/test/jdk/jshell/CommandCompletionTest.java +++ b/langtools/test/jdk/jshell/CommandCompletionTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8144095 + * @bug 8144095 8164825 * @summary Test Command Completion * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main @@ -40,6 +40,7 @@ import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Predicate; @@ -148,6 +149,80 @@ public class CommandCompletionTest extends ReplToolTesting { assertCompletion("/classpath ~/|", false, completions.toArray(new String[completions.size()])); } + public void testSet() throws IOException { + List p1 = listFiles(Paths.get("")); + FileSystems.getDefault().getRootDirectories().forEach(s -> p1.add(s.toString())); + Collections.sort(p1); + + String[] modes = {"concise ", "normal ", "silent ", "verbose "}; + String[] options = {"-command", "-delete", "-quiet"}; + String[] modesWithOptions = Stream.concat(Arrays.stream(options), Arrays.stream(modes)).sorted().toArray(String[]::new); + test(false, new String[] {"--no-startup"}, + a -> assertCompletion(a, "/se|", false, "/set "), + a -> assertCompletion(a, "/set |", false, "editor ", "feedback ", "format ", "mode ", "prompt ", "start ", "truncation "), + + // /set editor + a -> assertCompletion(a, "/set e|", false, "editor "), + a -> assertCompletion(a, "/set editor |", false, p1.toArray(new String[p1.size()])), + + // /set feedback + a -> assertCompletion(a, "/set fe|", false, "feedback "), + a -> assertCompletion(a, "/set fe |", false, modes), + + // /set format + a -> assertCompletion(a, "/set fo|", false, "format "), + a -> assertCompletion(a, "/set fo |", false, modes), + + // /set mode + a -> assertCompletion(a, "/set mo|", false, "mode "), + a -> assertCompletion(a, "/set mo |", false), + a -> assertCompletion(a, "/set mo newmode |", false, modesWithOptions), + a -> assertCompletion(a, "/set mo newmode -|", false, options), + a -> assertCompletion(a, "/set mo newmode -command |", false), + a -> assertCompletion(a, "/set mo newmode normal |", false, options), + + // /set prompt + a -> assertCompletion(a, "/set pro|", false, "prompt "), + a -> assertCompletion(a, "/set pro |", false, modes), + + // /set start + a -> assertCompletion(a, "/set st|", false, "start "), + a -> assertCompletion(a, "/set st |", false, p1.toArray(new String[p1.size()])), + + // /set truncation + a -> assertCompletion(a, "/set tr|", false, "truncation "), + a -> assertCompletion(a, "/set tr |", false, modes) + ); + } + + public void testRetain() throws IOException { + List p1 = listFiles(Paths.get("")); + FileSystems.getDefault().getRootDirectories().forEach(s -> p1.add(s.toString())); + Collections.sort(p1); + + String[] modes = {"concise ", "normal ", "silent ", "verbose "}; + test(false, new String[] {"--no-startup"}, + a -> assertCompletion(a, "/ret|", false, "/retain "), + a -> assertCompletion(a, "/retain |", false, "editor ", "feedback ", "mode ", "start "), + + // /retain editor + a -> assertCompletion(a, "/retain e|", false, "editor "), + a -> assertCompletion(a, "/retain editor |", false, p1.toArray(new String[p1.size()])), + + // /retain feedback + a -> assertCompletion(a, "/retain fe|", false, "feedback "), + a -> assertCompletion(a, "/retain fe |", false, modes), + + // /retain mode + a -> assertCompletion(a, "/retain mo|", false, "mode "), + a -> assertCompletion(a, "/retain mo |", false, modes), + + // /retain start + a -> assertCompletion(a, "/retain st|", false, "start "), + a -> assertCompletion(a, "/retain st |", false, p1.toArray(new String[p1.size()])) + ); + } + private void createIfNeeded(Path file) throws IOException { if (!Files.exists(file)) Files.createFile(file); From 9f1556675ecc9af52c915842b5f6c42df0c1ec92 Mon Sep 17 00:00:00 2001 From: Amy Lu Date: Thu, 1 Sep 2016 13:18:42 +0800 Subject: [PATCH 36/99] 8165193: Workaround intermittent failures of JavacTreeScannerTest and SourceTreeScannerTest due to C2 memory usage Reviewed-by: darcy --- langtools/test/tools/javac/tree/JavacTreeScannerTest.java | 4 ++-- langtools/test/tools/javac/tree/SourceTreeScannerTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/langtools/test/tools/javac/tree/JavacTreeScannerTest.java b/langtools/test/tools/javac/tree/JavacTreeScannerTest.java index e2b7676add3..24519b4cd83 100644 --- a/langtools/test/tools/javac/tree/JavacTreeScannerTest.java +++ b/langtools/test/tools/javac/tree/JavacTreeScannerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -41,7 +41,7 @@ * jdk.compiler/com.sun.tools.javac.tree * jdk.compiler/com.sun.tools.javac.util * @build AbstractTreeScannerTest JavacTreeScannerTest - * @run main JavacTreeScannerTest -q -r . + * @run main/othervm JavacTreeScannerTest -q -r . */ import java.io.*; diff --git a/langtools/test/tools/javac/tree/SourceTreeScannerTest.java b/langtools/test/tools/javac/tree/SourceTreeScannerTest.java index 5882037e1f6..1d1bc2cc0df 100644 --- a/langtools/test/tools/javac/tree/SourceTreeScannerTest.java +++ b/langtools/test/tools/javac/tree/SourceTreeScannerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -41,7 +41,7 @@ * jdk.compiler/com.sun.tools.javac.tree * jdk.compiler/com.sun.tools.javac.util * @build AbstractTreeScannerTest SourceTreeScannerTest - * @run main SourceTreeScannerTest -q -r . + * @run main/othervm SourceTreeScannerTest -q -r . */ import java.io.*; From 74e01787b3dd7329cc7e395156d3c0a54540d421 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Thu, 1 Sep 2016 10:30:50 +0200 Subject: [PATCH 37/99] 8131023: JShell: System.in does not work Pass user input to snippets/remote agent Reviewed-by: rfield --- .../jshell/tool/ConsoleIOContext.java | 36 ++++++ .../jdk/internal/jshell/tool/IOContext.java | 2 + .../jdk/internal/jshell/tool/JShellTool.java | 41 ++++++- .../jshell/execution/DemultiplexInput.java | 29 +++-- .../execution/JDIDefaultExecutionControl.java | 23 ++-- .../execution/MultiplexingOutputStream.java | 18 ++- .../jdk/jshell/execution/PipeInputStream.java | 29 ++++- .../execution/RemoteExecutionControl.java | 10 +- .../classes/jdk/jshell/execution/Util.java | 109 ++++++++++-------- .../test/jdk/jshell/ReplToolTesting.java | 3 +- .../test/jdk/jshell/StartOptionTest.java | 1 - langtools/test/jdk/jshell/UserInputTest.java | 44 +++++++ .../jdk/jshell/UserJDIUserRemoteTest.java | 32 ++--- 13 files changed, 265 insertions(+), 112 deletions(-) create mode 100644 langtools/test/jdk/jshell/UserInputTest.java diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java index ca475115c10..b4df8efbe54 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java @@ -57,6 +57,8 @@ import jdk.internal.jline.console.ConsoleReader; import jdk.internal.jline.console.KeyMap; import jdk.internal.jline.console.UserInterruptException; import jdk.internal.jline.console.completer.Completer; +import jdk.internal.jline.console.history.History; +import jdk.internal.jline.console.history.MemoryHistory; import jdk.internal.jline.extra.EditingHistory; import jdk.internal.jshell.tool.StopDetectingInputStream.State; @@ -68,6 +70,7 @@ class ConsoleIOContext extends IOContext { final StopDetectingInputStream input; final ConsoleReader in; final EditingHistory history; + final MemoryHistory userInputHistory = new MemoryHistory(); String prefix = ""; @@ -299,6 +302,9 @@ class ConsoleIOContext extends IOContext { } public void beforeUserCode() { + synchronized (this) { + inputBytes = null; + } input.setState(State.BUFFER); } @@ -380,6 +386,36 @@ class ConsoleIOContext extends IOContext { } } + private byte[] inputBytes; + private int inputBytesPointer; + + @Override + public synchronized int readUserInput() { + while (inputBytes == null || inputBytes.length <= inputBytesPointer) { + boolean prevHandleUserInterrupt = in.getHandleUserInterrupt(); + History prevHistory = in.getHistory(); + + try { + input.setState(State.WAIT); + in.setHandleUserInterrupt(true); + in.setHistory(userInputHistory); + inputBytes = (in.readLine("") + System.getProperty("line.separator")).getBytes(); + inputBytesPointer = 0; + } catch (IOException ex) { + ex.printStackTrace(); + return -1; + } catch (UserInterruptException ex) { + repl.state.stop(); + return -1; + } finally { + in.setHistory(prevHistory); + in.setHandleUserInterrupt(prevHandleUserInterrupt); + input.setState(State.BUFFER); + } + } + return inputBytes[inputBytesPointer++]; + } + /** * A possible action which the user can choose to perform. */ diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java index 8f8606fed05..4f4a51a44b0 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java @@ -54,6 +54,8 @@ abstract class IOContext implements AutoCloseable { public abstract void replaceLastHistoryEntry(String source); + public abstract int readUserInput(); + class InputInterruptedException extends Exception { private static final long serialVersionUID = 1L; } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java index da8d4b0de7e..203132444f2 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -26,7 +26,6 @@ package jdk.internal.jshell.tool; import java.io.BufferedWriter; -import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; @@ -139,6 +138,25 @@ public class JShellTool implements MessageHandler { final Feedback feedback = new Feedback(); + /** + * The constructor for the tool (used by tool launch via main and by test + * harnesses to capture ins and outs. + * @param in command line input -- snippets, commands and user input + * @param cmdout command line output, feedback including errors + * @param cmderr start-up errors and debugging info + * @param console console control interaction + * @param userout code execution output -- System.out.printf("hi") + * @param usererr code execution error stream -- System.err.printf("Oops") + * @param prefs preferences to use + * @param locale locale to use + */ + public JShellTool(InputStream in, PrintStream cmdout, PrintStream cmderr, + PrintStream console, + PrintStream userout, PrintStream usererr, + Preferences prefs, Locale locale) { + this(in, cmdout, cmderr, console, null, userout, usererr, prefs, locale); + } + /** * The constructor for the tool (used by tool launch via main and by test * harnesses to capture ins and outs. @@ -146,7 +164,7 @@ public class JShellTool implements MessageHandler { * @param cmdout command line output, feedback including errors * @param cmderr start-up errors and debugging info * @param console console control interaction - * @param userin code execution input (not yet functional) + * @param userin code execution input, or null to use IOContext * @param userout code execution output -- System.out.printf("hi") * @param usererr code execution error stream -- System.err.printf("Oops") * @param prefs preferences to use @@ -160,7 +178,12 @@ public class JShellTool implements MessageHandler { this.cmdout = cmdout; this.cmderr = cmderr; this.console = console; - this.userin = userin; + this.userin = userin != null ? userin : new InputStream() { + @Override + public int read() throws IOException { + return input.readUserInput(); + } + }; this.userout = userout; this.usererr = usererr; this.prefs = prefs; @@ -452,7 +475,7 @@ public class JShellTool implements MessageHandler { */ public static void main(String[] args) throws Exception { new JShellTool(System.in, System.out, System.err, System.out, - new ByteArrayInputStream(new byte[0]), System.out, System.err, + System.out, System.err, Preferences.userRoot().node("tool/JShell"), Locale.getDefault()) .start(args); @@ -2621,6 +2644,11 @@ class ScannerIOContext extends NonInteractiveIOContext { public void close() { scannerIn.close(); } + + @Override + public int readUserInput() { + return -1; + } } class FileScannerIOContext extends ScannerIOContext { @@ -2659,4 +2687,9 @@ class ReloadIOContext extends NonInteractiveIOContext { @Override public void close() { } + + @Override + public int readUserInput() { + return -1; + } } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java index ca400d536d0..09912801f7b 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java @@ -40,15 +40,14 @@ import java.util.Map; class DemultiplexInput extends Thread { private final DataInputStream delegate; - private final PipeInputStream command; private final Map io; + private final Iterable closeList; - DemultiplexInput(InputStream input, PipeInputStream command, - Map io) { + DemultiplexInput(InputStream input, Map io, Iterable closeList) { super("output reader"); this.delegate = new DataInputStream(input); - this.command = command; this.io = io; + this.closeList = closeList; } @Override @@ -65,23 +64,23 @@ class DemultiplexInput extends Thread { byte[] data = new byte[dataLen]; DemultiplexInput.this.delegate.readFully(data); String chan = new String(name, "UTF-8"); - if (chan.equals("command")) { - for (byte b : data) { - command.write(Byte.toUnsignedInt(b)); - } + OutputStream out = io.get(chan); + if (out == null) { + debug("Unexpected channel name: %s", chan); } else { - OutputStream out = io.get(chan); - if (out == null) { - debug("Unexpected channel name: %s", chan); - } else { - out.write(data); - } + out.write(data); } } } catch (IOException ex) { debug(ex, "Failed reading output"); } finally { - command.close(); + for (OutputStream out : closeList) { + try { + out.close(); + } catch (IOException ex) { + debug(ex, "Failed reading output"); + } + } } } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java index bdf0873acab..18f8282f93b 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIDefaultExecutionControl.java @@ -25,9 +25,9 @@ package jdk.jshell.execution; import java.io.IOException; +import java.io.InputStream; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.io.ObjectOutputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; @@ -48,7 +48,7 @@ import com.sun.jdi.VMDisconnectedException; import com.sun.jdi.VirtualMachine; import jdk.jshell.spi.ExecutionControl; import jdk.jshell.spi.ExecutionEnv; -import static jdk.jshell.execution.Util.remoteInput; +import static jdk.jshell.execution.Util.remoteInputOutput; /** * The implementation of {@link jdk.jshell.spi.ExecutionControl} that the @@ -109,7 +109,7 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { * @return the channel * @throws IOException if there are errors in set-up */ - private static JDIDefaultExecutionControl create(ExecutionEnv env, + private static ExecutionControl create(ExecutionEnv env, boolean isLaunch, String host) throws IOException { try (final ServerSocket listener = new ServerSocket(0)) { // timeout after 60 seconds @@ -122,10 +122,6 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { VirtualMachine vm = jdii.vm(); Process process = jdii.process(); - // Forward input to the remote agent - Util.forwardInputToRemote(env.userIn(), process.getOutputStream(), - ex -> debug(ex, "input forwarding failure")); - List> deathListeners = new ArrayList<>(); deathListeners.add(s -> env.closeDown()); Util.detectJDIExitEvent(vm, s -> { @@ -138,12 +134,13 @@ public class JDIDefaultExecutionControl extends JDIExecutionControl { // output. Socket socket = listener.accept(); // out before in -- match remote creation so we don't hang - ObjectOutput cmdout = new ObjectOutputStream(socket.getOutputStream()); - Map io = new HashMap<>(); - io.put("out", env.userOut()); - io.put("err", env.userErr()); - ObjectInput cmdin = remoteInput(socket.getInputStream(), io); - return new JDIDefaultExecutionControl(cmdout, cmdin, vm, process, deathListeners); + OutputStream out = socket.getOutputStream(); + Map outputs = new HashMap<>(); + outputs.put("out", env.userOut()); + outputs.put("err", env.userErr()); + Map input = new HashMap<>(); + input.put("in", env.userIn()); + return remoteInputOutput(socket.getInputStream(), out, outputs, input, (objIn, objOut) -> new JDIDefaultExecutionControl(objOut, objIn, vm, process, deathListeners)); } } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/MultiplexingOutputStream.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/MultiplexingOutputStream.java index 43e3bc52287..4cc13d8673a 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/MultiplexingOutputStream.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/MultiplexingOutputStream.java @@ -50,13 +50,7 @@ class MultiplexingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { - synchronized (delegate) { - delegate.write(name.length); //assuming the len is small enough to fit into byte - delegate.write(name); - delegate.write(1); - delegate.write(b); - delegate.flush(); - } + write(new byte[] {(byte) b}); } @Override @@ -65,10 +59,12 @@ class MultiplexingOutputStream extends OutputStream { int i = 0; while (len > 0) { int size = Math.min(PACKET_SIZE, len); - delegate.write(name.length); //assuming the len is small enough to fit into byte - delegate.write(name); - delegate.write(size); - delegate.write(b, off + i, size); + byte[] data = new byte[name.length + 1 + size + 1]; + data[0] = (byte) name.length; //assuming the len is small enough to fit into byte + System.arraycopy(name, 0, data, 1, name.length); + data[name.length + 1] = (byte) size; + System.arraycopy(b, off + i, data, name.length + 2, size); + delegate.write(data); i += size; len -= size; } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/PipeInputStream.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/PipeInputStream.java index 1470827ff29..1b582fa9b10 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/PipeInputStream.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/PipeInputStream.java @@ -24,7 +24,9 @@ */ package jdk.jshell.execution; +import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; /** * @@ -39,7 +41,10 @@ class PipeInputStream extends InputStream { private boolean closed; @Override - public synchronized int read() { + public synchronized int read() throws IOException { + if (start == end) { + inputNeeded(); + } while (start == end) { if (closed) { return -1; @@ -57,7 +62,9 @@ class PipeInputStream extends InputStream { } } - public synchronized void write(int b) { + protected void inputNeeded() throws IOException {} + + private synchronized void write(int b) { if (closed) { throw new IllegalStateException("Already closed."); } @@ -85,4 +92,22 @@ class PipeInputStream extends InputStream { notifyAll(); } + public OutputStream createOutput() { + return new OutputStream() { + @Override public void write(int b) throws IOException { + PipeInputStream.this.write(b); + } + @Override + public void write(byte[] b, int off, int len) throws IOException { + for (int i = 0 ; i < len ; i++) { + write(Byte.toUnsignedInt(b[off + i])); + } + } + @Override + public void close() throws IOException { + PipeInputStream.this.close(); + } + }; + } + } diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java index 9ea549c5fdb..8a131422b5a 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java @@ -61,10 +61,12 @@ public class RemoteExecutionControl extends DirectExecutionControl implements Ex Socket socket = new Socket(loopBack, Integer.parseInt(args[0])); InputStream inStream = socket.getInputStream(); OutputStream outStream = socket.getOutputStream(); - Map> chans = new HashMap<>(); - chans.put("out", st -> System.setOut(new PrintStream(st, true))); - chans.put("err", st -> System.setErr(new PrintStream(st, true))); - forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, chans); + Map> outputs = new HashMap<>(); + outputs.put("out", st -> System.setOut(new PrintStream(st, true))); + outputs.put("err", st -> System.setErr(new PrintStream(st, true))); + Map> input = new HashMap<>(); + input.put("in", st -> System.setIn(st)); + forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, outputs, input); } // These three variables are used by the main JShell process in interrupting diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java index 9f1521572ff..da8decab065 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java @@ -25,6 +25,7 @@ package jdk.jshell.execution; import jdk.jshell.spi.ExecutionEnv; + import java.io.IOException; import java.io.InputStream; import java.io.ObjectInput; @@ -32,9 +33,13 @@ import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.io.OutputStream; +import java.util.Arrays; +import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +import java.util.function.BiFunction; import java.util.function.Consumer; + import com.sun.jdi.VirtualMachine; import jdk.jshell.spi.ExecutionControl; @@ -99,21 +104,40 @@ public class Util { * instance, then responses back on the output. * @param ec the direct instance of {@link ExecutionControl} to process commands * @param inStream the stream from which to create the command input - * @param outStream the stream that will carry {@code System.out}, - * {@code System.err}, any specified auxiliary channels, and the - * command response output. - * @param streamMap a map between names of additional streams to carry and setters - * for the stream + * @param outStream the stream that will carry any specified auxiliary channels (like + * {@code System.out} and {@code System.err}), and the command response output. + * @param outputStreamMap a map between names of additional streams to carry and setters + * for the stream. Names starting with '$' are reserved for internal use. + * @param inputStreamMap a map between names of additional streams to carry and setters + * for the stream. Names starting with '$' are reserved for internal use. * @throws IOException if there are errors using the passed streams */ public static void forwardExecutionControlAndIO(ExecutionControl ec, InputStream inStream, OutputStream outStream, - Map> streamMap) throws IOException { - ObjectInputStream cmdIn = new ObjectInputStream(inStream); - for (Entry> e : streamMap.entrySet()) { + Map> outputStreamMap, + Map> inputStreamMap) throws IOException { + for (Entry> e : outputStreamMap.entrySet()) { e.getValue().accept(multiplexingOutputStream(e.getKey(), outStream)); } - ObjectOutputStream cmdOut = new ObjectOutputStream(multiplexingOutputStream("command", outStream)); + + ObjectOutputStream cmdOut = new ObjectOutputStream(multiplexingOutputStream("$command", outStream)); + PipeInputStream cmdInPipe = new PipeInputStream(); + Map inputs = new HashMap<>(); + inputs.put("$command", cmdInPipe.createOutput()); + for (Entry> e : inputStreamMap.entrySet()) { + OutputStream inputSignal = multiplexingOutputStream("$" + e.getKey() + "-input-requested", outStream); + PipeInputStream inputPipe = new PipeInputStream() { + @Override protected void inputNeeded() throws IOException { + inputSignal.write('1'); + inputSignal.flush(); + } + }; + inputs.put(e.getKey(), inputPipe.createOutput()); + e.getValue().accept(inputPipe); + } + new DemultiplexInput(inStream, inputs, inputs.values()).start(); + ObjectInputStream cmdIn = new ObjectInputStream(cmdInPipe); + forwardExecutionControl(ec, cmdIn, cmdOut); } @@ -122,18 +146,41 @@ public class Util { } /** - * Reads from an InputStream which has been packetized and write its contents - * to the out and err OutputStreams; Copies the command stream. + * Creates an ExecutionControl for given packetized input and output. The given InputStream + * is de-packetized, and content forwarded to ObjectInput and given OutputStreams. The ObjectOutput + * and values read from the given InputStream are packetized and sent to the given OutputStream. + * * @param input the packetized input stream - * @param streamMap a map between stream names and the output streams to forward - * @return the command stream + * @param output the packetized output stream + * @param outputStreamMap a map between stream names and the output streams to forward. + * Names starting with '$' are reserved for internal use. + * @param inputStreamMap a map between stream names and the input streams to forward. + * Names starting with '$' are reserved for internal use. + * @param factory to create the ExecutionControl from ObjectInput and ObjectOutput. + * @return the created ExecutionControl * @throws IOException if setting up the streams raised an exception */ - public static ObjectInput remoteInput(InputStream input, - Map streamMap) throws IOException { + public static ExecutionControl remoteInputOutput(InputStream input, OutputStream output, + Map outputStreamMap, Map inputStreamMap, + BiFunction factory) throws IOException { + Map augmentedStreamMap = new HashMap<>(outputStreamMap); + ObjectOutput commandOut = new ObjectOutputStream(Util.multiplexingOutputStream("$command", output)); + for (Entry e : inputStreamMap.entrySet()) { + InputStream in = e.getValue(); + OutputStream inTarget = Util.multiplexingOutputStream(e.getKey(), output); + augmentedStreamMap.put("$" + e.getKey() + "-input-requested", new OutputStream() { + @Override + public void write(int b) throws IOException { + //value ignored, just a trigger to read from the input + inTarget.write(in.read()); + } + }); + } PipeInputStream commandIn = new PipeInputStream(); - new DemultiplexInput(input, commandIn, streamMap).start(); - return new ObjectInputStream(commandIn); + OutputStream commandInTarget = commandIn.createOutput(); + augmentedStreamMap.put("$command", commandInTarget); + new DemultiplexInput(input, augmentedStreamMap, Arrays.asList(commandInTarget)).start(); + return factory.apply(new ObjectInputStream(commandIn), commandOut); } /** @@ -151,32 +198,4 @@ public class Util { } } - /** - * Creates a Thread that will ship all input to the remote agent. - * - * @param inputStream the user input - * @param outStream the input to the remote agent - * @param handler a failure handler - */ - public static void forwardInputToRemote(final InputStream inputStream, - final OutputStream outStream, final Consumer handler) { - Thread thr = new Thread("input reader") { - @Override - public void run() { - try { - byte[] buf = new byte[256]; - int cnt; - while ((cnt = inputStream.read(buf)) != -1) { - outStream.write(buf, 0, cnt); - outStream.flush(); - } - } catch (Exception ex) { - handler.accept(ex); - } - } - }; - thr.setPriority(Thread.MAX_PRIORITY - 1); - thr.start(); - } - } diff --git a/langtools/test/jdk/jshell/ReplToolTesting.java b/langtools/test/jdk/jshell/ReplToolTesting.java index a2e80a78260..23c70af0690 100644 --- a/langtools/test/jdk/jshell/ReplToolTesting.java +++ b/langtools/test/jdk/jshell/ReplToolTesting.java @@ -247,7 +247,6 @@ public class ReplToolTesting { new PrintStream(cmdout), new PrintStream(cmderr), new PrintStream(console), - userin, new PrintStream(userout), new PrintStream(usererr), prefs, @@ -463,7 +462,7 @@ public class ReplToolTesting { private List computeCompletions(String code, boolean isSmart) { JShellTool js = this.repl != null ? this.repl - : new JShellTool(null, null, null, null, null, null, null, prefs, Locale.ROOT); + : new JShellTool(null, null, null, null, null, null, prefs, Locale.ROOT); int cursor = code.indexOf('|'); code = code.replace("|", ""); assertTrue(cursor > -1, "'|' not found: " + code); diff --git a/langtools/test/jdk/jshell/StartOptionTest.java b/langtools/test/jdk/jshell/StartOptionTest.java index 5ca48854341..dbbbf0943f6 100644 --- a/langtools/test/jdk/jshell/StartOptionTest.java +++ b/langtools/test/jdk/jshell/StartOptionTest.java @@ -63,7 +63,6 @@ public class StartOptionTest { new PrintStream(cmdout), new PrintStream(cmderr), new PrintStream(console), - new TestingInputStream(), new PrintStream(userout), new PrintStream(usererr), new ReplToolTesting.MemoryPreferences(), diff --git a/langtools/test/jdk/jshell/UserInputTest.java b/langtools/test/jdk/jshell/UserInputTest.java new file mode 100644 index 00000000000..5289ab7c56b --- /dev/null +++ b/langtools/test/jdk/jshell/UserInputTest.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8131023 + * @summary Verify that the user's code can read System.in + * @build KullaTesting TestingInputStream + * @run testng UserInputTest + */ + +import org.testng.annotations.Test; + +@Test +public class UserInputTest extends KullaTesting { + + public void testReadInput() { + setInput("AB\n"); + assertEval("System.in.read()", "65"); + setInput("BC\n"); + assertEval("System.in.read()", "66"); + } + +} diff --git a/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java b/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java index 06cc2f9816a..bfd04a1289c 100644 --- a/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java +++ b/langtools/test/jdk/jshell/UserJDIUserRemoteTest.java @@ -37,7 +37,6 @@ import static jdk.jshell.Snippet.Status.VALID; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.util.ArrayList; import java.util.List; @@ -62,7 +61,7 @@ import jdk.jshell.spi.ExecutionEnv; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; import static jdk.jshell.execution.Util.forwardExecutionControlAndIO; -import static jdk.jshell.execution.Util.remoteInput; +import static jdk.jshell.execution.Util.remoteInputOutput; @Test public class UserJDIUserRemoteTest extends ExecutionControlTestBase { @@ -146,7 +145,7 @@ class MyExecutionControl extends JDIExecutionControl { * @return the channel * @throws IOException if there are errors in set-up */ - static MyExecutionControl make(ExecutionEnv env, UserJDIUserRemoteTest test) throws IOException { + static ExecutionControl make(ExecutionEnv env, UserJDIUserRemoteTest test) throws IOException { try (final ServerSocket listener = new ServerSocket(0)) { // timeout after 60 seconds listener.setSoTimeout(60000); @@ -175,13 +174,14 @@ class MyExecutionControl extends JDIExecutionControl { // output. Socket socket = listener.accept(); // out before in -- match remote creation so we don't hang - ObjectOutput cmdout = new ObjectOutputStream(socket.getOutputStream()); - Map io = new HashMap<>(); - io.put("out", env.userOut()); - io.put("err", env.userErr()); - io.put("aux", test.auxStream); - ObjectInput cmdin = remoteInput(socket.getInputStream(), io); - MyExecutionControl myec = new MyExecutionControl(cmdout, cmdin, vm, process, deathListeners); + OutputStream out = socket.getOutputStream(); + Map outputs = new HashMap<>(); + outputs.put("out", env.userOut()); + outputs.put("err", env.userErr()); + outputs.put("aux", test.auxStream); + Map input = new HashMap<>(); + input.put("in", env.userIn()); + ExecutionControl myec = remoteInputOutput(socket.getInputStream(), out, outputs, input, (objIn, objOut) -> new MyExecutionControl(objOut, objIn, vm, process, deathListeners)); test.currentEC = myec; return myec; } @@ -255,11 +255,13 @@ class MyRemoteExecutionControl extends DirectExecutionControl implements Executi Socket socket = new Socket(loopBack, Integer.parseInt(args[0])); InputStream inStream = socket.getInputStream(); OutputStream outStream = socket.getOutputStream(); - Map> chans = new HashMap<>(); - chans.put("out", st -> System.setOut(new PrintStream(st, true))); - chans.put("err", st -> System.setErr(new PrintStream(st, true))); - chans.put("aux", st -> { auxPrint = new PrintStream(st, true); }); - forwardExecutionControlAndIO(new MyRemoteExecutionControl(), inStream, outStream, chans); + Map> outputs = new HashMap<>(); + outputs.put("out", st -> System.setOut(new PrintStream(st, true))); + outputs.put("err", st -> System.setErr(new PrintStream(st, true))); + outputs.put("aux", st -> { auxPrint = new PrintStream(st, true); }); + Map> input = new HashMap<>(); + input.put("in", st -> System.setIn(st)); + forwardExecutionControlAndIO(new MyRemoteExecutionControl(), inStream, outStream, outputs, input); } catch (Throwable ex) { throw ex; } From 161e3c650ab658a745bb1bfa0113105bc20e194a Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 29 Aug 2016 15:53:03 +0200 Subject: [PATCH 38/99] 8165008: javac -Xmodule compiles the module in a way that reads the unnamed module Ensuring proper separation between named modules and the unnamed module when using -Xmodule Reviewed-by: jjg --- .../com/sun/tools/javac/code/ClassFinder.java | 35 +---- .../com/sun/tools/javac/comp/Modules.java | 5 +- .../test/tools/javac/modules/XModuleTest.java | 132 +++++++++++++++++- 3 files changed, 134 insertions(+), 38 deletions(-) diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java index d928ee13f3a..7cccabeb5bd 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java @@ -119,10 +119,6 @@ public class ClassFinder { */ final Name completionFailureName; - /** Module specified with -Xmodule: - */ - final Name moduleOverride; - /** Access to files */ private final JavaFileManager fileManager; @@ -210,9 +206,6 @@ public class ClassFinder { ? names.fromString(options.get("failcomplete")) : null; - moduleOverride = options.isSet(Option.XMODULE) ? names.fromString(options.get(Option.XMODULE)) - : null; - // Temporary, until more info is available from the module system. boolean useCtProps; JavaFileManager fm = context.get(JavaFileManager.class); @@ -527,16 +520,15 @@ public class ClassFinder { if (msym == syms.noModule) { preferCurrent = false; if (userPathsFirst) { - scanUserPaths(p); + scanUserPaths(p, true); preferCurrent = true; scanPlatformPath(p); } else { scanPlatformPath(p); - scanUserPaths(p); + scanUserPaths(p, true); } } else if (msym.classLocation == StandardLocation.CLASS_PATH) { - // assert p.modle.sourceLocation == StandardLocation.SOURCE_PATH); - scanUserPaths(p); + scanUserPaths(p, msym.sourceLocation == StandardLocation.SOURCE_PATH); } else { scanModulePaths(p, msym); } @@ -561,23 +553,6 @@ public class ClassFinder { String packageName = p.fullname.toString(); - if (msym.name == moduleOverride) { - if (wantClassFiles) { - fillIn(p, CLASS_PATH, - fileManager.list(CLASS_PATH, - packageName, - classKinds, - false)); - } - if (wantSourceFiles && fileManager.hasLocation(SOURCE_PATH)) { - fillIn(p, SOURCE_PATH, - fileManager.list(SOURCE_PATH, - packageName, - sourceKinds, - false)); - } - } - Location classLocn = msym.classLocation; Location sourceLocn = msym.sourceLocation; @@ -600,7 +575,7 @@ public class ClassFinder { /** * Scans class path and source path for files in given package. */ - private void scanUserPaths(PackageSymbol p) throws IOException { + private void scanUserPaths(PackageSymbol p, boolean includeSourcePath) throws IOException { Set kinds = getPackageFileKinds(); Set classKinds = EnumSet.copyOf(kinds); @@ -611,7 +586,7 @@ public class ClassFinder { sourceKinds.remove(JavaFileObject.Kind.CLASS); boolean wantSourceFiles = !sourceKinds.isEmpty(); - boolean haveSourcePath = fileManager.hasLocation(SOURCE_PATH); + boolean haveSourcePath = includeSourcePath && fileManager.hasLocation(SOURCE_PATH); if (verbose && verbosePath) { if (fileManager instanceof StandardJavaFileManager) { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java index 8e464ef9fc6..8b8a0379546 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java @@ -392,6 +392,7 @@ public class Modules extends JCTree.Visitor { if (moduleOverride != null) { checkNoAllModulePath(); defaultModule = moduleFinder.findModule(names.fromString(moduleOverride)); + defaultModule.sourceLocation = StandardLocation.SOURCE_PATH; } else { // Question: why not do findAllModules and initVisiblePackages here? // i.e. body of unnamedModuleCompleter @@ -432,7 +433,9 @@ public class Modules extends JCTree.Visitor { if (defaultModule != syms.unnamedModule) { syms.unnamedModule.completer = getUnnamedModuleCompleter(); - syms.unnamedModule.sourceLocation = StandardLocation.SOURCE_PATH; + if (moduleOverride == null) { + syms.unnamedModule.sourceLocation = StandardLocation.SOURCE_PATH; + } syms.unnamedModule.classLocation = StandardLocation.CLASS_PATH; } diff --git a/langtools/test/tools/javac/modules/XModuleTest.java b/langtools/test/tools/javac/modules/XModuleTest.java index b4f49f64d3d..5dc5d8f35dd 100644 --- a/langtools/test/tools/javac/modules/XModuleTest.java +++ b/langtools/test/tools/javac/modules/XModuleTest.java @@ -27,7 +27,9 @@ * @library /tools/lib * @modules * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.code * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.processing * @build toolbox.ToolBox toolbox.JavacTask toolbox.ModuleBuilder ModuleTestBase * @run main XModuleTest */ @@ -35,12 +37,22 @@ import java.nio.file.Path; import java.util.Arrays; import java.util.List; +import java.util.Set; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.ModuleElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; + +import com.sun.tools.javac.code.Symtab; +import com.sun.tools.javac.processing.JavacProcessingEnvironment; import toolbox.JavacTask; import toolbox.ModuleBuilder; import toolbox.Task; -import toolbox.TestRunner; -import toolbox.ToolBox; +import toolbox.Task.Expect; public class XModuleTest extends ModuleTestBase { @@ -111,15 +123,22 @@ public class XModuleTest extends ModuleTestBase { Path classes = base.resolve("classes"); tb.createDirectories(classes); - String log = new JavacTask(tb) - .options("-Xmodule:java.compiler", "--class-path", cpClasses.toString()) + List log = new JavacTask(tb) + .options("-Xmodule:java.compiler", + "--class-path", cpClasses.toString(), + "-XDrawDiagnostics") .outdir(classes) .files(src.resolve("javax/lang/model/element/Extra.java")) - .run() + .run(Expect.FAIL) .writeAll() - .getOutput(Task.OutputKind.DIRECT); + .getOutputLines(Task.OutputKind.DIRECT); - if (!log.isEmpty()) + List expectedOut = Arrays.asList( + "Extra.java:1:76: compiler.err.doesnt.exist: p", + "1 error" + ); + + if (!expectedOut.equals(log)) throw new Exception("expected output not found: " + log); } @@ -302,4 +321,103 @@ public class XModuleTest extends ModuleTestBase { .run() .writeAll(); } + + @Test + public void testUnnamedIsolation(Path base) throws Exception { + //note: avoiding use of java.base, as that gets special handling on some places: + Path sourcePath = base.resolve("source-path"); + tb.writeJavaFiles(sourcePath, "package src; public class Src {}"); + + Path classPathSrc = base.resolve("class-path-src"); + tb.writeJavaFiles(classPathSrc, "package cp; public class CP { }"); + Path classPath = base.resolve("classPath"); + tb.createDirectories(classPath); + + String cpLog = new JavacTask(tb) + .outdir(classPath) + .files(findJavaFiles(classPathSrc)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + + if (!cpLog.isEmpty()) + throw new Exception("expected output not found: " + cpLog); + + Path modulePathSrc = base.resolve("module-path-src"); + tb.writeJavaFiles(modulePathSrc, + "module m {}", + "package m; public class M {}"); + Path modulePath = base.resolve("modulePath"); + tb.createDirectories(modulePath.resolve("m")); + + String modLog = new JavacTask(tb) + .outdir(modulePath.resolve("m")) + .files(findJavaFiles(modulePathSrc)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + + if (!modLog.isEmpty()) + throw new Exception("expected output not found: " + modLog); + + Path src = base.resolve("src"); + tb.writeJavaFiles(src, "package m; public class Extra { }"); + Path classes = base.resolve("classes"); + tb.createDirectories(classes); + + String log = new JavacTask(tb) + .options("-Xmodule:m", + "--class-path", classPath.toString(), + "--source-path", sourcePath.toString(), + "--module-path", modulePath.toString(), + "--processor-path", System.getProperty("test.classes"), + "-XDaccessInternalAPI=true", + "-processor", CheckModuleContentProcessing.class.getName()) + .outdir(classes) + .files(findJavaFiles(sourcePath)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + + if (!log.isEmpty()) + throw new Exception("expected output not found: " + log); + } + + @SupportedAnnotationTypes("*") + public static final class CheckModuleContentProcessing extends AbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + Symtab syms = Symtab.instance(((JavacProcessingEnvironment) processingEnv).getContext()); + Elements elements = processingEnv.getElementUtils(); + ModuleElement unnamedModule = syms.unnamedModule; + ModuleElement mModule = elements.getModuleElement("m"); + + assertNonNull("mModule found", mModule); + assertNonNull("src.Src from m", elements.getTypeElement(mModule, "src.Src")); + assertNull("cp.CP not from m", elements.getTypeElement(mModule, "cp.CP")); + assertNull("src.Src not from unnamed", elements.getTypeElement(unnamedModule, "src.Src")); + assertNonNull("cp.CP from unnamed", elements.getTypeElement(unnamedModule, "cp.CP")); + + return false; + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + private static void assertNonNull(String msg, Object val) { + if (val == null) { + throw new AssertionError(msg); + } + } + + private static void assertNull(String msg, Object val) { + if (val != null) { + throw new AssertionError(msg); + } + } + } + } From d2d5a91ec405507a2c0d628de445f8fd1380917d Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 30 Aug 2016 17:48:27 -0700 Subject: [PATCH 39/99] 8160851: Remove old launcher module-related options Reviewed-by: alanb --- hotspot/test/runtime/Unsafe/NestedUnsafe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/test/runtime/Unsafe/NestedUnsafe.java b/hotspot/test/runtime/Unsafe/NestedUnsafe.java index f009d6dddd4..9bda7eac304 100644 --- a/hotspot/test/runtime/Unsafe/NestedUnsafe.java +++ b/hotspot/test/runtime/Unsafe/NestedUnsafe.java @@ -79,7 +79,7 @@ public class NestedUnsafe { " throw new RuntimeException(\"Exception: \" + ex.toString()); " + " } " + "} } ", - "-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED"); + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED"); Class klass2 = unsafe.defineAnonymousClass(NestedUnsafe.class, klassbuf2, new Object[0]); try { klass2.getMethod("doit").invoke(null); From ab956e880ea5a3f4d5081e61b80b9b091375e98f Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 30 Aug 2016 17:49:43 -0700 Subject: [PATCH 40/99] 8160851: Remove old launcher module-related options Reviewed-by: jjg, alanb --- .../module/ServiceProviderTest/BasicModularXMLParserTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/BasicModularXMLParserTest.java b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/BasicModularXMLParserTest.java index c2bf928ba1f..72fd20c1d74 100644 --- a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/BasicModularXMLParserTest.java +++ b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/BasicModularXMLParserTest.java @@ -93,7 +93,7 @@ public class BasicModularXMLParserTest { */ public void testWithOneProvider() throws Exception { int exitValue - = executeTestJava("-mp", MOD_DIR1.toString(), + = executeTestJava("--module-path", MOD_DIR1.toString(), "-cp", CLASSES_DIR.toString(), "Main", "xmlprovider1") .outputTo(System.out) @@ -108,7 +108,7 @@ public class BasicModularXMLParserTest { */ public void testWithTwoProvider() throws Exception { int exitValue - = executeTestJava("-mp", MOD_DIR1.toString() + File.pathSeparator + MOD_DIR2.toString(), + = executeTestJava("--module-path", MOD_DIR1.toString() + File.pathSeparator + MOD_DIR2.toString(), "-cp", CLASSES_DIR.toString(), "Main", "xmlprovider1", "xmlprovider2") .outputTo(System.out) From 2416447009af96d2f3d65ec9c2d35fe5d3cabb5d Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 30 Aug 2016 17:49:50 -0700 Subject: [PATCH 41/99] 8160851: Remove old launcher module-related options Reviewed-by: jjg, alanb --- make/CompileJavaModules.gmk | 2 +- make/common/SetupJavaCompilers.gmk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 65e43933dec..9023aba0acc 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -504,7 +504,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \ $($(MODULE)_ADD_JAVAC_FLAGS) \ --module-source-path $(MODULESOURCEPATH) \ --module-path $(MODULEPATH) \ - -system none, \ + --system none, \ )) TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA) diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk index 52b2cc337fe..65fc170404d 100644 --- a/make/common/SetupJavaCompilers.gmk +++ b/make/common/SetupJavaCompilers.gmk @@ -88,7 +88,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \ JVM := $(JAVA_SMALL), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules -system none $(DISABLE_WARNINGS), \ + FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) From 74e4516b0503dea8819ddfcb55c532ea5158c464 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Wed, 31 Aug 2016 14:20:00 +0200 Subject: [PATCH 42/99] 8164858: Enable build-time use of java.lang.invoke resolve tracing Reviewed-by: erikj, vlivanov --- make/Images.gmk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make/Images.gmk b/make/Images.gmk index c7df894ceaf..75a8cb5e04b 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -116,8 +116,10 @@ JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod) JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX) JLINK_ORDER_RESOURCES := **module-info.class +JLINK_JLI_CLASSES := ifeq ($(ENABLE_GENERATE_CLASSLIST), true) JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/classlist/classlist + JLINK_JLI_CLASSES := --generate-jli-classes=@$(SUPPORT_OUTPUTDIR)/classlist/jli_trace.out endif JLINK_ORDER_RESOURCES += \ /java.base/java/** \ @@ -131,6 +133,7 @@ JLINK_TOOL := $(JLINK) --module-path $(IMAGES_OUTPUTDIR)/jmods \ --endian $(OPENJDK_BUILD_CPU_ENDIAN) \ --release-info $(BASE_RELEASE_FILE) \ --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \ + $(JLINK_JLI_CLASSES) \ # ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true) From 6784b0b5eae7bcd472f8cf91a4a4cf3d574d881e Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 31 Aug 2016 14:33:23 -0700 Subject: [PATCH 43/99] 8162431: CatalogUriResolver with circular/self referencing catalog file is not throwing CatalogException as expected Reviewed-by: lancea --- .../javax/xml/catalog/CatalogImpl.java | 54 +++++++++++-------- .../javax/xml/catalog/CatalogManager.java | 4 +- .../javax/xml/catalog/CatalogReader.java | 9 ---- .../xml/catalog/CatalogResolverImpl.java | 4 ++ .../classes/javax/xml/catalog/GroupEntry.java | 37 ++++++++++--- .../functional/catalog/DeferFeatureTest.java | 8 +-- .../jaxp/unittest/catalog/CatalogTest.java | 28 ++++++++++ .../catalog/catalogReferCircle-itself.xml | 6 +++ .../catalog/catalogReferCircle-left.xml | 6 +++ .../catalog/catalogReferCircle-right.xml | 6 +++ 10 files changed, 117 insertions(+), 45 deletions(-) create mode 100644 jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml create mode 100644 jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml create mode 100644 jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java index 5336a8cb8e1..6630424c15a 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java @@ -31,6 +31,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; @@ -72,9 +73,6 @@ class CatalogImpl extends GroupEntry implements Catalog { //System Id for this catalog String systemId; - //The parent - CatalogImpl parent = null; - /* A list of catalog entry files from the input, excluding the current catalog. Paths in the List are normalized. @@ -107,7 +105,7 @@ class CatalogImpl extends GroupEntry implements Catalog { * catalog file. */ public CatalogImpl(CatalogImpl parent, CatalogFeatures f, String... file) throws CatalogException { - super(CatalogEntryType.CATALOG); + super(CatalogEntryType.CATALOG, parent); if (f == null) { throw new NullPointerException( formatMessage(CatalogMessages.ERR_NULL_ARGUMENT, new Object[]{"CatalogFeatures"})); @@ -117,7 +115,7 @@ class CatalogImpl extends GroupEntry implements Catalog { CatalogMessages.reportNPEOnNull("The path to the catalog file", file[0]); } - init(parent, f); + init(f); //Path of catalog files String[] catalogFile = file; @@ -159,19 +157,34 @@ class CatalogImpl extends GroupEntry implements Catalog { } } } - - if (systemId != null) { - parse(systemId); - } } } - private void init(CatalogImpl parent, CatalogFeatures f) { - this.parent = parent; + /** + * Loads the catalog + */ + void load() { + if (systemId != null) { + parse(systemId); + } + + //save this catalog before loading the next + loadedCatalogs.put(systemId, this); + + //Load delegate and alternative catalogs if defer is false. + if (!isDeferred()) { + loadDelegateCatalogs(); + loadNextCatalogs(); + } + } + + private void init(CatalogFeatures f) { if (parent == null) { level = 0; } else { level = parent.level + 1; + this.loadedCatalogs = parent.loadedCatalogs; + this.catalogsSearched = parent.catalogsSearched; } if (f == null) { this.features = CatalogFeatures.defaults(); @@ -196,11 +209,6 @@ class CatalogImpl extends GroupEntry implements Catalog { entries.stream().filter((entry) -> (entry.type == CatalogEntryType.GROUP)).forEach((entry) -> { ((GroupEntry) entry).reset(); }); - - if (parent != null) { - this.loadedCatalogs = parent.loadedCatalogs; - this.catalogsSearched = parent.catalogsSearched; - } } /** @@ -421,16 +429,16 @@ class CatalogImpl extends GroupEntry implements Catalog { void loadNextCatalogs() { //loads catalogs specified in nextCatalogs if (nextCatalogs != null) { - for (NextCatalog next : nextCatalogs) { + nextCatalogs.stream().forEach((next) -> { getCatalog(next.getCatalogURI()); - } + }); } //loads catalogs from the input list if (inputFiles != null) { - for (String file : inputFiles) { + inputFiles.stream().forEach((file) -> { getCatalog(getSystemId(file)); - } + }); } } @@ -445,14 +453,14 @@ class CatalogImpl extends GroupEntry implements Catalog { return null; } - Catalog c = null; + CatalogImpl c = null; String path = uri.toASCIIString(); if (verifyCatalogFile(uri)) { c = getLoadedCatalog(path); if (c == null) { c = new CatalogImpl(this, features, path); - saveLoadedCatalog(path, c); + c.load(); } } return c; @@ -464,7 +472,7 @@ class CatalogImpl extends GroupEntry implements Catalog { * @param catalogId the catalogId associated with the Catalog object * @param c the Catalog to be saved */ - void saveLoadedCatalog(String catalogId, Catalog c) { + void saveLoadedCatalog(String catalogId, CatalogImpl c) { loadedCatalogs.put(catalogId, c); } diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java index bc8518685f7..7dd1e9cf873 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java @@ -62,7 +62,9 @@ public final class CatalogManager { * @throws CatalogException If an error occurs while parsing the catalog */ public static Catalog catalog(CatalogFeatures features, String... paths) { - return new CatalogImpl(features, paths); + CatalogImpl catalog = new CatalogImpl(features, paths); + catalog.load(); + return catalog; } /** diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogReader.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogReader.java index bf4e95b963f..5f08c54cc12 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogReader.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogReader.java @@ -259,15 +259,6 @@ class CatalogReader extends DefaultHandler implements EntityResolver, URIResolve CatalogEntryType type = CatalogEntryType.getType(localName); if (type == CatalogEntryType.GROUP) { inGroup = false; - } else if (type == CatalogEntryType.CATALOGENTRY) { - /* - Done reading the catalog file. - Load delegate and alternative catalogs if defer is false. - */ - if (!catalog.isDeferred()) { - catalog.loadDelegateCatalogs(); - catalog.loadNextCatalogs(); - } } } diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java index 9bf8b357adc..fe6223d9324 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java @@ -119,6 +119,10 @@ final class CatalogResolverImpl implements CatalogResolver { String result = null; CatalogImpl c = (CatalogImpl)catalog; String uri = Normalizer.normalizeURI(href); + if (uri == null) { + return null; + } + //check whether uri is an urn if (uri != null && uri.startsWith(Util.URN)) { String publicId = Normalizer.decodeURN(uri); diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java index 2c1a59c360c..e04f8cdb363 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java @@ -48,6 +48,9 @@ class GroupEntry extends BaseEntry { //Value of the prefer attribute boolean isPreferPublic = true; + //The parent of the catalog instance + CatalogImpl parent = null; + //The catalog instance this group belongs to CatalogImpl catalog; @@ -55,10 +58,10 @@ class GroupEntry extends BaseEntry { List entries = new ArrayList<>(); //loaded delegated catalog by system id - Map delegateCatalogs = new HashMap<>(); + Map delegateCatalogs = new HashMap<>(); //A list of all loaded Catalogs, including this, and next catalogs - Map loadedCatalogs = new HashMap<>(); + Map loadedCatalogs = new HashMap<>(); /* A list of Catalog Ids that have already been searched in a matching @@ -136,8 +139,9 @@ class GroupEntry extends BaseEntry { * * @param type The type of the entry */ - public GroupEntry(CatalogEntryType type) { + public GroupEntry(CatalogEntryType type, CatalogImpl parent) { super(type); + this.parent = parent; } /** @@ -163,7 +167,7 @@ class GroupEntry extends BaseEntry { } /** * Constructs a group entry. - * @param catalog The parent catalog + * @param catalog The catalog this GroupEntry belongs * @param base The baseURI attribute * @param attributes The attributes */ @@ -445,13 +449,14 @@ class GroupEntry extends BaseEntry { * @param catalogId the catalog Id */ Catalog loadCatalog(URI catalogURI) { - Catalog delegateCatalog = null; + CatalogImpl delegateCatalog = null; if (catalogURI != null) { String catalogId = catalogURI.toASCIIString(); delegateCatalog = getLoadedCatalog(catalogId); if (delegateCatalog == null) { if (verifyCatalogFile(catalogURI)) { delegateCatalog = new CatalogImpl(catalog, features, catalogId); + delegateCatalog.load(); delegateCatalogs.put(catalogId, delegateCatalog); } } @@ -467,8 +472,8 @@ class GroupEntry extends BaseEntry { * @return a Catalog object previously loaded, or null if none in the saved * list */ - Catalog getLoadedCatalog(String catalogId) { - Catalog c = null; + CatalogImpl getLoadedCatalog(String catalogId) { + CatalogImpl c = null; //checl delegate Catalogs c = delegateCatalogs.get(catalogId); @@ -504,7 +509,7 @@ class GroupEntry extends BaseEntry { } String catalogId = catalogURI.toASCIIString(); - if (catalogsSearched.contains(catalogId)) { + if (catalogsSearched.contains(catalogId) || isCircular(catalogId)) { CatalogMessages.reportRunTimeError(CatalogMessages.ERR_CIRCULAR_REFERENCE, new Object[]{CatalogMessages.sanitize(catalogId)}); } @@ -512,4 +517,20 @@ class GroupEntry extends BaseEntry { return true; } + /** + * Checks whether the catalog is circularly referenced + * @param systemId the system identifier of the catalog to be loaded + * @return true if is circular, false otherwise + */ + boolean isCircular(String systemId) { + if (parent == null) { + return false; + } + + if (parent.systemId.equals(systemId)) { + return true; + } + + return parent.isCircular(systemId); + } } diff --git a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java index 626943a335b..b5368158ab1 100644 --- a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java +++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java @@ -64,12 +64,12 @@ public class DeferFeatureTest { public Object[][] data() { return new Object[][]{ // By default, alternative catalogs are not loaded. - {createCatalog(CatalogFeatures.defaults()), 0}, + {createCatalog(CatalogFeatures.defaults()), 1}, // Alternative catalogs are not loaded when DEFER is set to true. - {createCatalog(createDeferFeature(DEFER_TRUE)), 0}, - // The 3 alternative catalogs are not pre-loaded + {createCatalog(createDeferFeature(DEFER_TRUE)), 1}, + // The 3 alternative catalogs are pre-loaded along with the parent //when DEFER is set to false. - {createCatalog(createDeferFeature(DEFER_FALSE)), 3}}; + {createCatalog(createDeferFeature(DEFER_FALSE)), 4}}; } private CatalogFeatures createDeferFeature(String defer) { diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java index 6f622f9ab25..4b9ea77826d 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java @@ -92,6 +92,34 @@ public class CatalogTest extends CatalogSupportBase { super.setUp(); } + /* + * @bug 8162431 + * Verifies that circular references are caught and + * CatalogException is thrown. + */ + @Test(dataProvider = "getFeatures", expectedExceptions = CatalogException.class) + public void testCircularRef(CatalogFeatures cf, String xml) { + CatalogResolver catalogResolver = CatalogManager.catalogResolver( + cf, + getClass().getResource(xml).getFile()); + catalogResolver.resolve("anyuri", ""); + } + + /* + DataProvider: used to verify circular reference + Data columns: CatalogFeatures, catalog + */ + @DataProvider(name = "getFeatures") + public Object[][] getFeatures() { + + return new Object[][]{ + {CatalogFeatures.builder().with(CatalogFeatures.Feature.DEFER, "false").build(), + "catalogReferCircle-itself.xml"}, + {CatalogFeatures.defaults(), "catalogReferCircle-itself.xml"}, + {CatalogFeatures.builder().with(CatalogFeatures.Feature.DEFER, "false").build(), + "catalogReferCircle-left.xml"}, + {CatalogFeatures.defaults(), "catalogReferCircle-left.xml"},}; + } /* * @bug 8163232 diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml new file mode 100644 index 00000000000..c3cfaa66443 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-itself.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml new file mode 100644 index 00000000000..852b1a56ac3 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-left.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml new file mode 100644 index 00000000000..0c556a4b123 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/catalogReferCircle-right.xml @@ -0,0 +1,6 @@ + + + + + + From 31f780a4439f2863e7d684749b17976543a415a5 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Thu, 1 Sep 2016 10:29:37 +0200 Subject: [PATCH 44/99] 8165158: Fix zero builds for non-listed architectures Reviewed-by: tbell --- common/autoconf/generated-configure.sh | 6 +++++- common/autoconf/platform.m4 | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 92e055d9a12..b233cdcd433 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -5095,7 +5095,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1470863189 +DATE_WHEN_GENERATED=1472718471 ############################################################################### # @@ -15944,6 +15944,8 @@ $as_echo "$COMPILE_TYPE" >&6; } HOTSPOT_TARGET_CPU_DEFINE=S390 elif test "x$OPENJDK_TARGET_CPU" = xs390x; then HOTSPOT_TARGET_CPU_DEFINE=S390 + elif test "x$OPENJDK_TARGET_CPU" != x; then + HOTSPOT_TARGET_CPU_DEFINE=$(echo $OPENJDK_TARGET_CPU | tr a-z A-Z) fi @@ -16117,6 +16119,8 @@ $as_echo "$COMPILE_TYPE" >&6; } HOTSPOT_BUILD_CPU_DEFINE=S390 elif test "x$OPENJDK_BUILD_CPU" = xs390x; then HOTSPOT_BUILD_CPU_DEFINE=S390 + elif test "x$OPENJDK_BUILD_CPU" != x; then + HOTSPOT_BUILD_CPU_DEFINE=$(echo $OPENJDK_BUILD_CPU | tr a-z A-Z) fi diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 2fbac1d0dd3..e7ffe4a2fa5 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -454,6 +454,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], HOTSPOT_$1_CPU_DEFINE=S390 elif test "x$OPENJDK_$1_CPU" = xs390x; then HOTSPOT_$1_CPU_DEFINE=S390 + elif test "x$OPENJDK_$1_CPU" != x; then + HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z) fi AC_SUBST(HOTSPOT_$1_CPU_DEFINE) From 76f0a705fcf3a7fef24ed533787b929623ff6ed1 Mon Sep 17 00:00:00 2001 From: Aleksei Efimov Date: Thu, 1 Sep 2016 17:12:12 +0300 Subject: [PATCH 45/99] 8150145: javax/xml/jaxp/unittest/common/TransformationWarningsTest.java and ValidationWarningsTest.java failed intermittently without any error message Reviewed-by: joehw, clanger --- jaxp/test/ProblemList.txt | 4 -- .../common/TransformationWarningsTest.java | 10 ++++- .../common/ValidationWarningsTest.java | 1 + .../unittest/common/WarningsTestBase.java | 39 +++++++++++++++---- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/jaxp/test/ProblemList.txt b/jaxp/test/ProblemList.txt index 27337ae935c..ce63d06ff47 100644 --- a/jaxp/test/ProblemList.txt +++ b/jaxp/test/ProblemList.txt @@ -24,7 +24,3 @@ ########################################################################### javax/xml/jaxp/isolatedjdk/catalog/PropertiesTest.sh 8147431 generic-all - -javax/xml/jaxp/unittest/common/TransformationWarningsTest.java 8150145 generic-all - -javax/xml/jaxp/unittest/common/ValidationWarningsTest.java 8150145 generic-all diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java b/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java index 310d1a4b4de..bffaa4afe5e 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java @@ -42,12 +42,13 @@ import org.testng.annotations.Test; * @test * @bug 8144593 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest + * @compile -XDignore.symbol.file TestSAXDriver.java * @run testng/othervm -DrunSecMngr=true common.TransformationWarningsTest * @run testng/othervm common.TransformationWarningsTest * @summary Check that warnings about unsupported properties from parsers * are suppressed during the transformation process. */ -@Listeners({jaxp.library.BasePolicy.class}) +@Listeners({jaxp.library.BasePolicy.class, jaxp.library.InternalAPIPolicy.class}) public class TransformationWarningsTest extends WarningsTestBase { @BeforeClass @@ -80,7 +81,12 @@ public class TransformationWarningsTest extends WarningsTestBase { Source xslsrc = new StreamSource(new StringReader(xsl)); // Create factory and transformer - TransformerFactory tf = TransformerFactory.newInstance(); + TransformerFactory tf; + // newTransformer() method doc states that different transformer + // factories can be used concurrently by different Threads. + synchronized (TransformerFactory.class) { + tf = TransformerFactory.newInstance(); + } Transformer t = tf.newTransformer(xslsrc); // Set URI Resolver to return the newly constructed xml diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java b/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java index 3b4a945a254..c1f4989a770 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java @@ -46,6 +46,7 @@ import org.xml.sax.InputSource; * @bug 8144593 * @key intermittent * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest + * @compile -XDignore.symbol.file TestSAXDriver.java * @run testng/othervm -DrunSecMngr=true common.ValidationWarningsTest * @run testng/othervm common.ValidationWarningsTest * @summary Check that warnings about unsupported properties from SAX diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java b/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java index 9a7ce2d8f7b..3fde8d1f725 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java +++ b/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java @@ -23,11 +23,15 @@ package common; +import static jaxp.library.JAXPTestUtilities.runWithAllPerm; + import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.lang.Thread.UncaughtExceptionHandler; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -58,25 +62,27 @@ public abstract class WarningsTestBase { PrintStream defStdErr = System.err; //Set new byte array stream as standard error stream ByteArrayOutputStream byteStream = new ByteArrayOutputStream(5000); - System.setErr(new PrintStream(byteStream)); + runWithAllPerm(() -> System.setErr(new PrintStream(byteStream))); //Execute multiple TestWorker tasks for (int id = 0; id < THREADS_COUNT; id++) { EXECUTOR.execute(new TestWorker(id)); } //Initiate shutdown of previously submitted task - EXECUTOR.shutdown(); + runWithAllPerm(EXECUTOR::shutdown); //Wait for termination of submitted tasks if (!EXECUTOR.awaitTermination(THREADS_COUNT, TimeUnit.SECONDS)) { //If not all tasks terminates during the time out force them to shutdown - EXECUTOR.shutdownNow(); + runWithAllPerm(EXECUTOR::shutdownNow); } //Restore default standard error stream - System.setErr(defStdErr); + runWithAllPerm(() -> System.setErr(defStdErr)); //Print tasks stderr output String errContent = byteStream.toString(); System.out.println("Standard error output content:"); System.out.println(errContent); - //Check tasks stderr output for quatity of warning messages + //Check if uncaught exceptions were observed by one or more threads + Assert.assertFalse(uncaughtExceptions); + //Check tasks stderr output for quantity of warning messages Assert.assertTrue(warningPrintedOnce(XMLConstants.ACCESS_EXTERNAL_DTD, errContent)); Assert.assertTrue(warningPrintedOnce(ENT_EXP_PROPERTY, errContent)); Assert.assertTrue(warningPrintedOnce(XMLConstants.FEATURE_SECURE_PROCESSING, errContent)); @@ -123,6 +129,25 @@ public abstract class WarningsTestBase { } } + // Thread factory that handles uncaughtExceptions and prints them + // to stdout instead of stderr. + private static class TestThreadFactory implements ThreadFactory { + + public Thread newThread(final Runnable r) { + Thread t = Executors.defaultThreadFactory().newThread(r); + t.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { + @Override + public void uncaughtException(Thread t, Throwable thr) { + thr.printStackTrace(System.out); + uncaughtExceptions = true; + } + }); + return t; + } + } + + //Flag that indicates if one or more threads from thread pool caught unhandled exception + private static boolean uncaughtExceptions = false; //Entity expansion limit property name private static final String ENT_EXP_PROPERTY = "http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit"; //Number of simultaneous test threads @@ -130,7 +155,7 @@ public abstract class WarningsTestBase { //Number of iterations per one thread private static final int ITERATIONS_PER_THREAD = 4; //Test thread pool - private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool(); - //Cyclic barrier for threads startup synchronisation + private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool(new TestThreadFactory()); + //Cyclic barrier for threads startup synchronization private static final CyclicBarrier BARRIER = new CyclicBarrier(THREADS_COUNT); } From 7a3d0498d3e54e106bd03756791552f0093a6ffd Mon Sep 17 00:00:00 2001 From: Robert Field Date: Thu, 1 Sep 2016 12:13:13 -0700 Subject: [PATCH 46/99] 8133507: JShell: StackTraceElement#getFileName of EvalException does not use custom id generator Reviewed-by: jlahoda --- .../share/classes/jdk/jshell/Eval.java | 19 ++++++++++++------- .../test/jdk/jshell/IdGeneratorTest.java | 5 ++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Eval.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Eval.java index 87f8d5af44d..79b8b221db5 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Eval.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Eval.java @@ -555,9 +555,11 @@ class Eval { : ""; } catch (ResolutionException ex) { DeclarationSnippet sn = (DeclarationSnippet) state.maps.getSnippetDeadOrAlive(ex.id()); - exception = new UnresolvedReferenceException(sn, ex.getStackTrace()); + exception = new UnresolvedReferenceException(sn, translateExceptionStack(ex)); } catch (UserException ex) { - exception = translateExecutionException(ex); + exception = new EvalException(translateExceptionMessage(ex), + ex.causeExceptionClass(), + translateExceptionStack(ex)); } catch (RunException ex) { // StopException - no-op } catch (InternalException ex) { @@ -732,7 +734,7 @@ class Eval { } } - private EvalException translateExecutionException(UserException ex) { + private StackTraceElement[] translateExceptionStack(Exception ex) { StackTraceElement[] raw = ex.getStackTrace(); int last = raw.length; do { @@ -759,11 +761,14 @@ class Eval { elems[i] = r; } } + return elems; + } + + private String translateExceptionMessage(Exception ex) { String msg = ex.getMessage(); - if (msg.equals("")) { - msg = null; - } - return new EvalException(msg, ex.causeExceptionClass(), elems); + return msg.equals("") + ? null + : msg; } private boolean isWrap(StackTraceElement ste) { diff --git a/langtools/test/jdk/jshell/IdGeneratorTest.java b/langtools/test/jdk/jshell/IdGeneratorTest.java index 1a3f167ba3c..38ccc1b3de5 100644 --- a/langtools/test/jdk/jshell/IdGeneratorTest.java +++ b/langtools/test/jdk/jshell/IdGeneratorTest.java @@ -99,19 +99,18 @@ public class IdGeneratorTest { } } - @Test(enabled = false) // TODO 8133507 public void testIdInException() { JShell.Builder builder = getBuilder().idGenerator(((snippet, id) -> "custom" + id)); try (JShell jShell = builder.build()) { EvalException evalException = (EvalException) jShell.eval("throw new Error();").get(0).exception(); for (StackTraceElement ste : evalException.getStackTrace()) { - assertTrue(ste.getFileName().startsWith("custom"), "Not started with \"custom\": " + assertTrue(ste.getFileName().startsWith("#custom"), "Not started with \"#custom\": " + ste.getFileName()); } jShell.eval("void f() { g(); }"); UnresolvedReferenceException unresolvedException = (UnresolvedReferenceException) jShell.eval("f();").get(0).exception(); for (StackTraceElement ste : unresolvedException.getStackTrace()) { - assertTrue(ste.getFileName().startsWith("custom"), "Not started with \"custom\": " + assertTrue(ste.getFileName().startsWith("#custom"), "Not started with \"#custom\": " + ste.getFileName()); } } From 8302f64ee65268dc1a52a418e4683d44fc194a0d Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Thu, 1 Sep 2016 21:25:33 +0200 Subject: [PATCH 47/99] 8164952: JShell tests: jdk/jshell/CompletionSuggestionTest.testUncompletedDeclaration(): failure Avoiding conflict between the CompletionSuggestionTest.testUncompletedDeclaration test and ClassPathTest Reviewed-by: rfield --- langtools/test/jdk/jshell/CompletionSuggestionTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langtools/test/jdk/jshell/CompletionSuggestionTest.java b/langtools/test/jdk/jshell/CompletionSuggestionTest.java index 93767169bed..8c2c723bc1e 100644 --- a/langtools/test/jdk/jshell/CompletionSuggestionTest.java +++ b/langtools/test/jdk/jshell/CompletionSuggestionTest.java @@ -419,9 +419,9 @@ public class CompletionSuggestionTest extends KullaTesting { public void testUncompletedDeclaration() { assertCompletion("class Clazz { Claz|", "Clazz"); assertCompletion("class Clazz { class A extends Claz|", "Clazz"); - assertCompletion("class Clazz { Clazz clazz; Object o = cla|", "clazz"); - assertCompletion("class Clazz { static Clazz clazz; Object o = cla|", "clazz"); - assertCompletion("class Clazz { Clazz clazz; static Object o = cla|", true); + assertCompletion("class Clazz { Clazz clazz; Object o = claz|", "clazz"); + assertCompletion("class Clazz { static Clazz clazz; Object o = claz|", "clazz"); + assertCompletion("class Clazz { Clazz clazz; static Object o = claz|", true); assertCompletion("class Clazz { void method(Claz|", "Clazz"); assertCompletion("class A { int method() { return 0; } int a = meth|", "method()"); assertCompletion("class A { int field = 0; int method() { return fiel|", "field"); From 4017bf5f7a6a0b103ce00c7919bc9cd3683d8a16 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Thu, 1 Sep 2016 13:21:52 -0700 Subject: [PATCH 48/99] 8165211: JShell: Fix completion analysis problems Reviewed-by: jlahoda --- .../jdk/jshell/CompletenessAnalyzer.java | 142 +++++++----------- .../test/jdk/jshell/CompletenessTest.java | 9 +- 2 files changed, 65 insertions(+), 86 deletions(-) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java index 10a00697231..c652b45b308 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java @@ -46,6 +46,8 @@ import com.sun.source.tree.Tree; import static jdk.jshell.CompletenessAnalyzer.TK.*; import jdk.jshell.TaskFactory.ParseTask; import java.util.List; +import java.util.function.Function; +import java.util.function.Supplier; /** * Low level scanner to determine completeness of input. @@ -81,13 +83,13 @@ class CompletenessAnalyzer { CaInfo scan(String s) { try { - Scanner scanner = scannerFactory.newScanner(s, false); - Matched in = new Matched(scanner); - Parser parser = new Parser(in, proc, s); + Parser parser = new Parser( + () -> new Matched(scannerFactory.newScanner(s, false)), + () -> proc.taskFactory.new ParseTask(s)); Completeness stat = parser.parseUnit(); int endPos = stat == Completeness.UNKNOWN ? s.length() - : in.prevCT.endPos; + : parser.endPos(); return new CaInfo(stat, endPos); } catch (SyntaxException ex) { return new CaInfo(error(), s.length()); @@ -188,7 +190,7 @@ class CompletenessAnalyzer { ERROR(TokenKind.ERROR, XERRO), // IDENTIFIER(TokenKind.IDENTIFIER, XEXPR1|XDECL1|XTERM), // UNDERSCORE(TokenKind.UNDERSCORE, XERRO), // _ - CLASS(TokenKind.CLASS, XEXPR|XDECL1|XTERM), // class decl and .class + CLASS(TokenKind.CLASS, XEXPR|XDECL1), // class decl (MAPPED: DOTCLASS) MONKEYS_AT(TokenKind.MONKEYS_AT, XEXPR|XDECL1), // @ IMPORT(TokenKind.IMPORT, XDECL1|XSTART), // import -- consider declaration SEMI(TokenKind.SEMI, XSTMT1|XTERM|XSTART), // ; @@ -206,15 +208,15 @@ class CompletenessAnalyzer { THROWS(TokenKind.THROWS, XDECL), // throws // Primarive type names - BOOLEAN(TokenKind.BOOLEAN, XEXPR|XDECL1), // boolean - BYTE(TokenKind.BYTE, XEXPR|XDECL1), // byte - CHAR(TokenKind.CHAR, XEXPR|XDECL1), // char - DOUBLE(TokenKind.DOUBLE, XEXPR|XDECL1), // double - FLOAT(TokenKind.FLOAT, XEXPR|XDECL1), // float - INT(TokenKind.INT, XEXPR|XDECL1), // int - LONG(TokenKind.LONG, XEXPR|XDECL1), // long - SHORT(TokenKind.SHORT, XEXPR|XDECL1), // short - VOID(TokenKind.VOID, XEXPR|XDECL1), // void + BOOLEAN(TokenKind.BOOLEAN, XEXPR1|XDECL1), // boolean + BYTE(TokenKind.BYTE, XEXPR1|XDECL1), // byte + CHAR(TokenKind.CHAR, XEXPR1|XDECL1), // char + DOUBLE(TokenKind.DOUBLE, XEXPR1|XDECL1), // double + FLOAT(TokenKind.FLOAT, XEXPR1|XDECL1), // float + INT(TokenKind.INT, XEXPR1|XDECL1), // int + LONG(TokenKind.LONG, XEXPR1|XDECL1), // long + SHORT(TokenKind.SHORT, XEXPR1|XDECL1), // short + VOID(TokenKind.VOID, XEXPR1|XDECL1), // void // Modifiers keywords ABSTRACT(TokenKind.ABSTRACT, XDECL1), // abstract @@ -230,7 +232,7 @@ class CompletenessAnalyzer { // Declarations and type parameters (thus expressions) EXTENDS(TokenKind.EXTENDS, XEXPR|XDECL), // extends - COMMA(TokenKind.COMMA, XEXPR|XDECL), // , + COMMA(TokenKind.COMMA, XEXPR|XDECL|XTERM), // , AMP(TokenKind.AMP, XEXPR|XDECL), // & GT(TokenKind.GT, XEXPR|XDECL), // > LT(TokenKind.LT, XEXPR|XDECL1), // < @@ -239,7 +241,7 @@ class CompletenessAnalyzer { GTGTGT(TokenKind.GTGTGT, XEXPR|XDECL), // >>> QUES(TokenKind.QUES, XEXPR|XDECL), // ? DOT(TokenKind.DOT, XEXPR|XDECL), // . - STAR(TokenKind.STAR, XEXPR|XDECL|XTERM), // * -- import foo.* //TODO handle these case separately, XTERM + STAR(TokenKind.STAR, XEXPR), // * (MAPPED: DOTSTAR) // Statement keywords ASSERT(TokenKind.ASSERT, XSTMT1|XSTART), // assert @@ -280,7 +282,7 @@ class CompletenessAnalyzer { // Expressions cannot terminate INSTANCEOF(TokenKind.INSTANCEOF, XEXPR), // instanceof - NEW(TokenKind.NEW, XEXPR1), // new + NEW(TokenKind.NEW, XEXPR1), // new (MAPPED: COLCOLNEW) SUPER(TokenKind.SUPER, XEXPR1|XDECL), // super -- shouldn't see as rec. But in type parameters ARROW(TokenKind.ARROW, XEXPR), // -> COLCOL(TokenKind.COLCOL, XEXPR), // :: @@ -323,24 +325,29 @@ class CompletenessAnalyzer { UNMATCHED(XERRO), PARENS(XEXPR1|XDECL|XSTMT|XTERM), BRACKETS(XEXPR|XDECL|XTERM), - BRACES(XSTMT1|XEXPR|XTERM); + BRACES(XSTMT1|XEXPR|XTERM), + DOTSTAR(XDECL|XTERM), // import foo.* + COLCOLNEW(XEXPR|XTERM), // :: new + DOTCLASS(XEXPR|XTERM), // class decl and .class + ; static final EnumMap tokenKindToTKMap = new EnumMap<>(TokenKind.class); final TokenKind tokenKind; final int belongs; + Function mapping; TK(int b) { - this.tokenKind = null; - this.belongs = b; + this(null, b); } TK(TokenKind tokenKind, int b) { this.tokenKind = tokenKind; this.belongs = b; + this.mapping = null; } - private static TK tokenKindToTK(TokenKind kind) { + private static TK tokenKindToTK(TK prev, TokenKind kind) { TK tk = tokenKindToTKMap.get(kind); if (tk == null) { System.err.printf("No corresponding %s for %s: %s\n", @@ -349,7 +356,9 @@ class CompletenessAnalyzer { kind); throw new InternalError("No corresponding TK for TokenKind: " + kind); } - return tk; + return tk.mapping != null + ? tk.mapping.apply(prev) + : tk; } boolean isOkToTerminate() { @@ -383,8 +392,12 @@ class CompletenessAnalyzer { } } for (TokenKind kind : TokenKind.values()) { - tokenKindToTK(kind); // assure they can be retrieved without error + tokenKindToTK(null, kind); // assure they can be retrieved without error } + // Mappings of disambiguated contexts + STAR.mapping = prev -> prev == DOT ? DOTSTAR : STAR; + NEW.mapping = prev -> prev == COLCOL ? COLCOLNEW : NEW; + CLASS.mapping = prev -> prev == DOT ? DOTCLASS : CLASS; } } @@ -520,7 +533,7 @@ class CompletenessAnalyzer { ct = match(BRACKETS, TokenKind.LBRACKET); break; default: - ct = new CT(TK.tokenKindToTK(current.kind), advance()); + ct = new CT(TK.tokenKindToTK(prevTK, current.kind), advance()); break; } if (ct.kind.isStart() && !prevTK.isOkToTerminate()) { @@ -539,21 +552,21 @@ class CompletenessAnalyzer { */ private static class Parser { - final Matched in; - CT token; - Completeness checkResult; + private final Supplier matchedFactory; + private final Supplier parseFactory; + private Matched in; + private CT token; + private Completeness checkResult; - final JShell proc; - final String scannedInput; + Parser(Supplier matchedFactory, Supplier parseFactory) { + this.matchedFactory = matchedFactory; + this.parseFactory = parseFactory; + resetInput(); + } - - - Parser(Matched in, JShell proc, String scannedInput) { - this.in = in; + final void resetInput() { + this.in = matchedFactory.get(); nextToken(); - - this.proc = proc; - this.scannedInput = scannedInput; } final void nextToken() { @@ -598,6 +611,10 @@ class CompletenessAnalyzer { return flags != Completeness.COMPLETE; } + public int endPos() { + return in.prevCT.endPos; + } + public Completeness parseUnit() { //System.err.printf("%s: belongs %o XANY1 %o\n", token.kind, token.kind.belongs, token.kind.belongs & XANY1); switch (token.kind.belongs & XANY1) { @@ -651,11 +668,11 @@ class CompletenessAnalyzer { case IDENTIFIER: case BRACKETS: return Completeness.COMPLETE_WITH_SEMI; - case STAR: + case DOTSTAR: if (isImport) { return Completeness.COMPLETE_WITH_SEMI; } else { - return Completeness.DEFINITELY_INCOMPLETE; + return Completeness.UNKNOWN; } default: return Completeness.DEFINITELY_INCOMPLETE; @@ -667,7 +684,7 @@ class CompletenessAnalyzer { public Completeness disambiguateDeclarationVsExpression() { // String folding messes up position information. - ParseTask pt = proc.taskFactory.new ParseTask(scannedInput); + ParseTask pt = parseFactory.get(); List units = pt.units(); if (units.isEmpty()) { return error(); @@ -679,7 +696,7 @@ class CompletenessAnalyzer { case LABELED_STATEMENT: if (shouldAbort(IDENTIFIER)) return checkResult; if (shouldAbort(COLON)) return checkResult; - return parseStatement(); + return parseStatement(); case VARIABLE: case IMPORT: case CLASS: @@ -693,51 +710,6 @@ class CompletenessAnalyzer { } } -// public Status parseExpressionOrDeclaration() { -// if (token.kind == IDENTIFIER) { -// nextToken(); -// switch (token.kind) { -// case IDENTIFIER: -// return parseDeclaration(); -// } -// } -// while (token.kind.isExpressionOrDeclaration()) { -// if (!token.kind.isExpression()) { -// return parseDeclaration(); -// } -// if (!token.kind.isDeclaration()) { -// // Expression not declaration -// if (token.kind == EQ) { -// // Check for array initializer -// nextToken(); -// if (token.kind == BRACES) { -// nextToken(); -// return lastly(SEMI); -// } -// } -// return parseExpressionStatement(); -// } -// nextToken(); -// } -// switch (token.kind) { -// case BRACES: -// case SEMI: -// nextToken(); -// return Status.COMPLETE; -// case UNMATCHED: -// nextToken(); -// return Status.DEFINITELY_INCOMPLETE; -// case EOF: -// if (in.prevCT.kind.isOkToTerminate()) { -// return Status.COMPLETE_WITH_SEMI; -// } else { -// return Status.DEFINITELY_INCOMPLETE; -// } -// default: -// return error(); -// } -// } - public Completeness parseExpressionStatement() { if (shouldAbort(parseExpression())) return checkResult; return lastly(SEMI); diff --git a/langtools/test/jdk/jshell/CompletenessTest.java b/langtools/test/jdk/jshell/CompletenessTest.java index bf95b51f311..b0e5a781036 100644 --- a/langtools/test/jdk/jshell/CompletenessTest.java +++ b/langtools/test/jdk/jshell/CompletenessTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8149524 8131024 + * @bug 8149524 8131024 8165211 8080071 8130454 * @summary Test SourceCodeAnalysis * @build KullaTesting TestingInputStream * @run testng CompletenessTest @@ -63,6 +63,7 @@ public class CompletenessTest extends KullaTesting { "foo: while (true) { printf(\"Innn\"); break foo; }", "class Case, E2 extends Enum, E3 extends Enum> {}", ";", + "enum Tt { FOO, BAR, BAZ,; }" }; static final String[] expression = new String[] { @@ -77,6 +78,8 @@ public class CompletenessTest extends KullaTesting { "new int[] {1, 2,3}", "new Foo() {}", "i >= 0 && Character.isWhitespace(s.charAt(i))", + "int.class", + "String.class", }; static final String[] complete_with_semi = new String[] { @@ -113,6 +116,7 @@ public class CompletenessTest extends KullaTesting { "BufferedReader br = new BufferedReader(new FileReader(path))", "bar: g()", "baz: while (true) if (t()) printf('-'); else break baz", + "java.util.function.IntFunction ggg = int[]::new", }; static final String[] considered_incomplete = new String[] { @@ -141,6 +145,8 @@ public class CompletenessTest extends KullaTesting { "if (match.kind == BRACES && (prevCT.kind == ARROW || prevCT.kind == NEW_MIDDLE)) {", "if (match.kind == BRACES && (prevCT.kind == ARROW || prevCT.kind == NEW_MIDDLE)) { new CT(UNMATCHED, current, \"Unmatched \" + unmatched);", "x +", + "x *", + "3 *", "int", "for (int i = 0; i < lines.length(); ++i) {", "new", @@ -156,6 +162,7 @@ public class CompletenessTest extends KullaTesting { "enum TK { EOF(TokenKind.EOF, 0),", "enum TK { EOF(TokenKind.EOF, 0), NEW_MIDDLE(XEXPR1|XTERM)", "enum TK { EOF(TokenKind.EOF, 0), NEW_MIDDLE(XEXPR1|XTERM); ", + "enum Tt { FOO, BAR, BAZ,;" }; static final String[] unknown = new String[] { From 0ed31a8ac8e617d337e6e513e135aa05f225e492 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:09 +0000 Subject: [PATCH 49/99] Added tag jdk-9+134 for changeset d03967e81db7 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 9b00c6661fd..0c614608939 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -376,3 +376,4 @@ d94d54a3192fea79234c3ac55cd0b4052d45e954 jdk-9+130 8728756c2f70a79a90188f4019cfd6b9a275765c jdk-9+131 a24702d4d5ab0015a5c553ed57f66fce7d85155e jdk-9+132 be1218f792a450dfb5d4b1f82616b9d95a6a732e jdk-9+133 +065724348690eda41fc69112278d8da6dcde548c jdk-9+134 From f0e3ab92184a849045aafa83c5a0f436a95b64aa Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:10 +0000 Subject: [PATCH 50/99] Added tag jdk-9+134 for changeset 6efb7e03e19c --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 8d8a2e6cf99..4cc7243b9ce 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -536,3 +536,4 @@ e96b34b76d863ed1fa04e0eeb3f297ac17b490fd jdk-9+129 943bf73b49c33c2d7cbd796f6a4ae3c7a00ae932 jdk-9+131 713951c08aa26813375175c2ab6cc99ff2a56903 jdk-9+132 a25e0fb6033245ab075136e744d362ce765464cd jdk-9+133 +b8b694c6b4d2ab0939aed7adaf0eec1ac321a085 jdk-9+134 From 7a36df6b44adfa1a1ae03a076a337c0eba13f6b5 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:10 +0000 Subject: [PATCH 51/99] Added tag jdk-9+134 for changeset 6929cdb3e1c5 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index a959d0d2240..ee81ced5edd 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -376,3 +376,4 @@ c3e83ccab3bb1733ae903d681879a33f85ed465c jdk-9+129 f7e1d5337c2e550fe553df7a3886bbed80292ecd jdk-9+131 1ab4b9399c4cba584f66c1c088188f2f565fbf9c jdk-9+132 2021bfedf1c478a4808a7711a6090682a12f4c0e jdk-9+133 +1a497f5ca0cfd88115cc7daa8af8a62b8741caf2 jdk-9+134 From f3b9377906740acaf71b3bc7cdaa22ec9c7c5b3a Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:11 +0000 Subject: [PATCH 52/99] Added tag jdk-9+134 for changeset 1dddef49982c --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index e81f2084cef..25362b9eae8 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -376,3 +376,4 @@ e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130 874082a9b565a7092a40bfa934a6e3e3c3455a60 jdk-9+131 907445d85e680ea410fe2c83c0ec64b5508e4f3e jdk-9+132 9490ba2e5e41685c858a0ca2a6ec87611eb011c6 jdk-9+133 +1c6c21d87aa459d82425e1fddc9ce8647aebde34 jdk-9+134 From 03d3f90a58fcb22f85e86e965730e3e54f44702f Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:11 +0000 Subject: [PATCH 53/99] Added tag jdk-9+134 for changeset 219458339252 --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 136f72fe00d..19675fb9b1a 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -379,3 +379,4 @@ fe4e11bd2423635dc0f5f5cb9a64eb2f2cce7f4c jdk-9+128 783e7e2c587f2c7e1b9998a46d90ec196ab2a195 jdk-9+131 9fff2477a4cadf2a9618a76f1f4fe0f20bb5ff3b jdk-9+132 05e99eefda2b58d1ed176e411302d9d6b35dca16 jdk-9+133 +ab1d78d395d4cb8be426ff181211da1a4085cf01 jdk-9+134 From 5823fdef292fb05954023810b41681ffde0b12b5 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:13 +0000 Subject: [PATCH 54/99] Added tag jdk-9+134 for changeset eb2c81860c86 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 4fdf92ea61c..f4500a88ff0 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -376,3 +376,4 @@ e181909291981038b041ed4d22714c4760e049cd jdk-9+129 aebfafc43714d5a27d5064d8a0011eaccde633cf jdk-9+131 2c17b65a37a8d7afdb9f96d5f11b28a3f21c78f2 jdk-9+132 7efa4b3477b2b93edbdb4abf827b74c6391f056e jdk-9+133 +f08683786207a48b652266b3b7b908e6c863c3fc jdk-9+134 From 2fb04d0a420c624ac69cccb5a13346de2ea06670 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 1 Sep 2016 23:20:13 +0000 Subject: [PATCH 55/99] Added tag jdk-9+134 for changeset d48c4f63e546 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index f68987a568a..344e197c433 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -367,3 +367,4 @@ ff07be6106fa56b72c163244f45a3ecb4c995564 jdk-9+127 ee77c6b3713ab293e027ac3ea1cc16f86dac535f jdk-9+131 55a75af751dfe44039baef2b762ee7347021025b jdk-9+132 3a924b820d02b108cf57b51e145b5150d1eedcca jdk-9+133 +e05400ba935753c77697af936db24657eb811022 jdk-9+134 From 524cb00f824a0b0d00fb8607e656024964ae3fa0 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 1 Sep 2016 17:03:41 -0700 Subject: [PATCH 56/99] 8161454: Fails to Load external Java method from inside of a XSL stylesheet if SecurityManager is present Reviewed-by: aefimov, lancea, dfuchs --- .../jdk/xml/internal/JdkXmlFeatures.java | 40 +++++++++- .../unittest/transform/XSLTFunctionsTest.java | 80 ++++++++++++++++++- 2 files changed, 115 insertions(+), 5 deletions(-) diff --git a/jaxp/src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java b/jaxp/src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java index 868ad21535c..240c386bf56 100644 --- a/jaxp/src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java +++ b/jaxp/src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java @@ -42,6 +42,9 @@ public class JdkXmlFeatures { ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions"; public static final String SP_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions"; + // This is the correct name by the spec + public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC = + "jdk.xml.enableExtensionFunctions"; public static final String CATALOG_FEATURES = "javax.xml.catalog.catalogFeatures"; public final static String PROPERTY_USE_CATALOG = XMLConstants.USE_CATALOG; @@ -49,11 +52,11 @@ public class JdkXmlFeatures { public static enum XmlFeature { /** * Feature enableExtensionFunctions - * FSP: extension function is enforced by FSP. When FSP is on, entension + * FSP: extension function is enforced by FSP. When FSP is on, extension * function is disabled. */ ENABLE_EXTENSION_FUNCTION(ORACLE_ENABLE_EXTENSION_FUNCTION, - SP_ENABLE_EXTENSION_FUNCTION, true, false, true, true), + SP_ENABLE_EXTENSION_FUNCTION_SPEC, true, false, true, true), /** * The {@link javax.xml.XMLConstants.USE_CATALOG} feature. * FSP: USE_CATALOG is not enforced by FSP. @@ -148,6 +151,30 @@ public class JdkXmlFeatures { } + /** + * Maps old property names with the new ones. This map is used to keep track of + * name changes so that old or incorrect names continue to be supported for compatibility. + */ + public static enum NameMap { + + ENABLE_EXTENSION_FUNCTION(SP_ENABLE_EXTENSION_FUNCTION_SPEC, SP_ENABLE_EXTENSION_FUNCTION); + + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + /** * States of the settings of a property, in the order: default value, value * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system @@ -316,6 +343,15 @@ public class JdkXmlFeatures { private void readSystemProperties() { for (XmlFeature feature : XmlFeature.values()) { getSystemProperty(feature, feature.systemProperty()); + if (!getSystemProperty(feature, feature.systemProperty())) { + //if system property is not found, try the older form if any + for (NameMap nameMap : NameMap.values()) { + String oldName = nameMap.getOldName(feature.systemProperty()); + if (oldName != null) { + getSystemProperty(feature, oldName); + } + } + } } } diff --git a/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java b/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java index 51df5915037..354accefa4a 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java @@ -34,11 +34,16 @@ import javax.xml.transform.URIResolver; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Listeners; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; +import static jaxp.library.JAXPTestUtilities.runWithAllPerm; +import static jaxp.library.JAXPTestUtilities.clearSystemProperty; +import static jaxp.library.JAXPTestUtilities.setSystemProperty; +import static jaxp.library.JAXPTestUtilities.getSystemProperty; /* * @test @@ -49,9 +54,65 @@ import static org.testng.Assert.assertEquals; * @summary This class contains tests for XSLT functions. */ -//@Listeners({jaxp.library.BasePolicy.class}) //uncomment this line after 8161454 is resolved +@Listeners({jaxp.library.BasePolicy.class}) public class XSLTFunctionsTest { + /** + * @bug 8161454 + * Verifies that the new / correct name is supported, as is the old / incorrect + * one for compatibility + */ + @Test + public void testNameChange() { + + boolean feature; + TransformerFactory tf = TransformerFactory.newInstance(); + feature = tf.getFeature(ORACLE_ENABLE_EXTENSION_FUNCTION); + System.out.println("Default setting: " + feature); + // The default: true if no SecurityManager, false otherwise + Assert.assertTrue(feature == getDefault()); + + setSystemProperty(SP_ENABLE_EXTENSION_FUNCTION, getDefaultOpposite()); + tf = TransformerFactory.newInstance(); + feature = tf.getFeature(ORACLE_ENABLE_EXTENSION_FUNCTION); + System.out.println("After setting " + SP_ENABLE_EXTENSION_FUNCTION + ": " + feature); + clearSystemProperty(SP_ENABLE_EXTENSION_FUNCTION); + // old/incorrect name is still supported + Assert.assertTrue(feature != getDefault()); + + setSystemProperty(SP_ENABLE_EXTENSION_FUNCTION_SPEC, getDefaultOpposite()); + tf = TransformerFactory.newInstance(); + feature = tf.getFeature(ORACLE_ENABLE_EXTENSION_FUNCTION); + System.out.println("After setting " + SP_ENABLE_EXTENSION_FUNCTION_SPEC + ": " + feature); + clearSystemProperty(SP_ENABLE_EXTENSION_FUNCTION_SPEC); + // new/correct name is effective + Assert.assertTrue(feature != getDefault()); + } + + final boolean isSecure; + { + String runSecMngr = getSystemProperty("runSecMngr"); + isSecure = runSecMngr != null && runSecMngr.equals("true"); + } + + // The default: true if no SecurityManager, false otherwise + private boolean getDefault() { + if (isSecure) { + return false; + } else { + return true; + } + } + + // Gets a String value that is opposite to the default value + private String getDefaultOpposite() { + if (isSecure) { + return "true"; + } else { + return "false"; + } + } + /** * @bug 8062518 8153082 * Verifies that a reference to the DTM created by XSLT document function is @@ -72,7 +133,9 @@ public class XSLTFunctionsTest { // Create factory and transformer TransformerFactory tf = TransformerFactory.newInstance(); - tf.setFeature("http://www.oracle.com/xml/jaxp/properties/enableExtensionFunctions", true); + tf.setFeature(ORACLE_ENABLE_EXTENSION_FUNCTION, true); + tf.setAttribute(EXTENSION_CLASS_LOADER, + runWithAllPerm(() -> Thread.currentThread().getContextClassLoader())); Transformer t = tf.newTransformer( xslsrc ); t.setErrorListener(tf.getErrorListener()); @@ -133,5 +196,16 @@ public class XSLTFunctionsTest { static final String documentTesteExpectedResult = "" + "[Test:Doc][Test:External Doc]"; -} + public static final String ORACLE_JAXP_PROPERTY_PREFIX = + "http://www.oracle.com/xml/jaxp/properties/"; + /** + * Feature enableExtensionFunctions + */ + public static final String ORACLE_ENABLE_EXTENSION_FUNCTION = + ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions"; + static final String SP_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions"; + // This is the correct name by the spec + static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC = "jdk.xml.enableExtensionFunctions"; + private static final String EXTENSION_CLASS_LOADER = "jdk.xml.transform.extensionClassLoader"; +} From 876bb73271f242d8f4ccd500a7059d71b477f6e5 Mon Sep 17 00:00:00 2001 From: Srikanth Adayapalam Date: Fri, 2 Sep 2016 07:49:15 +0530 Subject: [PATCH 57/99] 8164073: Javac should unconditionally warn if deprecated javadoc tag is used without @Deprecated annotation Reviewed-by: mcimadamore --- .../com/sun/tools/javac/code/Symbol.java | 13 +++++++ .../com/sun/tools/javac/comp/Check.java | 16 +++------ .../com/sun/tools/javac/util/Options.java | 14 +++++++- .../tools/javac/T4994049/DeprecatedYES.out | 5 +-- .../test/tools/javac/danglingDep/DepX.out | 2 ++ .../SuppressDepAnnWithSwitchTest.java | 34 +++++++++++++++++++ .../depDocComment/SuppressDeprecation.java | 3 +- .../depDocComment/SuppressDeprecation.out | 28 ++++++++++----- .../depDocComment/SuppressDeprecation8.out | 9 +++++ .../javac/depOverrides/doccomment/Test1.java | 6 ++-- .../javac/depOverrides/doccomment/Test1A.out | 8 ++++- .../javac/depOverrides/doccomment/Test1B.out | 8 ++++- .../javac/depOverrides/doccomment/Test1B2.out | 8 ++++- .../javac/depOverrides/doccomment/Test1B3.out | 8 +++++ .../javac/depOverrides/doccomment/Test1I.out | 9 +++++ .../javac/depOverrides/doccomment/Test2.java | 4 +-- .../javac/depOverrides/doccomment/Test2P.out | 10 ++++++ .../javac/depOverrides/doccomment/Test2Q.out | 8 ++++- .../javac/depOverrides/doccomment/Test2R.out | 8 ++++- .../javac/depOverrides/doccomment/Test3.out | 3 +- .../test/tools/javac/lint/Deprecation.out | 5 +-- 21 files changed, 172 insertions(+), 37 deletions(-) create mode 100644 langtools/test/tools/javac/depDocComment/SuppressDepAnnWithSwitchTest.java create mode 100644 langtools/test/tools/javac/depDocComment/SuppressDeprecation8.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1B3.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1I.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test2P.out diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java index 959d3ac1a91..8757939f626 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java @@ -359,6 +359,19 @@ public abstract class Symbol extends AnnoConstruct implements Element { return (flags_field & DEPRECATED) != 0; } + public boolean isDeprecatableViaAnnotation() { + switch (getKind()) { + case LOCAL_VARIABLE: + case PACKAGE: + case PARAMETER: + case RESOURCE_VARIABLE: + case EXCEPTION_PARAMETER: + return false; + default: + return true; + } + } + public boolean isStatic() { return (flags() & STATIC) != 0 || diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index 7e2f823d3c9..5767f9c45e4 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -3192,7 +3192,7 @@ public class Check { } void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) { - if (lint.isEnabled(LintCategory.DEP_ANN) && + if (lint.isEnabled(LintCategory.DEP_ANN) && s.isDeprecatableViaAnnotation() && (s.flags() & DEPRECATED) != 0 && !syms.deprecatedType.isErroneous() && s.attribute(syms.deprecatedType.tsym) == null) { @@ -3200,18 +3200,10 @@ public class Check { pos, "missing.deprecated.annotation"); } // Note: @Deprecated has no effect on local variables, parameters and package decls. - if (lint.isEnabled(LintCategory.DEPRECATION)) { + if (lint.isEnabled(LintCategory.DEPRECATION) && !s.isDeprecatableViaAnnotation()) { if (!syms.deprecatedType.isErroneous() && s.attribute(syms.deprecatedType.tsym) != null) { - switch (s.getKind()) { - case LOCAL_VARIABLE: - case PACKAGE: - case PARAMETER: - case RESOURCE_VARIABLE: - case EXCEPTION_PARAMETER: - log.warning(LintCategory.DEPRECATION, pos, - "deprecated.annotation.has.no.effect", Kinds.kindName(s)); - break; - } + log.warning(LintCategory.DEPRECATION, pos, + "deprecated.annotation.has.no.effect", Kinds.kindName(s)); } } } diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java index 6cdb8fc7020..15481349fc0 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java @@ -26,6 +26,8 @@ package com.sun.tools.javac.util; import java.util.*; + +import com.sun.tools.javac.code.Source; import com.sun.tools.javac.main.Option; import static com.sun.tools.javac.main.Option.*; @@ -176,7 +178,17 @@ public class Options { // disabled return isSet(XLINT_CUSTOM, s) || - (isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) && + (isSet(XLINT) || isSet(XLINT_CUSTOM, "all") || (s.equals("dep-ann") && depAnnOnByDefault())) && isUnset(XLINT_CUSTOM, "-" + s); } + // where + private boolean depAnnOnByDefault() { + String sourceName = get(Option.SOURCE); + Source source = null; + if (sourceName != null) + source = Source.lookup(sourceName); + if (source == null) + source = Source.DEFAULT; + return source.compareTo(Source.JDK1_9) >= 0; + } } diff --git a/langtools/test/tools/javac/T4994049/DeprecatedYES.out b/langtools/test/tools/javac/T4994049/DeprecatedYES.out index 0750441a39c..3925e16ded9 100644 --- a/langtools/test/tools/javac/T4994049/DeprecatedYES.out +++ b/langtools/test/tools/javac/T4994049/DeprecatedYES.out @@ -1,4 +1,5 @@ -DeprecatedYES.java:18:10: compiler.warn.has.been.deprecated: foo(), A +DeprecatedYES.java:12:10: compiler.warn.missing.deprecated.annotation - compiler.err.warnings.and.werror +DeprecatedYES.java:18:10: compiler.warn.has.been.deprecated: foo(), A 1 error -1 warning +2 warnings diff --git a/langtools/test/tools/javac/danglingDep/DepX.out b/langtools/test/tools/javac/danglingDep/DepX.out index 7260f4c18a3..433e1871b92 100644 --- a/langtools/test/tools/javac/danglingDep/DepX.out +++ b/langtools/test/tools/javac/danglingDep/DepX.out @@ -1,2 +1,4 @@ +DepX.java:38:1: compiler.warn.missing.deprecated.annotation - compiler.note.deprecated.filename: RefX.java - compiler.note.deprecated.recompile +1 warning diff --git a/langtools/test/tools/javac/depDocComment/SuppressDepAnnWithSwitchTest.java b/langtools/test/tools/javac/depDocComment/SuppressDepAnnWithSwitchTest.java new file mode 100644 index 00000000000..dbfc6b55011 --- /dev/null +++ b/langtools/test/tools/javac/depDocComment/SuppressDepAnnWithSwitchTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8164073 + * @summary Verify that -Xlint:-dep-ann suppresses warnings. + * @compile -Xlint:-dep-ann -Werror SuppressDepAnnWithSwitchTest.java + */ + +public class SuppressDepAnnWithSwitchTest { + /** @deprecated */ + int f; +} diff --git a/langtools/test/tools/javac/depDocComment/SuppressDeprecation.java b/langtools/test/tools/javac/depDocComment/SuppressDeprecation.java index 4d8849cd579..7968487f129 100644 --- a/langtools/test/tools/javac/depDocComment/SuppressDeprecation.java +++ b/langtools/test/tools/javac/depDocComment/SuppressDeprecation.java @@ -1,10 +1,11 @@ /** * @test /nodynamiccopyright/ - * @bug 4216683 4346296 4656556 4785453 + * @bug 4216683 4346296 4656556 4785453 8164073 * @summary New rules for when deprecation messages are suppressed * @author gafter * * @compile/ref=SuppressDeprecation.out -Xlint:deprecation -XDrawDiagnostics SuppressDeprecation.java + * @compile/ref=SuppressDeprecation8.out -source 8 -Xlint:deprecation -XDrawDiagnostics SuppressDeprecation.java */ /* Test for the contexts in which deprecations warnings should diff --git a/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out b/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out index 4a8b15f33fd..ff1bc124eb0 100644 --- a/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out +++ b/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out @@ -1,8 +1,20 @@ -SuppressDeprecation.java:82:10: compiler.warn.has.been.deprecated: g(), T -SuppressDeprecation.java:83:14: compiler.warn.has.been.deprecated: g(), T -SuppressDeprecation.java:84:9: compiler.warn.has.been.deprecated: var, T -SuppressDeprecation.java:87:9: compiler.warn.has.been.deprecated: T(), T -SuppressDeprecation.java:90:9: compiler.warn.has.been.deprecated: T(int), T -SuppressDeprecation.java:98:1: compiler.warn.has.been.deprecated: T(), T -SuppressDeprecation.java:130:17: compiler.warn.has.been.deprecated: X, compiler.misc.unnamed.package -7 warnings +SuppressDeprecation.java:29:9: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:33:10: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:38:10: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:48:5: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:53:5: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:67:10: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:74:9: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:80:10: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:83:10: compiler.warn.has.been.deprecated: g(), T +SuppressDeprecation.java:84:14: compiler.warn.has.been.deprecated: g(), T +SuppressDeprecation.java:85:9: compiler.warn.has.been.deprecated: var, T +SuppressDeprecation.java:88:9: compiler.warn.has.been.deprecated: T(), T +SuppressDeprecation.java:91:9: compiler.warn.has.been.deprecated: T(int), T +SuppressDeprecation.java:99:1: compiler.warn.has.been.deprecated: T(), T +SuppressDeprecation.java:124:9: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:103:1: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:129:1: compiler.warn.missing.deprecated.annotation +SuppressDeprecation.java:131:17: compiler.warn.has.been.deprecated: X, compiler.misc.unnamed.package +SuppressDeprecation.java:135:1: compiler.warn.missing.deprecated.annotation +19 warnings diff --git a/langtools/test/tools/javac/depDocComment/SuppressDeprecation8.out b/langtools/test/tools/javac/depDocComment/SuppressDeprecation8.out new file mode 100644 index 00000000000..7a12c45d637 --- /dev/null +++ b/langtools/test/tools/javac/depDocComment/SuppressDeprecation8.out @@ -0,0 +1,9 @@ +- compiler.warn.source.no.bootclasspath: 1.8 +SuppressDeprecation.java:83:10: compiler.warn.has.been.deprecated: g(), T +SuppressDeprecation.java:84:14: compiler.warn.has.been.deprecated: g(), T +SuppressDeprecation.java:85:9: compiler.warn.has.been.deprecated: var, T +SuppressDeprecation.java:88:9: compiler.warn.has.been.deprecated: T(), T +SuppressDeprecation.java:91:9: compiler.warn.has.been.deprecated: T(int), T +SuppressDeprecation.java:99:1: compiler.warn.has.been.deprecated: T(), T +SuppressDeprecation.java:131:17: compiler.warn.has.been.deprecated: X, compiler.misc.unnamed.package +8 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1.java b/langtools/test/tools/javac/depOverrides/doccomment/Test1.java index 563492d4d29..571f1ce02ea 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test1.java +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -26,11 +26,11 @@ * @bug 5086088 * @summary check warnings generated when overriding deprecated methods * - * @compile/ref=empty -XDrawDiagnostics -Xlint:deprecation I.java + * @compile/ref=Test1I.out -XDrawDiagnostics -Xlint:deprecation I.java * @compile/ref=Test1A.out -XDrawDiagnostics -Xlint:deprecation A.java * @compile/ref=Test1B.out -XDrawDiagnostics -Xlint:deprecation B.java * @compile/ref=Test1B2.out -XDrawDiagnostics -Xlint:deprecation B2.java - * @compile/ref=empty -XDrawDiagnostics -Xlint:deprecation B3.java + * @compile/ref=Test1B3.out -XDrawDiagnostics -Xlint:deprecation B3.java * @compile/ref=empty -XDrawDiagnostics -Xlint:deprecation Test1.java */ diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1A.out b/langtools/test/tools/javac/depOverrides/doccomment/Test1A.out index 0cbe50c23ae..ef477945691 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test1A.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1A.out @@ -1,4 +1,10 @@ A.java:13:36: compiler.warn.has.been.deprecated: iDep_aUnd_bInh(), I A.java:12:36: compiler.warn.has.been.deprecated: iDep_aUnd_bUnd(), I A.java:11:36: compiler.warn.has.been.deprecated: iDep_aUnd_bDep(), I -3 warnings +A.java:8:36: compiler.warn.missing.deprecated.annotation +A.java:9:36: compiler.warn.missing.deprecated.annotation +A.java:10:36: compiler.warn.missing.deprecated.annotation +A.java:17:36: compiler.warn.missing.deprecated.annotation +A.java:18:36: compiler.warn.missing.deprecated.annotation +A.java:19:36: compiler.warn.missing.deprecated.annotation +9 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1B.out b/langtools/test/tools/javac/depOverrides/doccomment/Test1B.out index a2681b91475..d59496b2961 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test1B.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1B.out @@ -1,4 +1,10 @@ B.java:15:36: compiler.warn.has.been.deprecated: iDep_aInh_bUnd(), I +B.java:8:36: compiler.warn.missing.deprecated.annotation B.java:9:36: compiler.warn.has.been.deprecated: iDep_aDep_bUnd(), A +B.java:11:36: compiler.warn.missing.deprecated.annotation +B.java:14:36: compiler.warn.missing.deprecated.annotation +B.java:17:36: compiler.warn.missing.deprecated.annotation B.java:18:36: compiler.warn.has.been.deprecated: iUnd_aDep_bUnd(), A -3 warnings +B.java:20:36: compiler.warn.missing.deprecated.annotation +B.java:23:36: compiler.warn.missing.deprecated.annotation +9 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1B2.out b/langtools/test/tools/javac/depOverrides/doccomment/Test1B2.out index 12c51462051..17efd646d1b 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test1B2.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1B2.out @@ -2,6 +2,12 @@ B2.java:15:36: compiler.warn.has.been.deprecated: iDep_aInh_bUnd(), I B2.java:7:10: compiler.warn.has.been.deprecated: iDep_aUnd_bInh(), I B2.java:12:36: compiler.warn.has.been.deprecated: iDep_aUnd_bUnd(), I B2.java:9:36: compiler.warn.has.been.deprecated: iDep_aDep_bUnd(), I +B2.java:8:36: compiler.warn.missing.deprecated.annotation B2.java:9:36: compiler.warn.has.been.deprecated: iDep_aDep_bUnd(), A +B2.java:11:36: compiler.warn.missing.deprecated.annotation +B2.java:14:36: compiler.warn.missing.deprecated.annotation +B2.java:17:36: compiler.warn.missing.deprecated.annotation B2.java:18:36: compiler.warn.has.been.deprecated: iUnd_aDep_bUnd(), A -6 warnings +B2.java:20:36: compiler.warn.missing.deprecated.annotation +B2.java:23:36: compiler.warn.missing.deprecated.annotation +12 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1B3.out b/langtools/test/tools/javac/depOverrides/doccomment/Test1B3.out new file mode 100644 index 00000000000..c1bb87237da --- /dev/null +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1B3.out @@ -0,0 +1,8 @@ +B3.java:32:36: compiler.warn.missing.deprecated.annotation +B3.java:35:36: compiler.warn.missing.deprecated.annotation +B3.java:38:36: compiler.warn.missing.deprecated.annotation +B3.java:41:36: compiler.warn.missing.deprecated.annotation +B3.java:44:36: compiler.warn.missing.deprecated.annotation +B3.java:47:36: compiler.warn.missing.deprecated.annotation +B3.java:31:10: compiler.warn.missing.deprecated.annotation +7 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1I.out b/langtools/test/tools/javac/depOverrides/doccomment/Test1I.out new file mode 100644 index 00000000000..67e135cdd7f --- /dev/null +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1I.out @@ -0,0 +1,9 @@ +I.java:30:36: compiler.warn.missing.deprecated.annotation +I.java:31:36: compiler.warn.missing.deprecated.annotation +I.java:32:36: compiler.warn.missing.deprecated.annotation +I.java:33:36: compiler.warn.missing.deprecated.annotation +I.java:34:36: compiler.warn.missing.deprecated.annotation +I.java:35:36: compiler.warn.missing.deprecated.annotation +I.java:36:36: compiler.warn.missing.deprecated.annotation +I.java:37:36: compiler.warn.missing.deprecated.annotation +8 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test2.java b/langtools/test/tools/javac/depOverrides/doccomment/Test2.java index 6595ca22de3..b4fb656a6aa 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test2.java +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -26,7 +26,7 @@ * @bug 5086088 * @summary check warnings generated when overriding deprecated methods * - * @compile/ref=empty -XDrawDiagnostics -Xlint:deprecation P.java + * @compile/ref=Test2P.out -XDrawDiagnostics -Xlint:deprecation P.java * @compile/ref=Test2Q.out -XDrawDiagnostics -Xlint:deprecation Q.java * @compile/ref=Test2R.out -XDrawDiagnostics -Xlint:deprecation R.java * @compile/ref=empty -XDrawDiagnostics -Xlint:deprecation Test2.java diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test2P.out b/langtools/test/tools/javac/depOverrides/doccomment/Test2P.out new file mode 100644 index 00000000000..89147214dce --- /dev/null +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test2P.out @@ -0,0 +1,10 @@ +P.java:30:36: compiler.warn.missing.deprecated.annotation +P.java:31:36: compiler.warn.missing.deprecated.annotation +P.java:32:36: compiler.warn.missing.deprecated.annotation +P.java:33:36: compiler.warn.missing.deprecated.annotation +P.java:34:36: compiler.warn.missing.deprecated.annotation +P.java:35:36: compiler.warn.missing.deprecated.annotation +P.java:36:36: compiler.warn.missing.deprecated.annotation +P.java:37:36: compiler.warn.missing.deprecated.annotation +P.java:38:36: compiler.warn.missing.deprecated.annotation +9 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test2Q.out b/langtools/test/tools/javac/depOverrides/doccomment/Test2Q.out index 3b6f8c487ac..f092f2f4c88 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test2Q.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test2Q.out @@ -1,4 +1,10 @@ +Q.java:8:36: compiler.warn.missing.deprecated.annotation +Q.java:9:36: compiler.warn.missing.deprecated.annotation +Q.java:10:36: compiler.warn.missing.deprecated.annotation Q.java:11:36: compiler.warn.has.been.deprecated: pDep_qUnd_rDep(), P Q.java:12:36: compiler.warn.has.been.deprecated: pDep_qUnd_rUnd(), P Q.java:13:36: compiler.warn.has.been.deprecated: pDep_qUnd_rInh(), P -3 warnings +Q.java:17:36: compiler.warn.missing.deprecated.annotation +Q.java:18:36: compiler.warn.missing.deprecated.annotation +Q.java:19:36: compiler.warn.missing.deprecated.annotation +9 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test2R.out b/langtools/test/tools/javac/depOverrides/doccomment/Test2R.out index 181c583fd82..d3f30728086 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test2R.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test2R.out @@ -1,4 +1,10 @@ +R.java:8:36: compiler.warn.missing.deprecated.annotation R.java:9:36: compiler.warn.has.been.deprecated: pDep_qDep_rUnd(), Q +R.java:11:36: compiler.warn.missing.deprecated.annotation +R.java:14:36: compiler.warn.missing.deprecated.annotation R.java:15:36: compiler.warn.has.been.deprecated: pDep_qInh_rUnd(), P +R.java:17:36: compiler.warn.missing.deprecated.annotation R.java:18:36: compiler.warn.has.been.deprecated: pUnd_qDep_rUnd(), Q -3 warnings +R.java:20:36: compiler.warn.missing.deprecated.annotation +R.java:23:36: compiler.warn.missing.deprecated.annotation +9 warnings diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test3.out b/langtools/test/tools/javac/depOverrides/doccomment/Test3.out index 6d939718fb5..491828e5247 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test3.out +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test3.out @@ -1,2 +1,3 @@ +Test3.java:11:14: compiler.warn.missing.deprecated.annotation Test3.java:18:1: compiler.warn.has.been.deprecated: m(), LibInterface -1 warning +2 warnings diff --git a/langtools/test/tools/javac/lint/Deprecation.out b/langtools/test/tools/javac/lint/Deprecation.out index c16983bc6c1..9ddc2dab48a 100644 --- a/langtools/test/tools/javac/lint/Deprecation.out +++ b/langtools/test/tools/javac/lint/Deprecation.out @@ -1,4 +1,5 @@ -Deprecation.java:14:17: compiler.warn.has.been.deprecated: A, compiler.misc.unnamed.package +Deprecation.java:11:1: compiler.warn.missing.deprecated.annotation - compiler.err.warnings.and.werror +Deprecation.java:14:17: compiler.warn.has.been.deprecated: A, compiler.misc.unnamed.package 1 error -1 warning +2 warnings From 7e27dd569e6edfad3fd673cf0b820b9e0e3a45b2 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Fri, 2 Sep 2016 05:43:54 -0700 Subject: [PATCH 58/99] 8160454: JSR269 jigsaw update: javax.lang.model.element.ModuleElement.getDirectives() causes NPE on unnamed modules Reviewed-by: jjg --- .../com/sun/tools/javac/code/Symbol.java | 5 -- .../com/sun/tools/javac/code/Symtab.java | 12 ++++ .../T8160454/NPEGetDirectivesTest.java | 70 +++++++++++++++++++ 3 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 langtools/test/tools/javac/modules/T8160454/NPEGetDirectivesTest.java diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java index 8757939f626..d99fbeee26e 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java @@ -928,11 +928,6 @@ public abstract class Symbol extends AnnoConstruct implements Element { return msym; } - public ModuleSymbol() { - super(MDL, 0, null, null, null); - this.type = new ModuleType(this); - } - public ModuleSymbol(Name name, Symbol owner) { super(MDL, 0, name, null, owner); this.type = new ModuleType(this); diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java index 034ffda0ad0..339fe486bea 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java @@ -27,6 +27,7 @@ package com.sun.tools.javac.code; import java.util.Collection; import java.util.Collections; +import java.util.EnumSet; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @@ -363,6 +364,17 @@ public class Symtab { // create the basic builtin symbols unnamedModule = new ModuleSymbol(names.empty, null) { + { + directives = List.nil(); + exports = List.nil(); + provides = List.nil(); + uses = List.nil(); + ModuleSymbol java_base = enterModule(names.java_base); + com.sun.tools.javac.code.Directive.RequiresDirective d = + new com.sun.tools.javac.code.Directive.RequiresDirective(java_base, + EnumSet.of(com.sun.tools.javac.code.Directive.RequiresFlag.MANDATED)); + requires = List.of(d); + } @Override public String toString() { return messages.getLocalizedString("compiler.misc.unnamed.module"); diff --git a/langtools/test/tools/javac/modules/T8160454/NPEGetDirectivesTest.java b/langtools/test/tools/javac/modules/T8160454/NPEGetDirectivesTest.java new file mode 100644 index 00000000000..a2538834943 --- /dev/null +++ b/langtools/test/tools/javac/modules/T8160454/NPEGetDirectivesTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8160454 + * @summary JSR269 jigsaw update: javax.lang.model.element.ModuleElement.getDirectives() causes NPE on unnamed modules + * @modules + * jdk.compiler/com.sun.tools.javac.code + * jdk.compiler/com.sun.tools.javac.util + * @compile NPEGetDirectivesTest.java + * @compile -processor NPEGetDirectivesTest NPEGetDirectivesTest.java + */ + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.*; + +import java.util.Set; + +import com.sun.tools.javac.code.Directive.RequiresDirective; +import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.util.Assert; + +import static com.sun.tools.javac.code.Directive.RequiresFlag.MANDATED; + +@SupportedAnnotationTypes("*") +public class NPEGetDirectivesTest extends AbstractProcessor { + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + for (Element e: roundEnv.getRootElements()) { + Element m = e.getEnclosingElement(); + while (!(m instanceof ModuleElement)) { + m = m.getEnclosingElement(); + } + ((ModuleSymbol)m).getDirectives(); + RequiresDirective requiresDirective = ((ModuleSymbol)m).requires.head; + Assert.check(requiresDirective.getDependency().getQualifiedName().toString().equals("java.base")); + Assert.check(requiresDirective.flags.contains(MANDATED)); + } + return false; + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } +} From 925586066cbaa5b63a7af2f180043e60fb876ec1 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 2 Sep 2016 12:38:27 -0700 Subject: [PATCH 59/99] 8165000: Selector.select(timeout) throws IOException when timeout is a large long Clamp the timeout passed to kevent0 to the largest value that does not provoke the error. Reviewed-by: clanger, alanb --- .../native/libnio/ch/KQueueArrayWrapper.c | 12 ++- .../nio/channels/Selector/SelectTimeout.java | 83 +++++++++++++++++++ 2 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 jdk/test/java/nio/channels/Selector/SelectTimeout.java diff --git a/jdk/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c b/jdk/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c index 8fd84347da1..059d9a7badb 100644 --- a/jdk/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c +++ b/jdk/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -123,7 +123,6 @@ Java_sun_nio_ch_KQueueArrayWrapper_register0(JNIEnv *env, jobject this, kevent(kq, changes, 2, errors, 2, &dontBlock); } - JNIEXPORT jint JNICALL Java_sun_nio_ch_KQueueArrayWrapper_kevent0(JNIEnv *env, jobject this, jint kq, jlong kevAddr, jint kevCount, @@ -138,6 +137,15 @@ Java_sun_nio_ch_KQueueArrayWrapper_kevent0(JNIEnv *env, jobject this, jint kq, // Java timeout == -1 : wait forever : timespec timeout of NULL // Java timeout == 0 : return immediately : timespec timeout of zero if (timeout >= 0) { + // For some indeterminate reason kevent(2) has been found to fail with + // an EINVAL error for timeout values greater than or equal to + // 100000001000L. To avoid this problem, clamp the timeout arbitrarily + // to the maximum value of a 32-bit signed integer which is + // approximately 25 days in milliseconds. + const jlong timeoutMax = 0x7fffffff; // java.lang.Integer.MAX_VALUE + if (timeout > timeoutMax) { + timeout = timeoutMax; + } ts.tv_sec = timeout / 1000; ts.tv_nsec = (timeout % 1000) * 1000000; //nanosec = 1 million millisec tsp = &ts; diff --git a/jdk/test/java/nio/channels/Selector/SelectTimeout.java b/jdk/test/java/nio/channels/Selector/SelectTimeout.java new file mode 100644 index 00000000000..aaeff367d84 --- /dev/null +++ b/jdk/test/java/nio/channels/Selector/SelectTimeout.java @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +*/ + +/* + * @test + * @bug 8165000 + * @summary Verify no IOException on OS X for large timeout value in select(). + * @requires (os.family == "mac") + */ +import java.io.IOException; +import java.nio.channels.Selector; + +public class SelectTimeout { + private static final long HUGE_TIMEOUT = 100000001000L; + private static final long SLEEP_MILLIS = 10000; + + private static Exception theException; + + public static void main(String[] args) + throws IOException, InterruptedException { + int failures = 0; + long[] timeouts = + new long[] {0, HUGE_TIMEOUT/2, HUGE_TIMEOUT - 1, HUGE_TIMEOUT}; + for (long t : timeouts) { + if (!test(t)) { + failures++; + } + } + if (failures > 0) { + throw new RuntimeException("Test failed!"); + } else { + System.out.println("Test succeeded"); + } + } + + private static boolean test(final long timeout) + throws InterruptedException, IOException { + theException = null; + + Selector selector = Selector.open(); + + Thread t = new Thread(() -> { + try { + selector.select(timeout); + } catch (IOException ioe) { + theException = ioe; + } + }); + t.start(); + + Thread.currentThread().sleep(SLEEP_MILLIS); + t.interrupt(); + + if (theException == null) { + System.out.printf("Test succeeded with timeout %d%n", timeout); + return true; + } else { + System.err.printf("Test failed with timeout %d%n", timeout); + theException.printStackTrace(); + return false; + } + } +} From 164b17df5b8dd6ecafed975aee5cc938306bdeed Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Sat, 3 Sep 2016 13:43:01 +0300 Subject: [PATCH 60/99] 8165243: Base64.Encoder.wrap(os).write(byte[],int,int) with incorrect arguments should not produce output Reviewed-by: rriggs, alanb, sherman --- .../share/classes/java/util/Base64.java | 4 +- jdk/test/java/util/Base64/TestBase64.java | 169 +++++++++++++----- 2 files changed, 124 insertions(+), 49 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/Base64.java b/jdk/src/java.base/share/classes/java/util/Base64.java index 9a34f279ab3..99f5dc0d993 100644 --- a/jdk/src/java.base/share/classes/java/util/Base64.java +++ b/jdk/src/java.base/share/classes/java/util/Base64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -788,7 +788,7 @@ public class Base64 { public void write(byte[] b, int off, int len) throws IOException { if (closed) throw new IOException("Stream is closed"); - if (off < 0 || len < 0 || off + len > b.length) + if (off < 0 || len < 0 || len > b.length - off) throw new ArrayIndexOutOfBoundsException(); if (len == 0) return; diff --git a/jdk/test/java/util/Base64/TestBase64.java b/jdk/test/java/util/Base64/TestBase64.java index 0c5e27fd9fd..d28f0d0f88a 100644 --- a/jdk/test/java/util/Base64/TestBase64.java +++ b/jdk/test/java/util/Base64/TestBase64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -23,8 +23,11 @@ /** * @test 4235519 8004212 8005394 8007298 8006295 8006315 8006530 8007379 8008925 - * 8014217 8025003 8026330 8028397 8129544 + * 8014217 8025003 8026330 8028397 8129544 8165243 * @summary tests java.util.Base64 + * @library /lib/testlibrary + * @build jdk.testlibrary.* + * @run main TestBase64 * @key randomness */ @@ -35,11 +38,17 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; import java.util.Arrays; +import java.util.ArrayList; import java.util.Base64; +import java.util.List; import java.util.Random; +import jdk.testlibrary.RandomFactory; + public class TestBase64 { + private static final Random rnd = RandomFactory.getRandom(); + public static void main(String args[]) throws Throwable { int numRuns = 10; int numBytes = 200; @@ -52,7 +61,6 @@ public class TestBase64 { test(Base64.getUrlEncoder(), Base64.getUrlDecoder(), numRuns, numBytes); test(Base64.getMimeEncoder(), Base64.getMimeDecoder(), numRuns, numBytes); - Random rnd = new java.util.Random(); byte[] nl_1 = new byte[] {'\n'}; byte[] nl_2 = new byte[] {'\n', '\r'}; byte[] nl_3 = new byte[] {'\n', '\r', '\n'}; @@ -76,7 +84,7 @@ public class TestBase64 { testNull(Base64.getDecoder()); testNull(Base64.getUrlDecoder()); testNull(Base64.getMimeDecoder()); - checkNull(new Runnable() { public void run() { Base64.getMimeEncoder(10, null); }}); + checkNull(() -> Base64.getMimeEncoder(10, null)); testIOE(Base64.getEncoder()); testIOE(Base64.getUrlEncoder()); @@ -84,26 +92,23 @@ public class TestBase64 { testIOE(Base64.getMimeEncoder(10, new byte[]{'\n'})); byte[] src = new byte[1024]; - new Random().nextBytes(src); + rnd.nextBytes(src); final byte[] decoded = Base64.getEncoder().encode(src); testIOE(Base64.getDecoder(), decoded); testIOE(Base64.getMimeDecoder(), decoded); testIOE(Base64.getUrlDecoder(), Base64.getUrlEncoder().encode(src)); // illegal line separator - checkIAE(new Runnable() { public void run() { Base64.getMimeEncoder(10, new byte[]{'\r', 'N'}); }}); + checkIAE(() -> Base64.getMimeEncoder(10, new byte[]{'\r', 'N'})); // malformed padding/ending testMalformedPadding(); // illegal base64 character decoded[2] = (byte)0xe0; - checkIAE(new Runnable() { - public void run() { Base64.getDecoder().decode(decoded); }}); - checkIAE(new Runnable() { - public void run() { Base64.getDecoder().decode(decoded, new byte[1024]); }}); - checkIAE(new Runnable() { public void run() { - Base64.getDecoder().decode(ByteBuffer.wrap(decoded)); }}); + checkIAE(() -> Base64.getDecoder().decode(decoded)); + checkIAE(() -> Base64.getDecoder().decode(decoded, new byte[1024])); + checkIAE(() -> Base64.getDecoder().decode(ByteBuffer.wrap(decoded))); // test single-non-base64 character for mime decoding testSingleNonBase64MimeDec(); @@ -113,12 +118,20 @@ public class TestBase64 { // test mime decoding with ignored character after padding testDecodeIgnoredAfterPadding(); + + // given invalid args, encoder should not produce output + testEncoderKeepsSilence(Base64.getEncoder()); + testEncoderKeepsSilence(Base64.getUrlEncoder()); + testEncoderKeepsSilence(Base64.getMimeEncoder()); + + // given invalid args, decoder should not consume input + testDecoderKeepsAbstinence(Base64.getDecoder()); + testDecoderKeepsAbstinence(Base64.getUrlDecoder()); + testDecoderKeepsAbstinence(Base64.getMimeDecoder()); } private static void test(Base64.Encoder enc, Base64.Decoder dec, int numRuns, int numBytes) throws Throwable { - Random rnd = new java.util.Random(); - enc.encode(new byte[0]); dec.decode(new byte[0]); @@ -258,48 +271,49 @@ public class TestBase64 { private static final String str_null = null; private static final ByteBuffer bb_null = null; - private static void testNull(final Base64.Encoder enc) { - checkNull(new Runnable() { public void run() { enc.encode(ba_null); }}); - checkNull(new Runnable() { public void run() { enc.encodeToString(ba_null); }}); - checkNull(new Runnable() { public void run() { enc.encode(ba_null, new byte[10]); }}); - checkNull(new Runnable() { public void run() { enc.encode(new byte[10], ba_null); }}); - checkNull(new Runnable() { public void run() { enc.encode(bb_null); }}); - checkNull(new Runnable() { public void run() { enc.wrap((OutputStream)null); }}); + private static void testNull(Base64.Encoder enc) { + checkNull(() -> enc.encode(ba_null)); + checkNull(() -> enc.encodeToString(ba_null)); + checkNull(() -> enc.encode(ba_null, new byte[10])); + checkNull(() -> enc.encode(new byte[10], ba_null)); + checkNull(() -> enc.encode(bb_null)); + checkNull(() -> enc.wrap((OutputStream)null)); } - private static void testNull(final Base64.Decoder dec) { - checkNull(new Runnable() { public void run() { dec.decode(ba_null); }}); - checkNull(new Runnable() { public void run() { dec.decode(str_null); }}); - checkNull(new Runnable() { public void run() { dec.decode(ba_null, new byte[10]); }}); - checkNull(new Runnable() { public void run() { dec.decode(new byte[10], ba_null); }}); - checkNull(new Runnable() { public void run() { dec.decode(bb_null); }}); - checkNull(new Runnable() { public void run() { dec.wrap((InputStream)null); }}); + private static void testNull(Base64.Decoder dec) { + checkNull(() -> dec.decode(ba_null)); + checkNull(() -> dec.decode(str_null)); + checkNull(() -> dec.decode(ba_null, new byte[10])); + checkNull(() -> dec.decode(new byte[10], ba_null)); + checkNull(() -> dec.decode(bb_null)); + checkNull(() -> dec.wrap((InputStream)null)); } + @FunctionalInterface private static interface Testable { public void test() throws Throwable; } - private static void testIOE(final Base64.Encoder enc) throws Throwable { + private static void testIOE(Base64.Encoder enc) throws Throwable { ByteArrayOutputStream baos = new ByteArrayOutputStream(8192); - final OutputStream os = enc.wrap(baos); + OutputStream os = enc.wrap(baos); os.write(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9}); os.close(); - checkIOE(new Testable() { public void test() throws Throwable { os.write(10); }}); - checkIOE(new Testable() { public void test() throws Throwable { os.write(new byte[] {10}); }}); - checkIOE(new Testable() { public void test() throws Throwable { os.write(new byte[] {10}, 1, 4); }}); + checkIOE(() -> os.write(10)); + checkIOE(() -> os.write(new byte[] {10})); + checkIOE(() -> os.write(new byte[] {10}, 1, 4)); } - private static void testIOE(final Base64.Decoder dec, byte[] decoded) throws Throwable { + private static void testIOE(Base64.Decoder dec, byte[] decoded) throws Throwable { ByteArrayInputStream bais = new ByteArrayInputStream(decoded); - final InputStream is = dec.wrap(bais); + InputStream is = dec.wrap(bais); is.read(new byte[10]); is.close(); - checkIOE(new Testable() { public void test() throws Throwable { is.read(); }}); - checkIOE(new Testable() { public void test() throws Throwable { is.read(new byte[] {10}); }}); - checkIOE(new Testable() { public void test() throws Throwable { is.read(new byte[] {10}, 1, 4); }}); - checkIOE(new Testable() { public void test() throws Throwable { is.available(); }}); - checkIOE(new Testable() { public void test() throws Throwable { is.skip(20); }}); + checkIOE(() -> is.read()); + checkIOE(() -> is.read(new byte[] {10})); + checkIOE(() -> is.read(new byte[] {10}, 1, 4)); + checkIOE(() -> is.available()); + checkIOE(() -> is.skip(20)); } private static final void checkNull(Runnable r) { @@ -391,13 +405,13 @@ public class TestBase64 { int pos = (Integer)data[i + 2]; // decode(byte[]) - checkIAE(new Runnable() { public void run() { dec.decode(srcBytes); }}); + checkIAE(() -> dec.decode(srcBytes)); // decode(String) - checkIAE(new Runnable() { public void run() { dec.decode(srcStr); }}); + checkIAE(() -> dec.decode(srcStr)); // decode(ByteBuffer) - checkIAE(new Runnable() { public void run() { dec.decode(srcBB); }}); + checkIAE(() -> dec.decode(srcBB)); // wrap stream checkIOE(new Testable() { @@ -412,10 +426,8 @@ public class TestBase64 { // anything left after padding is "invalid"/IAE, if // not MIME. In case of MIME, non-base64 character(s) // is ignored. - checkIAE(new Runnable() { public void run() { - Base64.getDecoder().decode("AA==\u00D2"); }}); - checkIAE(new Runnable() { public void run() { - Base64.getUrlDecoder().decode("AA==\u00D2"); }}); + checkIAE(() -> Base64.getDecoder().decode("AA==\u00D2")); + checkIAE(() -> Base64.getUrlDecoder().decode("AA==\u00D2")); Base64.getMimeDecoder().decode("AA==\u00D2"); } @@ -516,4 +528,67 @@ public class TestBase64 { } return ret; } + + private static void testEncoderKeepsSilence(Base64.Encoder enc) + throws Throwable { + List vals = new ArrayList<>(List.of(Integer.MIN_VALUE, + Integer.MIN_VALUE + 1, -1111, -2, -1, 0, 1, 2, 3, 1111, + Integer.MAX_VALUE - 1, Integer.MAX_VALUE)); + vals.addAll(List.of(rnd.nextInt(), rnd.nextInt(), rnd.nextInt(), + rnd.nextInt())); + byte[] buf = new byte[] {1, 0, 91}; + for (int off : vals) { + for (int len : vals) { + if (off >= 0 && len >= 0 && off <= buf.length - len) { + // valid args, skip them + continue; + } + // invalid args, test them + System.out.println("testing off=" + off + ", len=" + len); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(100); + try (OutputStream os = enc.wrap(baos)) { + os.write(buf, off, len); + throw new RuntimeException("Expected IOOBEx was not thrown"); + } catch (IndexOutOfBoundsException expected) { + } + if (baos.size() > 0) + throw new RuntimeException("No output was expected, but got " + + baos.size() + " bytes"); + } + } + } + + private static void testDecoderKeepsAbstinence(Base64.Decoder dec) + throws Throwable { + List vals = new ArrayList<>(List.of(Integer.MIN_VALUE, + Integer.MIN_VALUE + 1, -1111, -2, -1, 0, 1, 2, 3, 1111, + Integer.MAX_VALUE - 1, Integer.MAX_VALUE)); + vals.addAll(List.of(rnd.nextInt(), rnd.nextInt(), rnd.nextInt(), + rnd.nextInt())); + byte[] buf = new byte[3]; + for (int off : vals) { + for (int len : vals) { + if (off >= 0 && len >= 0 && off <= buf.length - len) { + // valid args, skip them + continue; + } + // invalid args, test them + System.out.println("testing off=" + off + ", len=" + len); + + String input = "AAAAAAAAAAAAAAAAAAAAAA"; + ByteArrayInputStream bais = + new ByteArrayInputStream(input.getBytes("Latin1")); + try (InputStream is = dec.wrap(bais)) { + is.read(buf, off, len); + throw new RuntimeException("Expected IOOBEx was not thrown"); + } catch (IndexOutOfBoundsException expected) { + } + if (bais.available() != input.length()) + throw new RuntimeException("No input should be consumed, " + + "but consumed " + (input.length() - bais.available()) + + " bytes"); + } + } + } } From 5044a0fdc4e29ea83e0f9a0faafdd59545483f82 Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Mon, 5 Sep 2016 10:05:12 +0200 Subject: [PATCH 61/99] 8163181: Further improvements for Unix NetworkInterface native implementation Reviewed-by: chegar, msheppar --- .../unix/native/libnet/NetworkInterface.c | 391 +++++++++--------- 1 file changed, 199 insertions(+), 192 deletions(-) diff --git a/jdk/src/java.base/unix/native/libnet/NetworkInterface.c b/jdk/src/java.base/unix/native/libnet/NetworkInterface.c index 3efde95813a..d5b1824b314 100644 --- a/jdk/src/java.base/unix/native/libnet/NetworkInterface.c +++ b/jdk/src/java.base/unix/native/libnet/NetworkInterface.c @@ -80,6 +80,12 @@ #define DEV_PREFIX "/dev/" #endif +#ifdef LIFNAMSIZ + #define IFNAMESIZE LIFNAMSIZ +#else + #define IFNAMESIZE IFNAMSIZ +#endif + #define CHECKED_MALLOC3(_pointer, _type, _size) \ do { \ _pointer = (_type)malloc(_size); \ @@ -158,7 +164,7 @@ static short translateIPv6AddressToPrefix(struct sockaddr_in6 *addr); static int getIndex(int sock, const char *ifname); static int getFlags(int sock, const char *ifname, int *flags); -static int getMacAddress(JNIEnv *env, int sock, const char *ifname, +static int getMacAddress(JNIEnv *env, const char *ifname, const struct in_addr *addr, unsigned char *buf); static int getMTU(JNIEnv *env, int sock, const char *ifname); @@ -237,20 +243,25 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByName0 const char* name_utf; jobject obj = NULL; + if (name != NULL) { + name_utf = (*env)->GetStringUTFChars(env, name, &isCopy); + } else { + JNU_ThrowNullPointerException(env, "network interface name is NULL"); + return NULL; + } + + if (name_utf == NULL) { + if (!(*env)->ExceptionCheck(env)) + JNU_ThrowOutOfMemoryError(env, NULL); + return NULL; + } + ifs = enumInterfaces(env); if (ifs == NULL) { return NULL; } - name_utf = (*env)->GetStringUTFChars(env, name, &isCopy); - if (name_utf == NULL) { - if (!(*env)->ExceptionCheck(env)) - JNU_ThrowOutOfMemoryError(env, NULL); - freeif(ifs); - return NULL; - } - - // Search the list of interface based on name + // search the list of interfaces based on name curr = ifs; while (curr != NULL) { if (strcmp(name_utf, curr->name) == 0) { @@ -285,12 +296,13 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByIndex0 if (index <= 0) { return NULL; } + ifs = enumInterfaces(env); if (ifs == NULL) { return NULL; } - // Search the list of interface based on index + // search the list of interfaces based on index curr = ifs; while (curr != NULL) { if (index == curr->index) { @@ -304,7 +316,9 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByIndex0 obj = createNetworkInterface(env, curr); } + // release the interface list freeif(ifs); + return obj; } @@ -317,13 +331,11 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifs, *curr; - #if defined(AF_INET6) int family = (getInetAddress_family(env, iaObj) == IPv4) ? AF_INET : AF_INET6; #else int family = AF_INET; #endif - jobject obj = NULL; jboolean match = JNI_FALSE; @@ -342,7 +354,7 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 if (family == addrP->family) { if (family == AF_INET) { int address1 = htonl( - ((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr); + ((struct sockaddr_in *)addrP->addr)->sin_addr.s_addr); int address2 = getInetAddress_addr(env, iaObj); if (address1 == address2) { @@ -350,7 +362,6 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 break; } } - #if defined(AF_INET6) if (family == AF_INET6) { jbyte *bytes = (jbyte *)&( @@ -390,7 +401,9 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 obj = createNetworkInterface(env, curr); } + // release the interface list freeif(ifs); + return obj; } @@ -411,7 +424,7 @@ JNIEXPORT jobjectArray JNICALL Java_java_net_NetworkInterface_getAll return NULL; } - // count the interface + // count the interfaces ifCount = 0; curr = ifs; while (curr != NULL) { @@ -426,8 +439,8 @@ JNIEXPORT jobjectArray JNICALL Java_java_net_NetworkInterface_getAll return NULL; } - // Iterate through the interfaces, create a NetworkInterface instance - // for each array element and populate the object. + // iterate through the interfaces, create a NetworkInterface instance + // for each array element and populate the object curr = ifs; arr_index = 0; while (curr != NULL) { @@ -445,7 +458,9 @@ JNIEXPORT jobjectArray JNICALL Java_java_net_NetworkInterface_getAll curr = curr->next; } + // release the interface list freeif(ifs); + return netIFArr; } @@ -511,46 +526,45 @@ JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0 jbyteArray ret = NULL; unsigned char mac[16]; int len; - int sock; jboolean isCopy; - const char* name_utf; + const char *name_utf; - name_utf = (*env)->GetStringUTFChars(env, name, &isCopy); - if (name_utf == NULL) { - if (!(*env)->ExceptionCheck(env)) - JNU_ThrowOutOfMemoryError(env, NULL); - return NULL; + if (name != NULL) { + name_utf = (*env)->GetStringUTFChars(env, name, &isCopy); + } else { + JNU_ThrowNullPointerException(env, "network interface name is NULL"); + return NULL; } - if ((sock = openSocketWithFallback(env, name_utf)) < 0) { - (*env)->ReleaseStringUTFChars(env, name, name_utf); - return NULL; + + if (name_utf == NULL) { + if (!(*env)->ExceptionCheck(env)) + JNU_ThrowOutOfMemoryError(env, NULL); + return NULL; } if (!IS_NULL(addrArray)) { - (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr); - addr = ((caddr[0]<<24) & 0xff000000); - addr |= ((caddr[1] <<16) & 0xff0000); - addr |= ((caddr[2] <<8) & 0xff00); - addr |= (caddr[3] & 0xff); - iaddr.s_addr = htonl(addr); - len = getMacAddress(env, sock, name_utf, &iaddr, mac); + (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr); + addr = ((caddr[0]<<24) & 0xff000000); + addr |= ((caddr[1] <<16) & 0xff0000); + addr |= ((caddr[2] <<8) & 0xff00); + addr |= (caddr[3] & 0xff); + iaddr.s_addr = htonl(addr); + len = getMacAddress(env, name_utf, &iaddr, mac); } else { - len = getMacAddress(env, sock, name_utf, NULL, mac); + len = getMacAddress(env, name_utf, NULL, mac); } - if (len > 0) { - ret = (*env)->NewByteArray(env, len); - if (IS_NULL(ret)) { - /* we may have memory to free at the end of this */ - goto fexit; - } - (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *)(mac)); - } - fexit: - // release the UTF string and interface list - (*env)->ReleaseStringUTFChars(env, name, name_utf); - close(sock); - return ret; + if (len > 0) { + ret = (*env)->NewByteArray(env, len); + if (!IS_NULL(ret)) { + (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *)(mac)); + } + } + + // release the UTF string and interface list + (*env)->ReleaseStringUTFChars(env, name, name_utf); + + return ret; } /* @@ -562,8 +576,7 @@ JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0 (JNIEnv *env, jclass cls, jstring name, jint index) { jboolean isCopy; - int ret = -1; - int sock; + int sock, ret = -1; const char* name_utf = NULL; if (name != NULL) { @@ -572,15 +585,16 @@ JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0 JNU_ThrowNullPointerException(env, "network interface name is NULL"); return ret; } + if (name_utf == NULL) { - if (!(*env)->ExceptionCheck(env)) - JNU_ThrowOutOfMemoryError(env, NULL); - return ret; + if (!(*env)->ExceptionCheck(env)) + JNU_ThrowOutOfMemoryError(env, NULL); + return ret; } if ((sock = openSocketWithFallback(env, name_utf)) < 0) { - (*env)->ReleaseStringUTFChars(env, name, name_utf); - return JNI_FALSE; + (*env)->ReleaseStringUTFChars(env, name, name_utf); + return JNI_FALSE; } ret = getMTU(env, sock, name_utf); @@ -595,9 +609,8 @@ JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0 static int getFlags0(JNIEnv *env, jstring name) { jboolean isCopy; - int ret, sock; - const char* name_utf; - int flags = 0; + int ret, sock, flags = 0; + const char *name_utf; if (name != NULL) { name_utf = (*env)->GetStringUTFChars(env, name, &isCopy); @@ -607,9 +620,9 @@ static int getFlags0(JNIEnv *env, jstring name) { } if (name_utf == NULL) { - if (!(*env)->ExceptionCheck(env)) - JNU_ThrowOutOfMemoryError(env, NULL); - return -1; + if (!(*env)->ExceptionCheck(env)) + JNU_ThrowOutOfMemoryError(env, NULL); + return -1; } if ((sock = openSocketWithFallback(env, name_utf)) < 0) { (*env)->ReleaseStringUTFChars(env, name, name_utf); @@ -648,7 +661,7 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { netif *childP; jobject tmp; - // Create a NetworkInterface object and populate it + // create a NetworkInterface object and populate it netifObj = (*env)->NewObject(env, ni_class, ni_ctrID); CHECK_NULL_RETURN(netifObj, NULL); name = (*env)->NewStringUTF(env, ifs->name); @@ -659,7 +672,7 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { (*env)->SetBooleanField(env, netifObj, ni_virutalID, ifs->virtual ? JNI_TRUE : JNI_FALSE); - //Count the number of address on this interface + // count the number of addresses on this interface addr_count = 0; addrP = ifs->addr; while (addrP != NULL) { @@ -667,7 +680,7 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { addrP = addrP->next; } - // Create the array of InetAddresses + // create the array of InetAddresses addrArr = (*env)->NewObjectArray(env, addr_count, ia_class, NULL); if (addrArr == NULL) { return NULL; @@ -687,32 +700,31 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { if (addrP->family == AF_INET) { iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID); if (iaObj) { - setInetAddress_addr(env, iaObj, htonl( - ((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr)); + setInetAddress_addr(env, iaObj, htonl( + ((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr)); } else { return NULL; } ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj) { - (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj); - if (addrP->brdcast) { + (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj); + if (addrP->brdcast) { jobject ia2Obj = NULL; ia2Obj = (*env)->NewObject(env, ia4_class, ia4_ctrID); if (ia2Obj) { - setInetAddress_addr(env, ia2Obj, htonl( - ((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr)); - (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj); + setInetAddress_addr(env, ia2Obj, htonl( + ((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr)); + (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj); } else { return NULL; } - } - (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask); - (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj); + } + (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask); + (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj); } else { return NULL; } } - #if defined(AF_INET6) if (addrP->family == AF_INET6) { int scope=0; @@ -748,7 +760,7 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { addrP = addrP->next; } - // See if there is any virtual interface attached to this one. + // see if there is any virtual interface attached to this one. child_count = 0; childP = ifs->childs; while (childP) { @@ -761,17 +773,17 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { return NULL; } - // Create the NetworkInterface instances for the sub-interfaces as well. + // create the NetworkInterface instances for the sub-interfaces as well child_index = 0; childP = ifs->childs; while(childP) { - tmp = createNetworkInterface(env, childP); - if (tmp == NULL) { - return NULL; - } - (*env)->SetObjectField(env, tmp, ni_parentID, netifObj); - (*env)->SetObjectArrayElement(env, childArr, child_index++, tmp); - childP = childP->next; + tmp = createNetworkInterface(env, childP); + if (tmp == NULL) { + return NULL; + } + (*env)->SetObjectField(env, tmp, ni_parentID, netifObj); + (*env)->SetObjectArrayElement(env, childArr, child_index++, tmp); + childP = childP->next; } (*env)->SetObjectField(env, netifObj, ni_addrsID, addrArr); (*env)->SetObjectField(env, netifObj, ni_bindsID, bindArr); @@ -785,46 +797,42 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) { * Enumerates all interfaces */ static netif *enumInterfaces(JNIEnv *env) { - netif *ifs; + netif *ifs = NULL; int sock; - // Enumerate IPv4 addresses sock = openSocket(env, AF_INET); if (sock < 0 && (*env)->ExceptionOccurred(env)) { return NULL; } + // enumerate IPv4 addresses ifs = enumIPv4Interfaces(env, sock, NULL); close(sock); + // return partial list if an exception occurs in the middle of process ??? if (ifs == NULL && (*env)->ExceptionOccurred(env)) { return NULL; } - // return partial list if an exception occurs in the middle of process ??? - // If IPv6 is available then enumerate IPv6 addresses. #if defined(AF_INET6) - // User can disable ipv6 explicitly by -Djava.net.preferIPv4Stack=true, // so we have to call ipv6_available() if (ipv6_available()) { + sock = openSocket(env, AF_INET6); + if (sock < 0 && (*env)->ExceptionOccurred(env)) { + freeif(ifs); + return NULL; + } - sock = openSocket(env, AF_INET6); - if (sock < 0 && (*env)->ExceptionOccurred(env)) { - freeif(ifs); - return NULL; - } + ifs = enumIPv6Interfaces(env, sock, ifs); + close(sock); - ifs = enumIPv6Interfaces(env, sock, ifs); - close(sock); - - if ((*env)->ExceptionOccurred(env)) { - freeif(ifs); - return NULL; - } - - } + if ((*env)->ExceptionOccurred(env)) { + freeif(ifs); + return NULL; + } + } #endif return ifs; @@ -845,7 +853,7 @@ static void freeif(netif *ifs) { addrP = next; } - // Don't forget to free the sub-interfaces. + // don't forget to free the sub-interfaces if (currif->childs != NULL) { freeif(currif->childs); } @@ -863,26 +871,17 @@ static netif *addif(JNIEnv *env, int sock, const char *if_name, netif *ifs, { netif *currif = ifs, *parent; netaddr *addrP; - -#ifdef LIFNAMSIZ - int ifnam_size = LIFNAMSIZ; - char name[LIFNAMSIZ], vname[LIFNAMSIZ]; -#else - int ifnam_size = IFNAMSIZ; - char name[IFNAMSIZ], vname[IFNAMSIZ]; -#endif - + char name[IFNAMESIZE], vname[IFNAMESIZE]; char *name_colonP; int isVirtual = 0; int addr_size; - int flags = 0; // If the interface name is a logical interface then we remove the unit // number so that we have the physical interface (eg: hme0:1 -> hme0). // NetworkInterface currently doesn't have any concept of physical vs. // logical interfaces. - strncpy(name, if_name, ifnam_size); - name[ifnam_size - 1] = '\0'; + strncpy(name, if_name, IFNAMESIZE); + name[IFNAMESIZE - 1] = '\0'; *vname = 0; // Create and populate the netaddr node. If allocation fails @@ -917,20 +916,21 @@ static netif *addif(JNIEnv *env, int sock, const char *if_name, netif *ifs, // Deal with virtual interface with colon notation e.g. eth0:1 name_colonP = strchr(name, ':'); if (name_colonP != NULL) { + int flags = 0; // This is a virtual interface. If we are able to access the parent // we need to create a new entry if it doesn't exist yet *and* update // the 'parent' interface with the new records. *name_colonP = 0; if (getFlags(sock, name, &flags) < 0 || flags < 0) { - // failed to access parent interface do not create parent. - // We are a virtual interface with no parent. - isVirtual = 1; - *name_colonP = ':'; + // failed to access parent interface do not create parent. + // We are a virtual interface with no parent. + isVirtual = 1; + *name_colonP = ':'; } else { - // Got access to parent, so create it if necessary. - // Save original name to vname and truncate name by ':' - memcpy(vname, name, sizeof(vname) ); - vname[name_colonP - name] = ':'; + // Got access to parent, so create it if necessary. + // Save original name to vname and truncate name by ':' + memcpy(vname, name, sizeof(vname)); + vname[name_colonP - name] = ':'; } } @@ -943,12 +943,12 @@ static netif *addif(JNIEnv *env, int sock, const char *if_name, netif *ifs, currif = currif->next; } - // If "new" then create an netif structure and insert it into the list. + // If "new" then create a netif structure and insert it into the list. if (currif == NULL) { - CHECKED_MALLOC3(currif, netif *, sizeof(netif) + ifnam_size); + CHECKED_MALLOC3(currif, netif *, sizeof(netif) + IFNAMESIZE); currif->name = (char *)currif + sizeof(netif); - strncpy(currif->name, name, ifnam_size); - currif->name[ifnam_size - 1] = '\0'; + strncpy(currif->name, name, IFNAMESIZE); + currif->name[IFNAMESIZE - 1] = '\0'; currif->index = getIndex(sock, name); currif->addr = NULL; currif->childs = NULL; @@ -977,13 +977,12 @@ static netif *addif(JNIEnv *env, int sock, const char *if_name, netif *ifs, } if (currif == NULL) { - CHECKED_MALLOC3(currif, netif *, sizeof(netif) + ifnam_size); + CHECKED_MALLOC3(currif, netif *, sizeof(netif) + IFNAMESIZE); currif->name = (char *)currif + sizeof(netif); - strncpy(currif->name, vname, ifnam_size); - currif->name[ifnam_size - 1] = '\0'; + strncpy(currif->name, vname, IFNAMESIZE); + currif->name[IFNAMESIZE - 1] = '\0'; currif->index = getIndex(sock, vname); - currif->addr = NULL; - // Need to duplicate the addr entry? + currif->addr = NULL; // Need to duplicate the addr entry? currif->virtual = 1; currif->childs = NULL; currif->next = parent->childs; @@ -1150,7 +1149,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { struct sockaddr addr, broadaddr, *broadaddrP = NULL; short prefix = 0; - // ignore non IPv4 interfaces + // ignore non IPv4 addresses if (ifreqP->ifr_addr.sa_family != AF_INET) { continue; } @@ -1264,19 +1263,26 @@ static int getIndex(int sock, const char *name) { * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress - (JNIEnv *env, int sock, const char *ifname, const struct in_addr *addr, + (JNIEnv *env, const char *ifname, const struct in_addr *addr, unsigned char *buf) { static struct ifreq ifr; - int i; + int i, sock; + + if ((sock = openSocketWithFallback(env, ifname)) < 0) { + return -1; + } + memset((char *)&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) { JNU_ThrowByNameWithMessageAndLastError (env, JNU_JAVANETPKG "SocketException", "ioctl(SIOCGIFHWADDR) failed"); + close(sock); return -1; } + close(sock); memcpy(buf, &ifr.ifr_hwaddr.sa_data, IFHWADDRLEN); // all bytes to 0 means no hardware address @@ -1388,7 +1394,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { struct sockaddr addr, broadaddr, *broadaddrP = NULL; short prefix = 0; - // ignore non IPv4 interfaces + // ignore non IPv4 addresses if (ifreqP->ifr_addr.sa_family != AF_INET) { continue; } @@ -1444,7 +1450,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { struct ifconf ifc; struct ifreq *ifreqP; - char *buf; + char *buf, *cp, *cplimit; // call SIOCGSIZIFCONF to get size for SIOCGIFCONF buffer if (ioctl(sock, SIOCGSIZIFCONF, &(ifc.ifc_len)) < 0) { @@ -1464,8 +1470,9 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { } // iterate through each interface - char *cp = (char *)ifc.ifc_req; - char *cplimit = cp + ifc.ifc_len; + ifreqP = ifc.ifc_req; + cp = (char *)ifc.ifc_req; + cplimit = cp + ifc.ifc_len; for (; cp < cplimit; cp += (sizeof(ifreqP->ifr_name) + @@ -1474,7 +1481,7 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { ifreqP = (struct ifreq *)cp; short prefix = 0; - // ignore non IPv6 interfaces + // ignore non IPv6 addresses if (ifreqP->ifr_addr.sa_family != AF_INET6) { continue; } @@ -1527,7 +1534,7 @@ static int getIndex(int sock, const char *name) { * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress - (JNIEnv *env, int sock, const char *ifname, const struct in_addr *addr, + (JNIEnv *env, const char *ifname, const struct in_addr *addr, unsigned char *buf) { int size; @@ -1586,20 +1593,20 @@ static int getMTU(JNIEnv *env, int sock, const char *ifname) { } static int getFlags(int sock, const char *ifname, int *flags) { - struct ifreq if2; - memset((char *)&if2, 0, sizeof(if2)); - strncpy(if2.ifr_name, ifname, sizeof(if2.ifr_name) - 1); + struct ifreq if2; + memset((char *)&if2, 0, sizeof(if2)); + strncpy(if2.ifr_name, ifname, sizeof(if2.ifr_name) - 1); - if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0) { - return -1; - } + if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0) { + return -1; + } - if (sizeof(if2.ifr_flags) == sizeof(short)) { - *flags = (if2.ifr_flags & 0xffff); - } else { - *flags = if2.ifr_flags; - } - return 0; + if (sizeof(if2.ifr_flags) == sizeof(short)) { + *flags = (if2.ifr_flags & 0xffff); + } else { + *flags = if2.ifr_flags; + } + return 0; } #endif /* _AIX */ @@ -1668,7 +1675,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { char *buf = NULL; unsigned i; - // call SIOCGLIFNUM to get the size of SIOCGIFCONF buffer + // call SIOCGLIFNUM to get the interface count numifs.lifn_family = AF_INET; numifs.lifn_flags = 0; if (ioctl(sock, SIOCGLIFNUM, (char *)&numifs) < 0) { @@ -1695,7 +1702,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { for (i = 0; i < numifs.lifn_count; i++, ifreqP++) { struct sockaddr addr, *broadaddrP = NULL; - // ignore non IPv4 interfaces + // ignore non IPv4 addresses if (ifreqP->lifr_addr.ss_family != AF_INET) { continue; } @@ -1744,7 +1751,7 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { char *buf = NULL; unsigned i; - // call SIOCGLIFNUM to get the size of SIOCGLIFCONF buffer + // call SIOCGLIFNUM to get the interface count numifs.lifn_family = AF_INET6; numifs.lifn_flags = 0; if (ioctl(sock, SIOCGLIFNUM, (char *)&numifs) < 0) { @@ -1770,7 +1777,7 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { ifreqP = ifc.lifc_req; for (i = 0; i < numifs.lifn_count; i++, ifreqP++) { - // ignore non IPv6 interfaces + // ignore non IPv6 addresses if (ifreqP->lifr_addr.ss_family != AF_INET6) { continue; } @@ -1789,7 +1796,7 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { free(buf); return ifs; } - } + } // free buffer free(buf); @@ -1834,9 +1841,9 @@ static int getMacFromDevice strcpy(style1dev, DEV_PREFIX); strcat(style1dev, ifname); if ((fd = open(style1dev, O_RDWR)) < 0) { - // Can't open it. We probably are missing the privilege. - // We'll have to try something else - return 0; + // Can't open it. We probably are missing the privilege. + // We'll have to try something else + return 0; } dlpareq.dl_primitive = DL_PHYS_ADDR_REQ; @@ -1878,11 +1885,15 @@ static int getMacFromDevice * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress - (JNIEnv *env, int sock, const char *ifname, const struct in_addr *addr, + (JNIEnv *env, const char *ifname, const struct in_addr *addr, unsigned char *buf) { struct lifreq if2; - int len, i; + int len, i, sock; + + if ((sock = openSocketWithFallback(env, ifname)) < 0) { + return -1; + } // First, try the new (S11) SIOCGLIFHWADDR ioctl(). If that fails // try the old way. @@ -1893,40 +1904,36 @@ static int getMacAddress struct sockaddr_dl *sp; sp = (struct sockaddr_dl *)&if2.lifr_addr; memcpy(buf, &sp->sdl_data[0], sp->sdl_alen); + close(sock); return sp->sdl_alen; } // On Solaris we have to use DLPI, but it will only work if we have // privileged access (i.e. root). If that fails, we try a lookup // in the ARP table, which requires an IPv4 address. - if ((len = getMacFromDevice(env, ifname, buf)) == 0) { - // DLPI failed - trying to do arp lookup - + if (((len = getMacFromDevice(env, ifname, buf)) == 0) && (addr != NULL)) { struct arpreq arpreq; struct sockaddr_in *sin; struct sockaddr_in ipAddr; - if (addr == NULL) { - // No IPv4 address for that interface, so can't do an ARP lookup. - return -1; - } + len = 6; //??? - len = 6; //??? + sin = (struct sockaddr_in *)&arpreq.arp_pa; + memset((char *)&arpreq, 0, sizeof(struct arpreq)); + ipAddr.sin_port = 0; + ipAddr.sin_family = AF_INET; + memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr)); + memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); + arpreq.arp_flags= ATF_PUBL; - sin = (struct sockaddr_in *)&arpreq.arp_pa; - memset((char *)&arpreq, 0, sizeof(struct arpreq)); - ipAddr.sin_port = 0; - ipAddr.sin_family = AF_INET; - memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr)); - memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in)); - arpreq.arp_flags= ATF_PUBL; + if (ioctl(sock, SIOCGARP, &arpreq) < 0) { + close(sock); + return -1; + } - if (ioctl(sock, SIOCGARP, &arpreq) < 0) { - return -1; - } - - memcpy(buf, &arpreq.arp_ha.sa_data[0], len); + memcpy(buf, &arpreq.arp_ha.sa_data[0], len); } + close(sock); // all bytes to 0 means no hardware address for (i = 0; i < len; i++) { @@ -2014,7 +2021,7 @@ static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { for (ifa = origifa; ifa != NULL; ifa = ifa->ifa_next) { struct sockaddr *broadaddrP = NULL; - // ignore non IPv4 interfaces + // ignore non IPv4 addresses if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_INET) continue; @@ -2058,7 +2065,7 @@ static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { } for (ifa = origifa; ifa != NULL; ifa = ifa->ifa_next) { - // ignore non IPv6 interfaces + // ignore non IPv6 addresses if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2113,22 +2120,22 @@ static int getIndex(int sock, const char *name) { * MAC address. Returns -1 if there is no hardware address on that interface. */ static int getMacAddress - (JNIEnv *env, int sock, const char *ifname, const struct in_addr *addr, + (JNIEnv *env, const char *ifname, const struct in_addr *addr, unsigned char *buf) { struct ifaddrs *ifa0, *ifa; struct sockaddr *saddr; int i; - // Grab the interface list + // grab the interface list if (!getifaddrs(&ifa0)) { - // Cycle through the interfaces + // cycle through the interfaces for (i = 0, ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next, i++) { saddr = ifa->ifa_addr; - // Link layer contains the MAC address + // link layer contains the MAC address if (saddr->sa_family == AF_LINK && !strcmp(ifname, ifa->ifa_name)) { struct sockaddr_dl *sadl = (struct sockaddr_dl *) saddr; - // Check the address is the correct length + // check the address has the correct length if (sadl->sdl_alen == ETHER_ADDR_LEN) { memcpy(buf, (sadl->sdl_data + sadl->sdl_nlen), ETHER_ADDR_LEN); freeifaddrs(ifa0); From da68b22b6a65458ca17b6ee2b51bb911a4bb72d4 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 5 Sep 2016 10:10:29 +0200 Subject: [PATCH 62/99] 8165314: Javac server process left running if build fails on Windows Reviewed-by: tbell, wetmore --- make/Init.gmk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make/Init.gmk b/make/Init.gmk index 6ed612b28a2..15ae487555c 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -314,6 +314,9 @@ else # HAS_SPEC=true endif on-failure: + $(call CleanupSmartJavac) + $(call StopGlobalTimer) + $(call ReportBuildTimes) $(call PrintFailureReports) $(call PrintBuildLogFailures) $(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n" From d356b8d0850647010912ee7cf685916024626f94 Mon Sep 17 00:00:00 2001 From: Amit Sapre Date: Tue, 6 Sep 2016 13:57:03 +0530 Subject: [PATCH 63/99] 8164730: Make it clear that 'cl' parameter passed to RMIConnector.OISWL is never null Added checks inside constructor of ObjectInputStreamWithLoader inner class. Test case added. Reviewed-by: dfuchs, alanb --- .../management/remote/rmi/RMIConnector.java | 10 ++- ...ectInputStreamWithLoaderNullCheckTest.java | 84 +++++++++++++++++++ 2 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 jdk/test/javax/management/remote/mandatory/connection/ObjectInputStreamWithLoaderNullCheckTest.java diff --git a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java index cbf32ee5834..93a5c7cbdd1 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -64,6 +64,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.WeakHashMap; import java.util.stream.Collectors; @@ -1851,8 +1852,11 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable private static final class ObjectInputStreamWithLoader extends ObjectInputStream { ObjectInputStreamWithLoader(InputStream in, ClassLoader cl) - throws IOException { + throws IOException, IllegalArgumentException { super(in); + if (cl == null ) { + throw new IllegalArgumentException("class loader is null"); + } this.loader = cl; } @@ -1861,7 +1865,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable throws IOException, ClassNotFoundException { String name = classDesc.getName(); ReflectUtil.checkPackageAccess(name); - return Class.forName(name, false, loader); + return Class.forName(name, false, Objects.requireNonNull(loader)); } private final ClassLoader loader; diff --git a/jdk/test/javax/management/remote/mandatory/connection/ObjectInputStreamWithLoaderNullCheckTest.java b/jdk/test/javax/management/remote/mandatory/connection/ObjectInputStreamWithLoaderNullCheckTest.java new file mode 100644 index 00000000000..44a59113732 --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/ObjectInputStreamWithLoaderNullCheckTest.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8009560 + * @summary Test RMIConnector.ObjectInputStreamWithLoader constructor with + * null Class loader. The test expects a IllegalArgumentException + * thrown when constructor is invoked with null class loader as + * an argument. + * @author Amit Sapre + * @modules java.management + * @run clean ObjectInputStreamWithLoaderNullCheckTest + * @run build ObjectInputStreamWithLoaderNullCheckTest + * @run main ObjectInputStreamWithLoaderNullCheckTest + */ + +import java.lang.reflect.*; +import javax.management.remote.*; +import javax.management.remote.rmi.*; +import java.io.*; + +public class ObjectInputStreamWithLoaderNullCheckTest { + + private static Class innerClass; + + public static void main(String[] args) throws Exception { + + System.out.println(">> == ObjectInputStreamWithLoaderNullCheckTest started..."); + + try { + innerClass = Class.forName("javax.management.remote.rmi.RMIConnector$ObjectInputStreamWithLoader"); + Constructor ctor = innerClass.getDeclaredConstructor(InputStream.class,ClassLoader.class); + ctor.setAccessible(true); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutput objOut = new ObjectOutputStream(baos); + objOut.writeObject(new String("Serialize")); + objOut.close(); + baos.close(); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + + System.out.println(">> == Testing constructor with null class loader."); + Object obj = ctor.newInstance(bais,null); + + System.out.println(">> == Test case failed. No error occured"); + System.exit(1); + } catch (InvocationTargetException ex) { + Throwable cause = ex.getCause(); + System.out.println(">> == InvocationTargetException Cause message : " + cause.toString()); + if (cause instanceof IllegalArgumentException) { + System.out.println(">> == Test case Passed."); + } else { + System.out.println(">> == Test case Failed."); + ex.printStackTrace(); + System.exit(1); + } + } catch (Exception ex) { + System.out.println(">>> == Test case failed with error " + ex.getCause().getMessage()); + ex.printStackTrace(); + System.exit(1); + } + } +} From 09e25d0d1f577e1106fe43d26eea1e65326d2581 Mon Sep 17 00:00:00 2001 From: Vyom Tewari Date: Tue, 6 Sep 2016 14:11:12 +0530 Subject: [PATCH 64/99] 8131061: Use of -Dcom.sun.management.snmp needs to be examined for modules Reviewed-by: mchung, dfuchs --- .../share/classes/module-info.java | 3 +- .../share/classes/sun/management/Agent.java | 53 ++++++----- .../sun/management/spi/AgentProvider.java | 92 +++++++++++++++++++ 3 files changed, 120 insertions(+), 28 deletions(-) create mode 100644 jdk/src/java.management/share/classes/sun/management/spi/AgentProvider.java diff --git a/jdk/src/java.management/share/classes/module-info.java b/jdk/src/java.management/share/classes/module-info.java index 6772da9d8ee..54ccb16107a 100644 --- a/jdk/src/java.management/share/classes/module-info.java +++ b/jdk/src/java.management/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -50,6 +50,7 @@ module java.management { uses javax.management.remote.JMXConnectorProvider; uses javax.management.remote.JMXConnectorServerProvider; uses sun.management.spi.PlatformMBeanProvider; + uses sun.management.spi.AgentProvider; provides javax.security.auth.spi.LoginModule with com.sun.jmx.remote.security.FileLoginModule; diff --git a/jdk/src/java.management/share/classes/sun/management/Agent.java b/jdk/src/java.management/share/classes/sun/management/Agent.java index be68601ce0e..fbc80433793 100644 --- a/jdk/src/java.management/share/classes/sun/management/Agent.java +++ b/jdk/src/java.management/share/classes/sun/management/Agent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -31,17 +31,19 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.lang.management.ManagementFactory; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.UnknownHostException; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; +import java.util.ServiceLoader; import java.util.function.Function; import java.util.function.Predicate; @@ -53,6 +55,7 @@ import sun.management.jmxremote.ConnectorBootstrap; import sun.management.jdp.JdpController; import sun.management.jdp.JdpException; import jdk.internal.vm.VMSupport; +import sun.management.spi.AgentProvider; /** * This Agent is started by the VM when -Dcom.sun.management.snmp or @@ -248,8 +251,8 @@ public class Agent { "com.sun.management.enableThreadContentionMonitoring"; private static final String LOCAL_CONNECTOR_ADDRESS_PROP = "com.sun.management.jmxremote.localConnectorAddress"; - private static final String SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME = - "sun.management.snmp.AdaptorBootstrap"; + private static final String SNMP_AGENT_NAME = + "SnmpAgent"; private static final String JDP_DEFAULT_ADDRESS = "224.0.23.178"; private static final int JDP_DEFAULT_PORT = 7095; @@ -429,7 +432,7 @@ public class Agent { try { if (snmpPort != null) { - loadSnmpAgent(snmpPort, props); + loadSnmpAgent(props); } /* @@ -554,28 +557,24 @@ public class Agent { return mgmtProps; } - private static void loadSnmpAgent(String snmpPort, Properties props) { - try { - // invoke the following through reflection: - // AdaptorBootstrap.initialize(snmpPort, props); - final Class adaptorClass = - Class.forName(SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME, true, null); - final Method initializeMethod = - adaptorClass.getMethod("initialize", - String.class, Properties.class); - initializeMethod.invoke(null, snmpPort, props); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException x) { - // snmp runtime doesn't exist - initialization fails - throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT, x); - } catch (InvocationTargetException x) { - final Throwable cause = x.getCause(); - if (cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } else if (cause instanceof Error) { - throw (Error) cause; - } - // should not happen... - throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT, cause); + private static void loadSnmpAgent(Properties props) { + /* + * Load the jdk.snmp service + */ + AgentProvider provider = AccessController.doPrivileged( + (PrivilegedAction) () -> { + for(AgentProvider aProvider : ServiceLoader.loadInstalled(AgentProvider.class)) { + if(aProvider.getName().equals(SNMP_AGENT_NAME)) + return aProvider; + } + return null; + }, null + ); + + if (provider != null) { + provider.startAgent(props); + } else { // snmp runtime doesn't exist - initialization fails + throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT); } } diff --git a/jdk/src/java.management/share/classes/sun/management/spi/AgentProvider.java b/jdk/src/java.management/share/classes/sun/management/spi/AgentProvider.java new file mode 100644 index 00000000000..f68343acacb --- /dev/null +++ b/jdk/src/java.management/share/classes/sun/management/spi/AgentProvider.java @@ -0,0 +1,92 @@ +/* + * 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. 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. + */ +package sun.management.spi; + +import java.util.Properties; + +/** + * Service interface for management agent + */ +public abstract class AgentProvider { + + /** + * Instantiates a new AgentProvider. + * + * @throws SecurityException if the subclass (and calling code) does not + * have + * {@code RuntimePermission("sun.management.spi.AgentProvider.subclass")} + */ + protected AgentProvider() { + this(checkSubclassPermission()); + } + + private AgentProvider(Void unused) { + } + + private static Void checkSubclassPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new RuntimePermission(AgentProvider.class.getName() + ".subclass")); + } + return null; + } + + /** + * Gets the name of the agent provider. + * + * @return name of agent provider + */ + public abstract String getName(); + + /** + * Initializes and starts the agent. + * + * @throws IllegalStateException if this agent has already been started. + */ + public abstract void startAgent(); + + /** + * Initializes and starts the agent at given port and with given properties + * + * @param props environment variables for agent + * + * @throws IllegalStateException if this agent has already been started. + */ + public abstract void startAgent(Properties props); + + /** + * Checks if agent is started and not terminated. + * + * @return true if agent is running, false otherwise. + */ + public abstract boolean isActive(); + + /** + * Stops this agent. + * + * @throws IllegalStateException if this agent is not started. + */ + public abstract void stopAgent(); +} From 4814f397b23a5f2fb34593faf7bbd46e598f94aa Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 6 Sep 2016 12:51:40 +0200 Subject: [PATCH 65/99] 8161376: Introduce -Xlint:exports Adding -Xlint:exports, currently not doing anything. Functionality will be added separatelly under JDK-8153362. Reviewed-by: jjg --- .../share/classes/com/sun/tools/javac/code/Lint.java | 5 +++++ .../classes/com/sun/tools/javac/resources/javac.properties | 3 +++ 2 files changed, 8 insertions(+) diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java index d5480816c34..ddd61d65615 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java @@ -165,6 +165,11 @@ public class Lint */ EMPTY("empty"), + /** + * Warn about issues regarding module exports. + */ + EXPORTS("exports"), + /** * Warn about falling through from one case of a switch statement to the next. */ diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties index 05874ad9087..44634e703e0 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties @@ -192,6 +192,9 @@ javac.opt.Xlint.desc.divzero=\ javac.opt.Xlint.desc.empty=\ Warn about empty statement after if. +javac.opt.Xlint.desc.exports=\ + Warn about issues regarding module exports. + javac.opt.Xlint.desc.fallthrough=\ Warn about falling through from one case of a switch statement to the next. From 0f792063c19c848b7b9eec3f0f753eed84f57758 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Tue, 6 Sep 2016 18:16:56 +0530 Subject: [PATCH 66/99] 8163952: jlink exclude VM plugin does not support static libraries Reviewed-by: jlaskey --- .../internal/plugins/ExcludeVMPlugin.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java index df824856282..549b6abfd54 100644 --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java @@ -99,9 +99,13 @@ public final class ExcludeVMPlugin implements Plugin { * e.g.: /java.base/native/amd64/server/libjvm.so * /java.base/native/server/libjvm.dylib */ - private List getVMs(ResourcePoolModule javaBase, String jvmlib) { + private List getVMs(ResourcePoolModule javaBase, String[] jvmlibs) { List ret = javaBase.entries().filter((t) -> { - return t.path().endsWith("/" + jvmlib); + String path = t.path(); + for (String jvmlib : jvmlibs) { + return t.path().endsWith("/" + jvmlib); + } + return false; }).collect(Collectors.toList()); return ret; } @@ -109,18 +113,21 @@ public final class ExcludeVMPlugin implements Plugin { @Override public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) { ResourcePoolModule javaBase = in.moduleView().findModule("java.base").get(); - String jvmlib = jvmlib(javaBase.descriptor().osName().get()); + String[] jvmlibs = jvmlibs(javaBase.descriptor().osName().get()); TreeSet existing = new TreeSet<>(new JvmComparator()); TreeSet removed = new TreeSet<>(new JvmComparator()); if (!keepAll) { // First retrieve all available VM names and removed VM - List jvms = getVMs(javaBase, jvmlib); + List jvms = getVMs(javaBase, jvmlibs); for (Jvm jvm : Jvm.values()) { for (ResourcePoolEntry md : jvms) { - if (md.path().endsWith("/" + jvm.getName() + "/" + jvmlib)) { - existing.add(jvm); - if (isRemoved(md)) { - removed.add(jvm); + String mdPath = md.path(); + for (String jvmlib : jvmlibs) { + if (mdPath.endsWith("/" + jvm.getName() + "/" + jvmlib)) { + existing.add(jvm); + if (isRemoved(md)) { + removed.add(jvm); + } } } } @@ -248,14 +255,14 @@ public final class ExcludeVMPlugin implements Plugin { return orig.copyWithContent(content); } - private static String jvmlib(String osName) { - String lib = "libjvm.so"; + private static String[] jvmlibs(String osName) { if (isWindows(osName)) { - lib = "jvm.dll"; + return new String[] { "jvm.dll" }; } else if (isMac(osName)) { - lib = "libjvm.dylib"; + return new String[] { "libjvm.dylib", "libjvm.a" }; + } else { + return new String[] { "libjvm.so", "libjvm.a" }; } - return lib; } private static boolean isWindows(String osName) { From 3228ea809cd2da0570615920583d40392f71fdb9 Mon Sep 17 00:00:00 2001 From: Alan Burlison Date: Tue, 6 Sep 2016 13:09:29 -0400 Subject: [PATCH 67/99] 8161360: Deprecated vfork() should not be used on Solaris Reviewed-by: rriggs, dsamersoff --- jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c index 3408bdd9762..27230858253 100644 --- a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c +++ b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c @@ -349,6 +349,8 @@ static int copystrings(char *buf, int offset, const char * const *arg) { __attribute_noinline__ #endif +/* vfork(2) is deprecated on Solaris */ +#ifndef __solaris__ static pid_t vforkChild(ChildStuff *c) { volatile pid_t resultPid; @@ -367,6 +369,7 @@ vforkChild(ChildStuff *c) { assert(resultPid != 0); /* childProcess never returns */ return resultPid; } +#endif static pid_t forkChild(ChildStuff *c) { @@ -479,8 +482,11 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) static pid_t startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) { switch (c->mode) { +/* vfork(2) is deprecated on Solaris */ +#ifndef __solaris__ case MODE_VFORK: return vforkChild(c); +#endif case MODE_FORK: return forkChild(c); #if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX) From 9aa36236bebb5db7fb95293a4c4eec8f6f4611dc Mon Sep 17 00:00:00 2001 From: Alexandre Iline Date: Tue, 6 Sep 2016 17:07:06 -0400 Subject: [PATCH 68/99] 8148859: Fix module dependences for java/time tests Reviewed-by: alanb, rriggs --- jdk/test/java/time/TEST.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/test/java/time/TEST.properties b/jdk/test/java/time/TEST.properties index f480a511913..82224020e8e 100644 --- a/jdk/test/java/time/TEST.properties +++ b/jdk/test/java/time/TEST.properties @@ -1,4 +1,6 @@ # Threeten test uses TestNG TestNG.dirs = . othervm.dirs = tck/java/time/chrono test/java/time/chrono test/java/time/format +modules = jdk.localedata lib.dirs = ../../lib/testlibrary +lib.build = jdk.testlibrary.RandomFactory From 97fa8cd04e629e51aaf66ff26465ad1543d30724 Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Tue, 6 Sep 2016 16:08:54 -0700 Subject: [PATCH 69/99] 8159404: throw UnsupportedOperationException unconditionally for mutator methods Reviewed-by: martin, psandoz --- .../java/util/ImmutableCollections.java | 68 +++++++++-- .../share/classes/java/util/List.java | 3 +- .../share/classes/java/util/Map.java | 3 +- .../share/classes/java/util/Set.java | 3 +- jdk/test/java/util/Collection/MOAT.java | 111 +++++++++++++++++- 5 files changed, 173 insertions(+), 15 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java b/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java index 8414311e425..494dce83a89 100644 --- a/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java +++ b/jdk/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -31,6 +31,10 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamException; import java.io.Serializable; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.UnaryOperator; /** * Container class for immutable collections. Not part of the public API. @@ -61,9 +65,25 @@ class ImmutableCollections { */ static final double EXPAND_FACTOR = 2.0; + static UnsupportedOperationException uoe() { return new UnsupportedOperationException(); } + // ---------- List Implementations ---------- - static final class List0 extends AbstractList implements RandomAccess, Serializable { + abstract static class AbstractImmutableList extends AbstractList + implements RandomAccess, Serializable { + @Override public boolean add(E e) { throw uoe(); } + @Override public boolean addAll(Collection c) { throw uoe(); } + @Override public boolean addAll(int index, Collection c) { throw uoe(); } + @Override public void clear() { throw uoe(); } + @Override public boolean remove(Object o) { throw uoe(); } + @Override public boolean removeAll(Collection c) { throw uoe(); } + @Override public boolean removeIf(Predicate filter) { throw uoe(); } + @Override public void replaceAll(UnaryOperator operator) { throw uoe(); } + @Override public boolean retainAll(Collection c) { throw uoe(); } + @Override public void sort(Comparator c) { throw uoe(); } + } + + static final class List0 extends AbstractImmutableList { List0() { } @Override @@ -86,7 +106,7 @@ class ImmutableCollections { } } - static final class List1 extends AbstractList implements RandomAccess, Serializable { + static final class List1 extends AbstractImmutableList { private final E e0; List1(E e0) { @@ -114,7 +134,7 @@ class ImmutableCollections { } } - static final class List2 extends AbstractList implements RandomAccess, Serializable { + static final class List2 extends AbstractImmutableList { private final E e0; private final E e1; @@ -147,7 +167,7 @@ class ImmutableCollections { } } - static final class ListN extends AbstractList implements RandomAccess, Serializable { + static final class ListN extends AbstractImmutableList { private final E[] elements; @SafeVarargs @@ -183,7 +203,17 @@ class ImmutableCollections { // ---------- Set Implementations ---------- - static final class Set0 extends AbstractSet implements Serializable { + abstract static class AbstractImmutableSet extends AbstractSet implements Serializable { + @Override public boolean add(E e) { throw uoe(); } + @Override public boolean addAll(Collection c) { throw uoe(); } + @Override public void clear() { throw uoe(); } + @Override public boolean remove(Object o) { throw uoe(); } + @Override public boolean removeAll(Collection c) { throw uoe(); } + @Override public boolean removeIf(Predicate filter) { throw uoe(); } + @Override public boolean retainAll(Collection c) { throw uoe(); } + } + + static final class Set0 extends AbstractImmutableSet { Set0() { } @Override @@ -210,7 +240,7 @@ class ImmutableCollections { } } - static final class Set1 extends AbstractSet implements Serializable { + static final class Set1 extends AbstractImmutableSet { private final E e0; Set1(E e0) { @@ -241,7 +271,7 @@ class ImmutableCollections { } } - static final class Set2 extends AbstractSet implements Serializable { + static final class Set2 extends AbstractImmutableSet { private final E e0; private final E e1; @@ -312,7 +342,7 @@ class ImmutableCollections { * least one null is always present. * @param the element type */ - static final class SetN extends AbstractSet implements Serializable { + static final class SetN extends AbstractImmutableSet { private final E[] elements; private final int size; @@ -403,7 +433,23 @@ class ImmutableCollections { // ---------- Map Implementations ---------- - static final class Map0 extends AbstractMap implements Serializable { + abstract static class AbstractImmutableMap extends AbstractMap implements Serializable { + @Override public void clear() { throw uoe(); } + @Override public V compute(K key, BiFunction rf) { throw uoe(); } + @Override public V computeIfAbsent(K key, Function mf) { throw uoe(); } + @Override public V computeIfPresent(K key, BiFunction rf) { throw uoe(); } + @Override public V merge(K key, V value, BiFunction rf) { throw uoe(); } + @Override public V put(K key, V value) { throw uoe(); } + @Override public void putAll(Map m) { throw uoe(); } + @Override public V putIfAbsent(K key, V value) { throw uoe(); } + @Override public V remove(Object key) { throw uoe(); } + @Override public boolean remove(Object key, Object value) { throw uoe(); } + @Override public V replace(K key, V value) { throw uoe(); } + @Override public boolean replace(K key, V oldValue, V newValue) { throw uoe(); } + @Override public void replaceAll(BiFunction f) { throw uoe(); } + } + + static final class Map0 extends AbstractImmutableMap { Map0() { } @Override @@ -430,7 +476,7 @@ class ImmutableCollections { } } - static final class Map1 extends AbstractMap implements Serializable { + static final class Map1 extends AbstractImmutableMap { private final K k0; private final V v0; @@ -472,7 +518,7 @@ class ImmutableCollections { * @param the key type * @param the value type */ - static final class MapN extends AbstractMap implements Serializable { + static final class MapN extends AbstractImmutableMap { private final Object[] table; // pairs of key, value private final int size; // number of pairs diff --git a/jdk/src/java.base/share/classes/java/util/List.java b/jdk/src/java.base/share/classes/java/util/List.java index 3819d94e831..8e97c2ea259 100644 --- a/jdk/src/java.base/share/classes/java/util/List.java +++ b/jdk/src/java.base/share/classes/java/util/List.java @@ -94,7 +94,8 @@ import java.util.function.UnaryOperator; * *