# HG changeset patch # User asaha # Date 1436890267 25200 # Node ID 5a9cc54c827e281f887899da15d473d3d6efbb90 # Parent 53643c94fd799a31e2103638833bf5104075d1e2# Parent fb157d537278cda4150740e27bb57cd8694e15bf Merge diff -r 53643c94fd79 -r 5a9cc54c827e .hgtags --- a/.hgtags Wed Jul 08 14:05:50 2015 +0100 +++ b/.hgtags Tue Jul 14 09:11:07 2015 -0700 @@ -565,6 +565,7 @@ 4206e725d584be942c25ff46ff23d8e299ca4a4c jdk8u31-b13 b517d3a9aebf0fee64808f9a7c0ef8e0b82d5ed3 jdk8u31-b31 15d8108258cb60a58bdd03b9ff8e77dd6727a804 jdk8u31-b32 +26b1dc6891c4fae03575a9090f7d04bd631d9164 jdk8u31-b33 1b3abbeee961dee49780c0e4af5337feb918c555 jdk8u40-b10 f10fe402dfb1543723b4b117a7cba3ea3d4159f1 hs25.40-b15 99372b2fee0eb8b3452f47230e84aa6e97003184 jdk8u40-b11 @@ -594,6 +595,8 @@ 698dd28ecc785ffc43e3f12266b13e85382c26a8 jdk8u40-b25 f39b6944ad447269b81e06ca5da9edff9e9e67c8 jdk8u40-b26 6824e2475e0432e27f9cc51838bc34ea5fbf5113 jdk8u40-b27 +8220f68a195f6eeed2f5fb6e8a303726b512e899 jdk8u40-b31 +850a290eb1088a61178d1910c500e170ef4f4386 jdk8u40-b32 b95f13f05f553309cd74d6ccf8fcedb259c6716c jdk8u45-b00 41c3c456e326185053f0654be838f4b0bfb38078 jdk8u45-b01 626fd8c2eec63e2a2dff3839bfe12c0431bf00a4 jdk8u45-b02 @@ -609,6 +612,26 @@ dc29108bcbcbfcd49eaa9135368306dc85db73a6 jdk8u45-b12 efbf340fc7f56e49735111c23cef030413146409 jdk8u45-b13 5321d26956b283b7cb73b04b91db41c7c9fe9158 jdk8u45-b14 +a5ba7c9a0b916ea088aaac5d40e17b4675c2b026 jdk8u45-b15 +894b92a02c533bcd1203c4beb5b6ec067b63466e jdk8u45-b31 +1428b6aa09c4e17202b801530c3c4993c7ce8e5b jdk8u45-b32 +b22b01407a8140041545afe1f2d6335db4d94ba5 jdk8u51-b00 +c1de2652a48c1d4a0c96707acc73db3cd317df2a jdk8u51-b01 +8f03c2f5fc170da5fca2cf65734941efb619feca jdk8u51-b02 +cf295659243009ded76b6c14307c177a02f9fe82 jdk8u51-b03 +0b3f449553884d88f6c9d7ab067fa858f18cc3f1 jdk8u51-b04 +6ce994385353023e6b3f9c5ef331f390b324a355 jdk8u51-b05 +3816de51b5e7d6050584057fae5f2262dae53d7e jdk8u51-b06 +5c017acbaf015fb8ecca6f00870965f3deb4e1ac jdk8u51-b07 +631d4029d851b59613e6748e17447001a682276e jdk8u51-b08 +ce81c4487dd1e9f89d4570a8cd25e349f6bae00d jdk8u51-b09 +928e1994ad43272f808ca22b9cc1b08a7ce2824f jdk8u51-b10 +1a122beb9dc6881850ef1d1250f40a83709b8b72 jdk8u51-b11 +05c80f1060f0c0d5720de9eadd09162af1168eab jdk8u51-b12 +07e103f3f43886a3b47945e5295eb5accad505de jdk8u51-b13 +a4eea4bee2d4fdb05f1a8358d70ec6adb1135526 jdk8u51-b14 +9a70cba6a3c3e44486f9c199d03a16b2b09d0a13 jdk8u51-b15 +3639e38bd73f5efa8ce092f0a745bb0c90759575 jdk8u51-b16 d9349fa8822336e0244da0a8448f3e6b2d62741d jdk8u60-b00 d9349fa8822336e0244da0a8448f3e6b2d62741d hs25.60-b00 ebf89088c08ab0508b9002b48dd3d68a340259af hs25.60-b01 @@ -655,4 +678,6 @@ e0d75c284bd1c09fd7d9ef09627d8a99b88d468d jdk8u60-b21 ff8fdeb2fb6d6f3348597339c53412f8f6202c3f hs25.60-b22 878cb0df27c22c6b1e9f4add1eb3da3edc8ab51d jdk8u60-b22 +0e4094950cd312c8f95c7f37336606323fe049fe jdk8u60-b23 +d89ceecf1bad55e1aee2932b8895d60fc64c15db hs25.60-b23 878cb0df27c22c6b1e9f4add1eb3da3edc8ab51d jdk8u66-b00 diff -r 53643c94fd79 -r 5a9cc54c827e make/hotspot_version --- a/make/hotspot_version Wed Jul 08 14:05:50 2015 +0100 +++ b/make/hotspot_version Tue Jul 14 09:11:07 2015 -0700 @@ -35,7 +35,7 @@ HS_MAJOR_VER=25 HS_MINOR_VER=60 -HS_BUILD_NUMBER=22 +HS_BUILD_NUMBER=23 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff -r 53643c94fd79 -r 5a9cc54c827e src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp --- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Wed Jul 08 14:05:50 2015 +0100 +++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Tue Jul 14 09:11:07 2015 -0700 @@ -189,7 +189,7 @@ return CPUVisitor::visit(nodeh, state); } - PICL(bool is_fujitsu) : _L1_data_cache_line_size(0), _L2_data_cache_line_size(0), _dl_handle(NULL) { + PICL(bool is_fujitsu, bool is_sun4v) : _L1_data_cache_line_size(0), _L2_data_cache_line_size(0), _dl_handle(NULL) { if (!open_library()) { return; } @@ -201,7 +201,7 @@ if (is_fujitsu) { cpu_class = "core"; } - CPUVisitor cpu_visitor(this, os::processor_count()); + CPUVisitor cpu_visitor(this, (is_sun4v && !is_fujitsu) ? 1 : os::processor_count()); _picl_walk_tree_by_class(rooth, cpu_class, &cpu_visitor, PICL_visit_cpu_helper); if (cpu_visitor.l1_visitor()->is_assigned()) { // Is there a value? _L1_data_cache_line_size = cpu_visitor.l1_visitor()->value(); @@ -494,7 +494,7 @@ } // Figure out cache line sizes using PICL - PICL picl((features & sparc64_family_m) != 0); + PICL picl((features & sparc64_family_m) != 0, (features & sun4v_m) != 0); _L2_data_cache_line_size = picl.L2_data_cache_line_size(); return features; diff -r 53643c94fd79 -r 5a9cc54c827e src/share/vm/c1/c1_LIRGenerator.cpp --- a/src/share/vm/c1/c1_LIRGenerator.cpp Wed Jul 08 14:05:50 2015 +0100 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Tue Jul 14 09:11:07 2015 -0700 @@ -2189,7 +2189,15 @@ if (log2_scale != 0) { // temporary fix (platform dependent code without shift on Intel would be better) // TODO: ARM also allows embedded shift in the address - __ shift_left(index_op, log2_scale, index_op); + LIR_Opr tmp = new_pointer_register(); + if (TwoOperandLIRForm) { + __ move(index_op, tmp); + index_op = tmp; + } + __ shift_left(index_op, log2_scale, tmp); + if (!TwoOperandLIRForm) { + index_op = tmp; + } } LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type()); diff -r 53643c94fd79 -r 5a9cc54c827e src/share/vm/classfile/systemDictionary.cpp --- a/src/share/vm/classfile/systemDictionary.cpp Wed Jul 08 14:05:50 2015 +0100 +++ b/src/share/vm/classfile/systemDictionary.cpp Tue Jul 14 09:11:07 2015 -0700 @@ -2349,9 +2349,6 @@ assert(!THREAD->is_Compiler_thread(), ""); Handle method_type = SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty)); - if (false) { // FIXME: Decide if the Java upcall should resolve signatures. - method_type = java_lang_String::create_from_symbol(signature, CHECK_(empty)); - } KlassHandle mh_klass = SystemDictionary::MethodHandle_klass(); int ref_kind = JVM_REF_invokeVirtual; @@ -2383,6 +2380,24 @@ return unpack_method_and_appendix(mname, accessing_klass, appendix_box, appendix_result, THREAD); } +// Decide if we can globally cache a lookup of this class, to be returned to any client that asks. +// We must ensure that all class loaders everywhere will reach this class, for any client. +// This is a safe bet for public classes in java.lang, such as Object and String. +// We also include public classes in java.lang.invoke, because they appear frequently in system-level method types. +// Out of an abundance of caution, we do not include any other classes, not even for packages like java.util. +static bool is_always_visible_class(oop mirror) { + Klass* klass = java_lang_Class::as_Klass(mirror); + if (klass->oop_is_objArray()) { + klass = ObjArrayKlass::cast(klass)->bottom_klass(); // check element type + } + if (klass->oop_is_typeArray()) { + return true; // primitive array + } + assert(klass->oop_is_instance(), klass->external_name()); + return klass->is_public() && + (InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::Object_klass()) || // java.lang + InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::MethodHandle_klass())); // java.lang.invoke +} // Ask Java code to find or construct a java.lang.invoke.MethodType for the given // signature, as interpreted relative to the given class loader. @@ -2405,32 +2420,33 @@ } Handle class_loader, protection_domain; - bool is_on_bcp = true; // keep this true as long as we can materialize from the boot classloader + if (accessing_klass.not_null()) { + class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader()); + protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain()); + } + bool can_be_cached = true; int npts = ArgumentCount(signature).size(); objArrayHandle pts = oopFactory::new_objArray(SystemDictionary::Class_klass(), npts, CHECK_(empty)); int arg = 0; - Handle rt; // the return type from the signature + Handle rt; // the return type from the signature ResourceMark rm(THREAD); for (SignatureStream ss(signature); !ss.is_done(); ss.next()) { oop mirror = NULL; - if (is_on_bcp) { - // Note: class_loader & protection_domain are both null at this point. - mirror = ss.as_java_mirror(class_loader, protection_domain, + if (can_be_cached) { + // Use neutral class loader to lookup candidate classes to be placed in the cache. + mirror = ss.as_java_mirror(Handle(), Handle(), SignatureStream::ReturnNull, CHECK_(empty)); - if (mirror == NULL) { - // fall back from BCP to accessing_klass - if (accessing_klass.not_null()) { - class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader()); - protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain()); - } - is_on_bcp = false; + if (mirror == NULL || (ss.is_object() && !is_always_visible_class(mirror))) { + // Fall back to accessing_klass context. + can_be_cached = false; } } - if (!is_on_bcp) { + if (!can_be_cached) { // Resolve, throwing a real error if it doesn't work. mirror = ss.as_java_mirror(class_loader, protection_domain, SignatureStream::NCDFError, CHECK_(empty)); } + assert(!oopDesc::is_null(mirror), ss.as_symbol(THREAD)->as_C_string()); if (ss.at_return_type()) rt = Handle(THREAD, mirror); else @@ -2462,7 +2478,7 @@ &args, CHECK_(empty)); Handle method_type(THREAD, (oop) result.get_jobject()); - if (is_on_bcp) { + if (can_be_cached) { // We can cache this MethodType inside the JVM. MutexLocker ml(SystemDictionary_lock, THREAD); spe = invoke_method_table()->find_entry(index, hash, signature, null_iid); diff -r 53643c94fd79 -r 5a9cc54c827e src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Jul 08 14:05:50 2015 +0100 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue Jul 14 09:11:07 2015 -0700 @@ -3339,9 +3339,11 @@ // Not unloading classes this cycle assert(!should_unload_classes(), "Inconsitency!"); + // If we are not unloading classes then add SO_AllCodeCache to root + // scanning options. + add_root_scanning_option(rso); + if ((!verifying() || unloaded_classes_last_cycle()) && should_verify) { - // Include symbols, strings and code cache elements to prevent their resurrection. - add_root_scanning_option(rso); set_verifying(true); } else if (verifying() && !should_verify) { // We were verifying, but some verification flags got disabled.