# HG changeset patch # User mlarsson # Date 1461897848 -7200 # Node ID 1ad0239b6e4a21f352e751526e5df9d8f1682fe0 # Parent 04da6a12ab0dcebf2982f311992dddaf3381abf6# Parent c576864b47767d4d8813ef00205e4b098aeebcfb Merge diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/compiler/directivesParser.cpp --- a/hotspot/src/share/vm/compiler/directivesParser.cpp Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp Fri Apr 29 04:44:08 2016 +0200 @@ -57,7 +57,7 @@ } int DirectivesParser::parse_string(const char* text, outputStream* st) { - DirectivesParser cd(text, st); + DirectivesParser cd(text, st, false); if (cd.valid()) { return cd.install_directives(); } else { @@ -132,8 +132,8 @@ } } -DirectivesParser::DirectivesParser(const char* text, outputStream* st) -: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL), _tmp_depth(0) { +DirectivesParser::DirectivesParser(const char* text, outputStream* st, bool silent) +: JSON(text, silent, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL), _tmp_depth(0) { #ifndef PRODUCT memset(stack, 0, MAX_DEPTH * sizeof(stack[0])); #endif @@ -594,7 +594,7 @@ #ifndef PRODUCT void DirectivesParser::test(const char* text, bool should_pass) { - DirectivesParser cd(text, tty); + DirectivesParser cd(text, tty, !VerboseInternalVMTests); if (should_pass) { assert(cd.valid() == true, "failed on a valid DirectivesParser string"); if (VerboseInternalVMTests) { diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/compiler/directivesParser.hpp --- a/hotspot/src/share/vm/compiler/directivesParser.hpp Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/compiler/directivesParser.hpp Fri Apr 29 04:44:08 2016 +0200 @@ -55,7 +55,7 @@ int install_directives(); private: - DirectivesParser(const char* text, outputStream* st); + DirectivesParser(const char* text, outputStream* st, bool silent); ~DirectivesParser(); bool callback(JSON_TYPE t, JSON_VAL* v, uint level); diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/memory/heapInspection.cpp --- a/hotspot/src/share/vm/memory/heapInspection.cpp Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/memory/heapInspection.cpp Fri Apr 29 04:44:08 2016 +0200 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoaderData.hpp" +#include "classfile/moduleEntry.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/genCollectedHeap.hpp" @@ -105,10 +106,20 @@ ResourceMark rm; // simplify the formatting (ILP32 vs LP64) - always cast the numbers to 64-bit - st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s", - (int64_t)_instance_count, - (uint64_t)_instance_words * HeapWordSize, - name()); + ModuleEntry* module = _klass->module(); + if (module->is_named()) { + st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s (%s@%s)", + (int64_t)_instance_count, + (uint64_t)_instance_words * HeapWordSize, + name(), + module->name()->as_C_string(), + module->version() != NULL ? module->version()->as_C_string() : ""); + } else { + st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s", + (int64_t)_instance_count, + (uint64_t)_instance_words * HeapWordSize, + name()); + } } KlassInfoEntry* KlassInfoBucket::lookup(Klass* const k) { @@ -647,8 +658,8 @@ if (print_stats) { print_class_stats(st, csv_format, columns); } else { - st->print_cr(" num #instances #bytes class name"); - st->print_cr("----------------------------------------------"); + st->print_cr(" num #instances #bytes class name (module)"); + st->print_cr("-------------------------------------------------------"); print_elements(st); } } diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/prims/jvm.cpp --- a/hotspot/src/share/vm/prims/jvm.cpp Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/prims/jvm.cpp Fri Apr 29 04:44:08 2016 +0200 @@ -389,7 +389,7 @@ PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1"); } else { char as_chars[256]; - jio_snprintf(as_chars, sizeof(as_chars), SIZE_FORMAT, MaxDirectMemorySize); + jio_snprintf(as_chars, sizeof(as_chars), JULONG_FORMAT, MaxDirectMemorySize); PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars); } } diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/prims/jvmti.xml --- a/hotspot/src/share/vm/prims/jvmti.xml Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/prims/jvmti.xml Fri Apr 29 04:44:08 2016 +0200 @@ -6482,6 +6482,7 @@ Get All Modules Return an array of all modules loaded in the virtual machine. + The array includes the unnamed module for each class loader. The number of modules in the array is returned via module_count_ptr, and the array itself via modules_ptr. diff -r c576864b4776 -r 1ad0239b6e4a hotspot/src/share/vm/runtime/globals.hpp --- a/hotspot/src/share/vm/runtime/globals.hpp Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/src/share/vm/runtime/globals.hpp Fri Apr 29 04:44:08 2016 +0200 @@ -3847,9 +3847,9 @@ \ /* Properties for Java libraries */ \ \ - product(size_t, MaxDirectMemorySize, 0, \ + product(uint64_t, MaxDirectMemorySize, 0, \ "Maximum total size of NIO direct-buffer allocations") \ - range(0, (size_t)SIZE_MAX) \ + range(0, max_jlong) \ \ /* Flags used for temporary code during development */ \ \ diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousClassLoader.java Fri Apr 29 04:44:08 2016 +0200 @@ -40,6 +40,7 @@ * @summary Checks that unreachable classes and unreachable humongous class loader are unloaded after GC * @requires vm.gc=="G1" | vm.gc=="null" * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M" + * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @library /testlibrary /test/lib / * @modules java.management * @build sun.hotspot.WhiteBox diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java --- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java Fri Apr 29 04:44:08 2016 +0200 @@ -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 @@ -57,33 +57,34 @@ /* * example output: - * num #instances #bytes class name - * ---------------------------------------------- - * 1: 1647 1133752 [B - * 2: 6198 383168 [C - * 3: 1464 165744 java.lang.Class - * 4: 6151 147624 java.lang.String - * 5: 2304 73728 java.util.concurrent.ConcurrentHashMap$Node - * 6: 1199 64280 [Ljava.lang.Object; + * num #instances #bytes class name (module) + * ------------------------------------------------------- + * 1: 7991 757792 [B (java.base@9-internal) + * 2: 1811 217872 java.lang.Class (java.base@9-internal) + * 3: 6724 215168 java.util.HashMap$Node (java.base@9-internal) + * 4: 7852 188448 java.lang.String (java.base@9-internal) + * 5: 1378 105040 [Ljava.util.HashMap$Node; (java.base@9-internal) + * 6: 1863 95096 [Ljava.lang.Object; (java.base@9-internal) + * ... */ /* Require at least one java.lang.Class */ - output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class\\s*$"); + output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class \\(java.base@\\S*\\)\\s*$"); /* Require at least one java.lang.String */ - output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String\\s*$"); + output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String \\(java.base@\\S*\\)\\s*$"); /* Require at least one java.lang.Object */ - output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object\\s*$"); + output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object \\(java.base@\\S*\\)\\s*$"); /* Require at exactly one TestClass[] */ output.shouldMatch("^\\s+\\d+:\\s+1\\s+\\d+\\s+" + - Pattern.quote(TestClass[].class.getName()) + "\\s*$"); + Pattern.quote(TestClass[].class.getName()) + "\\s*$"); /* Require at exactly 1024 TestClass */ output.shouldMatch("^\\s+\\d+:\\s+1024\\s+\\d+\\s+" + - Pattern.quote(TestClass.class.getName()) + "\\s*$"); + Pattern.quote(TestClass.class.getName()) + "\\s*$"); } @Test diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java --- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java Fri Apr 29 04:44:08 2016 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ import sun.hotspot.WhiteBox; import jdk.internal.misc.SharedSecrets; -import sun.reflect.ConstantPool; +import jdk.internal.reflect.ConstantPool; import java.lang.reflect.Executable; diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java --- a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java Fri Apr 29 04:44:08 2016 +0200 @@ -26,7 +26,7 @@ * @bug 8012447 * @library /testlibrary /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.misc - * java.base/sun.reflect + * java.base/jdk.internal.reflect * java.management * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/testlibrary_tests/ctw/ClassesListTest.java --- a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java Fri Apr 29 04:44:08 2016 +0200 @@ -26,7 +26,7 @@ * @bug 8012447 * @library /testlibrary /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.misc - * java.base/sun.reflect + * java.base/jdk.internal.reflect * java.management * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/testlibrary_tests/ctw/JarDirTest.java --- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Fri Apr 29 04:44:08 2016 +0200 @@ -26,7 +26,7 @@ * @bug 8012447 * @library /testlibrary /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.misc - * java.base/sun.reflect + * java.base/jdk.internal.reflect * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor diff -r c576864b4776 -r 1ad0239b6e4a hotspot/test/testlibrary_tests/ctw/JarsTest.java --- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java Wed Apr 27 21:00:45 2016 +0900 +++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java Fri Apr 29 04:44:08 2016 +0200 @@ -26,7 +26,7 @@ * @bug 8012447 * @library /testlibrary /test/lib /testlibrary/ctw/src * @modules java.base/jdk.internal.misc - * java.base/sun.reflect + * java.base/jdk.internal.reflect * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor