From 33d6b93e229db7f15ab4e8ded5cbc23596c3eab2 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Thu, 24 Oct 2013 00:33:14 -0400 Subject: [PATCH 01/36] 8026877: Error in opening JAR file when invalid jar specified with -Xbootclasspath/a on OpenJDK build Reviewed-by: coleenp, twisti --- hotspot/src/share/vm/classfile/systemDictionary.hpp | 2 -- hotspot/src/share/vm/runtime/thread.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index 85735a732fa..c6436364533 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -173,8 +173,6 @@ class SymbolPropertyTable; /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ \ - do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ - \ /* Preload boxing klasses */ \ do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ do_klass(Character_klass, java_lang_Character, Pre ) \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index f645be31d80..9f31c25b7c6 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1097,7 +1097,7 @@ static const char* get_java_runtime_version(TRAPS) { // General purpose hook into Java code, run once when the VM is initialized. // The Java library method itself may be changed independently from the VM. static void call_postVMInitHook(TRAPS) { - Klass* k = SystemDictionary::PostVMInitHook_klass(); + Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_PostVMInitHook(), THREAD); instanceKlassHandle klass (THREAD, k); if (klass.not_null()) { JavaValue result(T_VOID); From 508272e5f57552e9d506cef55a96a67f112165dd Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Thu, 24 Oct 2013 10:02:02 +0200 Subject: [PATCH 02/36] 8024423: JVMTI: GetLoadedClasses doesn't enumerate anonymous classes Rewrite of the getLoadedClasses() method implementation to include anonymous classes. Reviewed-by: coleenp, sspitsyn --- .../share/vm/classfile/classLoaderData.cpp | 17 +++ .../share/vm/classfile/classLoaderData.hpp | 2 + hotspot/src/share/vm/oops/instanceKlass.cpp | 29 ++++- .../share/vm/prims/jvmtiGetLoadedClasses.cpp | 109 +++++++++--------- 4 files changed, 97 insertions(+), 60 deletions(-) diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 84c191e33bd..e3209ae1868 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -131,6 +131,17 @@ void ClassLoaderData::classes_do(void f(Klass * const)) { } } +void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) { + // Lock to avoid classes being modified/added/removed during iteration + MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); + for (Klass* k = _klasses; k != NULL; k = k->next_link()) { + // Do not filter ArrayKlass oops here... + if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) { + klass_closure->do_klass(k); + } + } +} + void ClassLoaderData::classes_do(void f(InstanceKlass*)) { for (Klass* k = _klasses; k != NULL; k = k->next_link()) { if (k->oop_is_instance()) { @@ -600,6 +611,12 @@ void ClassLoaderDataGraph::classes_do(void f(Klass* const)) { } } +void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) { + for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { + cld->loaded_classes_do(klass_closure); + } +} + void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) { diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index 6d5747483d4..cee114c75e0 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -78,6 +78,7 @@ class ClassLoaderDataGraph : public AllStatic { static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); static void classes_do(KlassClosure* klass_closure); static void classes_do(void f(Klass* const)); + static void loaded_classes_do(KlassClosure* klass_closure); static void classes_unloading_do(void f(Klass* const)); static bool do_unloading(BoolObjectClosure* is_alive); @@ -186,6 +187,7 @@ class ClassLoaderData : public CHeapObj { bool keep_alive() const { return _keep_alive; } bool is_alive(BoolObjectClosure* is_alive_closure) const; void classes_do(void f(Klass*)); + void loaded_classes_do(KlassClosure* klass_closure); void classes_do(void f(InstanceKlass*)); // Deallocate free list during class unloading. diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index a8fa7b3ee0e..510102d4e35 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2393,15 +2393,38 @@ address InstanceKlass::static_field_addr(int offset) { const char* InstanceKlass::signature_name() const { + int hash_len = 0; + char hash_buf[40]; + + // If this is an anonymous class, append a hash to make the name unique + if (is_anonymous()) { + assert(EnableInvokeDynamic, "EnableInvokeDynamic was not set."); + intptr_t hash = (java_mirror() != NULL) ? java_mirror()->identity_hash() : 0; + sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash); + hash_len = (int)strlen(hash_buf); + } + + // Get the internal name as a c string const char* src = (const char*) (name()->as_C_string()); const int src_length = (int)strlen(src); - char* dest = NEW_RESOURCE_ARRAY(char, src_length + 3); - int src_index = 0; + + char* dest = NEW_RESOURCE_ARRAY(char, src_length + hash_len + 3); + + // Add L as type indicator int dest_index = 0; dest[dest_index++] = 'L'; - while (src_index < src_length) { + + // Add the actual class name + for (int src_index = 0; src_index < src_length; ) { dest[dest_index++] = src[src_index++]; } + + // If we have a hash, append it + for (int hash_index = 0; hash_index < hash_len; ) { + dest[dest_index++] = hash_buf[hash_index++]; + } + + // Add the semicolon and the NULL dest[dest_index++] = ';'; dest[dest_index] = '\0'; return dest; diff --git a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp index 51cfb384ac9..f58a5a3d532 100644 --- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp @@ -29,8 +29,43 @@ #include "runtime/thread.hpp" +// The closure for GetLoadedClasses +class LoadedClassesClosure : public KlassClosure { +private: + Stack _classStack; + JvmtiEnv* _env; -// The closure for GetLoadedClasses and GetClassLoaderClasses +public: + LoadedClassesClosure(JvmtiEnv* env) { + _env = env; + } + + void do_klass(Klass* k) { + // Collect all jclasses + _classStack.push((jclass) _env->jni_reference(k->java_mirror())); + } + + int extract(jclass* result_list) { + // The size of the Stack will be 0 after extract, so get it here + int count = (int)_classStack.size(); + int i = count; + + // Pop all jclasses, fill backwards + while (!_classStack.is_empty()) { + result_list[--i] = _classStack.pop(); + } + + // Return the number of elements written + return count; + } + + // Return current size of the Stack + int get_count() { + return (int)_classStack.size(); + } +}; + +// The closure for GetClassLoaderClasses class JvmtiGetLoadedClassesClosure : public StackObj { // Since the SystemDictionary::classes_do callback // doesn't pass a closureData pointer, @@ -165,19 +200,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - // Finally, the static methods that are the callbacks - static void increment(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - that->set_count(that->get_count() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - that->set_count(that->get_count() + 1); - } - } - static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); oop class_loader = loader_data->class_loader(); @@ -196,24 +218,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - static void add(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->available()) { - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - oop mirror = l->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - oop mirror = k->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } - } - static void add_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); if (that->available()) { @@ -255,39 +259,30 @@ class JvmtiGetLoadedClassesClosure : public StackObj { jvmtiError JvmtiGetLoadedClasses::getLoadedClasses(JvmtiEnv *env, jint* classCountPtr, jclass** classesPtr) { - // Since SystemDictionary::classes_do only takes a function pointer - // and doesn't call back with a closure data pointer, - // we can only pass static methods. - JvmtiGetLoadedClassesClosure closure; + LoadedClassesClosure closure(env); { // To get a consistent list of classes we need MultiArray_lock to ensure - // array classes aren't created, and SystemDictionary_lock to ensure that - // classes aren't added to the system dictionary, + // array classes aren't created. MutexLocker ma(MultiArray_lock); - MutexLocker sd(SystemDictionary_lock); - // First, count the classes - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::increment); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::increment); - // Next, fill in the classes - closure.allocate(); - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::add); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::add); - // Drop the SystemDictionary_lock, so the results could be wrong from here, - // but we still have a snapshot. + // Iterate through all classes in ClassLoaderDataGraph + // and collect them using the LoadedClassesClosure + ClassLoaderDataGraph::loaded_classes_do(&closure); } - // Post results + + // Return results by extracting the collected contents into a list + // allocated via JvmtiEnv jclass* result_list; - jvmtiError err = env->Allocate(closure.get_count() * sizeof(jclass), - (unsigned char**)&result_list); - if (err != JVMTI_ERROR_NONE) { - return err; + jvmtiError error = env->Allocate(closure.get_count() * sizeof(jclass), + (unsigned char**)&result_list); + + if (error == JVMTI_ERROR_NONE) { + int count = closure.extract(result_list); + *classCountPtr = count; + *classesPtr = result_list; } - closure.extract(env, result_list); - *classCountPtr = closure.get_count(); - *classesPtr = result_list; - return JVMTI_ERROR_NONE; + return error; } jvmtiError From 21748b738ffe46eb059f333e76c6588d21f26637 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 24 Oct 2013 10:43:35 +0200 Subject: [PATCH 03/36] 8009280: JCE jurisdiction policy files not copied into jdk/lib/security Reviewed-by: tbell, ihse --- common/makefiles/JavaCompilation.gmk | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/makefiles/JavaCompilation.gmk b/common/makefiles/JavaCompilation.gmk index 009aba801d9..065bbbc34b0 100644 --- a/common/makefiles/JavaCompilation.gmk +++ b/common/makefiles/JavaCompilation.gmk @@ -506,30 +506,30 @@ define SetupJavaCompilation $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) $(MKDIR) -p $$(@D) - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) $(ECHO) Compiling $1 ($$($1_JVM) $$($1_SJAVAC) \ $$($1_REMOTE) \ -j $(JOBS) \ --permit-unidentified-artifacts \ --permit-sources-without-package \ - --compare-found-sources $$($1_BIN)/_the.batch.tmp \ + --compare-found-sources $$($1_BIN)/_the.$1_batch.tmp \ --log=$(LOG_LEVEL) \ $$($1_SJAVAC_ARGS) \ $$($1_FLAGS) \ $$($1_HEADERS_ARG) \ -d $$($1_BIN) && \ - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) + $(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch) else # Using plain javac to batch compile everything. - $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch + $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.$1_batch # When building in batch, put headers in a temp dir to filter out those that actually # changed before copying them to the real header dir. ifneq (,$$($1_HEADERS)) $1_HEADERS_ARG := -h $$($1_HEADERS).tmp - $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch + $$($1_HEADERS)/_the.$1_headers: $$($1_BIN)/_the.$1_batch $(MKDIR) -p $$(@D) for f in `ls $$($1_HEADERS).tmp`; do \ if [ ! -f "$$($1_HEADERS)/$$$$f" ] || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).tmp/$$$$f`" != "" ]; then \ @@ -539,19 +539,19 @@ define SetupJavaCompilation $(RM) -r $$($1_HEADERS).tmp $(TOUCH) $$@ - $1 += $$($1_HEADERS)/_the.headers + $1 += $$($1_HEADERS)/_the.$1_headers endif # When not using sjavac, pass along all sources to javac using an @file. - $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) + $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $(MKDIR) -p $$(@D) - $(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) - $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 + $(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) + $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 ($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ - -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \ - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) + -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp && \ + $(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch) endif From a1a132996a5927801b0060788548e7c297328a6e Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 24 Oct 2013 10:43:51 +0200 Subject: [PATCH 04/36] 8009280: JCE jurisdiction policy files not copied into jdk/lib/security Reviewed-by: tbell, ihse --- jdk/makefiles/BuildJdk.gmk | 6 +- jdk/makefiles/CompileJavaClasses.gmk | 59 ++++- jdk/makefiles/CreateJars.gmk | 290 +---------------------- jdk/makefiles/CreateSecurityJars.gmk | 329 +++++++++++++++++++++++++++ jdk/makefiles/SignJars.gmk | 2 +- 5 files changed, 390 insertions(+), 296 deletions(-) create mode 100644 jdk/makefiles/CreateSecurityJars.gmk diff --git a/jdk/makefiles/BuildJdk.gmk b/jdk/makefiles/BuildJdk.gmk index 9a42d01277d..eeb4a533220 100644 --- a/jdk/makefiles/BuildJdk.gmk +++ b/jdk/makefiles/BuildJdk.gmk @@ -80,7 +80,11 @@ genclasses-only: # to execute launchers. +$(MAKE) -f GenerateClasses.gmk -jdk: genclasses +securityjars: genclasses securityjars-only +securityjars-only: + +$(MAKE) -f CreateSecurityJars.gmk + +jdk: securityjars # Now we have a complete jdk, which you can run. # It is not yet wrapped up as an installed image. diff --git a/jdk/makefiles/CompileJavaClasses.gmk b/jdk/makefiles/CompileJavaClasses.gmk index bc830d5c711..88d50a5db0e 100644 --- a/jdk/makefiles/CompileJavaClasses.gmk +++ b/jdk/makefiles/CompileJavaClasses.gmk @@ -281,6 +281,19 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) EXCLUDES += com/apple/jobjc endif +# The security classes should not end up in the classes directory as that will prevent them +# from working when running the exploded jdk image. Compile them separately to a different +# directory from where the jars can be created. +SECURITY_PKGS := \ + com/oracle/security/ucrypto \ + com/sun/crypto/provider \ + javax/crypto \ + sun/security/ec \ + sun/security/internal \ + sun/security/mscapi \ + sun/security/pkcs11 \ + # + # The exception handling of swing beaninfo # These resources violates the convention of having code and resources together under # $(JDK_TOPDIR)/src/.../classes directories @@ -293,22 +306,46 @@ $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/t # space separated list. JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER))) -$(eval $(call SetupJavaCompilation,BUILD_JDK, \ +ifeq ($(ENABLE_SJAVAC),yes) + # With sjavac enabled, excluded sources are not even considered for linking. + # Explicitly add the security sources to sourcepath for linking. + BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \ + -sourcepath $(JDK_TOPDIR)/src/share/classes +endif + +$(eval $(call SetupJavaCompilation,BUILD_JDK,\ + SETUP:=GENERATE_JDKBYTECODE,\ + SRC:=$(JDK_TOPDIR)/src/share/classes \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \ + $(MACOSX_SRC_DIRS) \ + $(JDK_OUTPUTDIR)/gensrc \ + $(JDK_OUTPUTDIR)/gensrc_no_srczip \ + $(CLOSED_SRC_DIRS),\ + INCLUDES:=$(JDK_USER_DEFINED_FILTER),\ + EXCLUDES:=$(EXCLUDES) $(SECURITY_PKGS),\ + EXCLUDE_FILES:=$(EXFILES),\ + BIN:=$(JDK_OUTPUTDIR)/classes,\ + COPY:=$(COPY_PATTERNS),\ + COPY_FILES:=$(COPY_FILES),\ + HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers,\ + ADD_JAVAC_FLAGS:=$(BUILD_JDK_SOURCEPATH))) + +########################################################################################## + +$(eval $(call SetupJavaCompilation,BUILD_SECURITY, \ SETUP := GENERATE_JDKBYTECODE, \ SRC := $(JDK_TOPDIR)/src/share/classes \ - $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \ - $(MACOSX_SRC_DIRS) \ - $(JDK_OUTPUTDIR)/gensrc \ - $(JDK_OUTPUTDIR)/gensrc_no_srczip \ - $(CLOSED_SRC_DIRS), \ - INCLUDES := $(JDK_USER_DEFINED_FILTER), \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \ + $(MACOSX_SRC_DIRS) \ + $(CLOSED_SRC_DIRS), \ + INCLUDES := $(SECURITY_PKGS), \ EXCLUDES := $(EXCLUDES), \ EXCLUDE_FILES := $(EXFILES), \ - BIN := $(JDK_OUTPUTDIR)/classes, \ - COPY := $(COPY_PATTERNS), \ - COPY_FILES := $(COPY_FILES), \ + BIN := $(JDK_OUTPUTDIR)/classes_security, \ HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers)) +$(BUILD_SECURITY): $(BUILD_JDK) + ########################################################################################## $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin: @@ -393,7 +430,7 @@ endif ########################################################################################## -all: $(BUILD_JDK) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \ +all: $(BUILD_JDK) $(BUILD_SECURITY) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \ $(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \ $(BUILD_ACCESSBRIDGE_LEGACY) diff --git a/jdk/makefiles/CreateJars.gmk b/jdk/makefiles/CreateJars.gmk index b3595ab0344..8b965466d4e 100644 --- a/jdk/makefiles/CreateJars.gmk +++ b/jdk/makefiles/CreateJars.gmk @@ -102,7 +102,6 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR, , \ # This value should exclude types destined for jars other than rt.jar and resources.jar. # When building a Profile this value augments the profile specific exclusions RT_JAR_EXCLUDES += \ - com/oracle/security \ com/sun/codemodel \ com/sun/crypto/provider \ com/sun/istack/internal/tools \ @@ -414,86 +413,6 @@ $(eval $(call SetupArchive,BUILD_JSSE_JAR, , \ MANIFEST := $(MAINMANIFEST), \ CHECK_COMPRESS_JAR := true)) -########################################################################################## -# Create manifest for security jars - -# -# Include these extra attributes for now, should probably take out. -# -JCE_MANIFEST := $(IMAGES_OUTPUTDIR)/lib/_the.security.manifest.mf -$(JCE_MANIFEST): $(MAINMANIFEST) - $(MKDIR) -p $(@D) - $(RM) $@ $@.tmp - $(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \ - -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \ - $(MAINMANIFEST) >> $@.tmp - $(ECHO) "Extension-Name: javax.crypto" >> $@.tmp - $(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp - $(MV) $@.tmp $@ - -########################################################################################## -# For security and crypto jars, always build the jar, but for closed, install the prebuilt -# signed version instead of the newly built jar. Unsigned jars are treated as intermediate -# targets and explicitly added to the JARS list. For open, signing is not needed. See -# SignJars.gmk for more information. -# -# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO -# variable is set to no if these jars can't be built to skip that step of the build. -# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no -# other way to get the jars than to build them. - -SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar -SUNPKCS11_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunpkcs11.jar - -$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := sun/security/pkcs11, \ - JAR := $(SUNPKCS11_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - -$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST) - -ifndef OPENJDK - SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar - $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..." - $(install-file) -else - $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED) - $(install-file) -endif - -JARS += $(SUNPKCS11_JAR_UNSIGNED) - -########################################################################################## - -SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar -SUNEC_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunec.jar - -$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := sun/security/ec, \ - JAR := $(SUNEC_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - -$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST) - -ifndef OPENJDK - SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar - $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..." - $(install-file) -else - $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED) - $(install-file) -endif - -JARS += $(SUNEC_JAR_UNSIGNED) - ########################################################################################## $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \ @@ -507,208 +426,6 @@ $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \ ########################################################################################## -SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar -SUNJCE_PROVIDER_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunjce_provider.jar - -ifneq ($(BUILD_CRYPTO), no) - $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := com/sun/crypto/provider, \ - JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - - $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST) - - JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED) -endif - -ifndef OPENJDK - SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar - $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..." - $(install-file) -else - $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED) - $(install-file) -endif - -########################################################################################## - -JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar -JCE_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/jce.jar - -ifneq ($(BUILD_CRYPTO), no) - $(eval $(call SetupArchive,BUILD_JCE_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := javax/crypto sun/security/internal, \ - JAR := $(JCE_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - - $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST) - - JARS += $(JCE_JAR_UNSIGNED) -endif - -ifndef OPENJDK - JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar - $(JCE_JAR_DST): $(JCE_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..." - $(install-file) -else - $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED) - $(install-file) -endif - -########################################################################################## - -US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar -US_EXPORT_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/US_export_policy.jar - -ifneq ($(BUILD_CRYPTO), no) - # - # TODO fix so that SetupArchive does not write files into SRCS - # then we don't need this extra copying - - # NOTE: We currently do not place restrictions on our limited export - # policy. This was not a typo. - # - US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited - US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp - - $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/% - $(install-file) - - US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy - - $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \ - SRCS := $(US_EXPORT_POLICY_JAR_TMP), \ - SUFFIXES := .policy, \ - JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \ - EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ - SKIP_METAINF := true)) - - JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED) -endif - -ifndef OPENJDK - $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar - $(ECHO) $(LOG_INFO) Copying $(@F) - $(install-file) -else - $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED) - $(install-file) -endif - -########################################################################################## - -LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar -LOCAL_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/local_policy.jar - -ifneq ($(BUILD_CRYPTO), no) - # - # TODO fix so that SetupArchive does not write files into SRCS - # then we don't need this extra copying - # - LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp - - ifeq ($(UNLIMITED_CRYPTO), true) - LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited - LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy - LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited - else - LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited - LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \ - $(LOCAL_POLICY_JAR_TMP)/default_local.policy - LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited - endif - - $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/% - $(install-file) - - $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \ - SRCS := $(LOCAL_POLICY_JAR_TMP), \ - SUFFIXES := .policy, \ - JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \ - EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \ - SKIP_METAINF := true)) - - JARS += $(LOCAL_POLICY_JAR_UNSIGNED) -endif - -ifndef OPENJDK - $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar - $(ECHO) $(LOG_INFO) Copying $(@F) - $(install-file) -else - $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED) - $(install-file) -endif - -########################################################################################## - -ifeq ($(OPENJDK_TARGET_OS), windows) - - SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar - SUNMSCAPI_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunmscapi.jar - - $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := sun/security/mscapi, \ - JAR := $(SUNMSCAPI_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - - $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST) - - ifndef OPENJDK - SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar - $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..." - $(install-file) - else - $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED) - $(install-file) - endif - - JARS += $(SUNMSCAPI_JAR_UNSIGNED) - -endif - -########################################################################################## - -ifeq ($(OPENJDK_TARGET_OS), solaris) - ifndef OPENJDK - - UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar - UCRYPTO_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/ucrypto.jar - UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar - - $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \ - SRCS := $(JDK_OUTPUTDIR)/classes, \ - SUFFIXES := .class, \ - INCLUDES := com/oracle/security/ucrypto, \ - JAR := $(UCRYPTO_JAR_UNSIGNED), \ - MANIFEST := $(JCE_MANIFEST), \ - SKIP_METAINF := true)) - - $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST) - - $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC) - @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..." - $(install-file) - - JARS += $(UCRYPTO_JAR_UNSIGNED) - - endif -endif - -########################################################################################## - # Get the CLDRVERSION include gensrc/GensrcCLDR.gmk @@ -1047,6 +764,13 @@ endif ########################################################################################## +# This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track +# which jars are where +$(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% + $(install-file) + +########################################################################################## + # Import nashorn.jar from nashorn dist dir. $(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar $(install-file) diff --git a/jdk/makefiles/CreateSecurityJars.gmk b/jdk/makefiles/CreateSecurityJars.gmk new file mode 100644 index 00000000000..f7e54160232 --- /dev/null +++ b/jdk/makefiles/CreateSecurityJars.gmk @@ -0,0 +1,329 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# 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. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include Setup.gmk + +# The jars created in this file are required for the exploded jdk image to function and +# cannot wait to be built in the images target. + +########################################################################################## +# Create manifest for security jars +# +# Include these extra attributes for now, should probably take out. +# +MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf +JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf + +$(JCE_MANIFEST): $(MAINMANIFEST) + $(MKDIR) -p $(@D) + $(RM) $@ $@.tmp + $(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \ + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \ + $(MAINMANIFEST) >> $@.tmp + $(ECHO) "Extension-Name: javax.crypto" >> $@.tmp + $(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp + $(MV) $@.tmp $@ + +########################################################################################## +# For security and crypto jars, always build the jar, but for closed, install the prebuilt +# signed version instead of the newly built jar. Unsigned jars are treated as intermediate +# targets and explicitly added to the JARS list. For open, signing is not needed. See +# SignJars.gmk for more information. +# +# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO +# variable is set to no if these jars can't be built to skip that step of the build. +# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no +# other way to get the jars than to build them. + +SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar +SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar + +$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := sun/security/pkcs11, \ + JAR := $(SUNPKCS11_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + +$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST) + +ifndef OPENJDK + SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar + $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..." + $(install-file) +else + $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST) + +########################################################################################## + +SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar +SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar + +$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := sun/security/ec, \ + JAR := $(SUNEC_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + +$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST) + +ifndef OPENJDK + SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar + $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..." + $(install-file) +else + $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST) + +########################################################################################## + +SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar +SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar + +ifneq ($(BUILD_CRYPTO), no) + $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := com/sun/crypto/provider, \ + JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + + $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST) + + JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED) +endif + +ifndef OPENJDK + SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar + $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..." + $(install-file) +else + $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(SUNJCE_PROVIDER_JAR_DST) + +########################################################################################## + +JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar +JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar + +ifneq ($(BUILD_CRYPTO), no) + $(eval $(call SetupArchive,BUILD_JCE_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := javax/crypto sun/security/internal, \ + JAR := $(JCE_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + + $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST) + + JARS += $(JCE_JAR_UNSIGNED) +endif + +ifndef OPENJDK + JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar + $(JCE_JAR_DST): $(JCE_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..." + $(install-file) +else + $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(JCE_JAR_DST) + +########################################################################################## + +US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar +US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar + +ifneq ($(BUILD_CRYPTO), no) + # + # TODO fix so that SetupArchive does not write files into SRCS + # then we don't need this extra copying + # + # NOTE: We currently do not place restrictions on our limited export + # policy. This was not a typo. + # + US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited + US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp + + $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/% + $(install-file) + + US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy + + $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \ + SRCS := $(US_EXPORT_POLICY_JAR_TMP), \ + SUFFIXES := .policy, \ + JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \ + EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ + SKIP_METAINF := true)) + + JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED) +endif + +ifndef OPENJDK + $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar + $(ECHO) $(LOG_INFO) Copying $(@F) + $(install-file) +else + $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(US_EXPORT_POLICY_JAR_DST) + +########################################################################################## + +LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar +LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar + +ifneq ($(BUILD_CRYPTO), no) + # + # TODO fix so that SetupArchive does not write files into SRCS + # then we don't need this extra copying + # + LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp + + ifeq ($(UNLIMITED_CRYPTO), true) + LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited + LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy + LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited + else + LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited + LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \ + $(LOCAL_POLICY_JAR_TMP)/default_local.policy + LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited + endif + + $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/% + $(install-file) + + $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \ + SRCS := $(LOCAL_POLICY_JAR_TMP), \ + SUFFIXES := .policy, \ + JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \ + EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \ + SKIP_METAINF := true)) + + JARS += $(LOCAL_POLICY_JAR_UNSIGNED) +endif + +ifndef OPENJDK + $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar + $(ECHO) $(LOG_INFO) Copying $(@F) + $(install-file) +else + $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED) + $(install-file) +endif + +JARS += $(LOCAL_POLICY_JAR_DST) + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), windows) + + SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar + SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar + + $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := sun/security/mscapi, \ + JAR := $(SUNMSCAPI_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + + $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST) + + ifndef OPENJDK + SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar + $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..." + $(install-file) + else + $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED) + $(install-file) + endif + + JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifndef OPENJDK + + UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar + UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar + UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar + + $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \ + SRCS := $(JDK_OUTPUTDIR)/classes_security, \ + SUFFIXES := .class, \ + INCLUDES := com/oracle/security/ucrypto, \ + JAR := $(UCRYPTO_JAR_UNSIGNED), \ + MANIFEST := $(JCE_MANIFEST), \ + SKIP_METAINF := true)) + + $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST) + + $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC) + @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..." + $(install-file) + + JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST) + + endif +endif + +all: $(JARS) + +.PHONY: default all diff --git a/jdk/makefiles/SignJars.gmk b/jdk/makefiles/SignJars.gmk index 4e4233d419b..4005ab736f3 100644 --- a/jdk/makefiles/SignJars.gmk +++ b/jdk/makefiles/SignJars.gmk @@ -78,7 +78,7 @@ check-keystore: exit 2; \ fi -$(JCE_OUTPUTDIR)/%: $(IMAGES_OUTPUTDIR)/unsigned/% +$(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/% $(call install-file) $(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \ $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE) From a1abd2bc9de2cc7c1da3463843d70b7621c02358 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:01 -0700 Subject: [PATCH 05/36] Added tag jdk8-b113 for changeset 0cf466e2de61 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 8814acccf94..ef0f8b30804 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -234,3 +234,4 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103 4faa09c7fe555de086dd9048d3c5cc92317d6f45 jdk8-b110 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 +6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113 From 35d37e60579c4ba1334749f29351a09c602a1462 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:06 -0700 Subject: [PATCH 06/36] Added tag jdk8-b113 for changeset 221c3167eb35 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 3b352004341..6be005665d2 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -234,3 +234,4 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108 3d2b7ce93c5c2e3db748f29c3d29620a8b3b748a jdk8-b110 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 +a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113 From fdd9983b0998834996919437aea30b3802dc3f9a Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:35 -0700 Subject: [PATCH 07/36] Added tag jdk8-b113 for changeset 8a9716442153 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 7621bc5f5a1..4038b1d8a3b 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -234,3 +234,4 @@ d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107 4c84c5b447b09aff27f3b72667ab3a5401e85968 jdk8-b110 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111 c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112 +0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113 From 061b8f083afce028ed5e610cb3047a3fccf2d903 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:37 -0700 Subject: [PATCH 08/36] Added tag jdk8-b113 for changeset e72a161be840 --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 74b6fb898b4..19b10816478 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -234,3 +234,4 @@ df5d4d01642572e77fd3c01e4c8703ed3f6eec87 jdk8-b109 cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111 dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112 +9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113 From a2c13f91e09931188abb4099b7db70fd513cbbe7 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:42 -0700 Subject: [PATCH 09/36] Added tag jdk8-b113 for changeset 70f69e624fc9 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 6fc1c37c4f0..f93b4c85fc5 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -234,3 +234,4 @@ eea685b9ccaa1980e0a7e07d6a3a84bcc7e9ab82 jdk8-b107 54e099776f08430d3a7f4feabd9f2ba886b55320 jdk8-b110 719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111 f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112 +5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113 From 7217e11778d1bce4122faeafc5357638199b01f3 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:52 -0700 Subject: [PATCH 10/36] Added tag jdk8-b113 for changeset 220220c28a95 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index e56bf696bb2..b779e2389c9 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -234,3 +234,4 @@ fcd768844b9926c5f994292ec6350c20cc7c0f76 jdk8-b106 41541097533aa3933a018c8c1c426c1871dfd76e jdk8-b110 af6244ba81b6b8d1bf4ab06587a2067e021e4570 jdk8-b111 954dd199d6ff3e4cfc42b894c1f611150526eecd jdk8-b112 +54150586ba785e1eb0c0de8d13906f643f640644 jdk8-b113 From a394220a727d60e26ed18e0ff6c151c92ad9a5d7 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 24 Oct 2013 09:10:54 -0700 Subject: [PATCH 11/36] Added tag jdk8-b113 for changeset a3e196032ce5 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index 76c92131abf..47bd39011f0 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -222,3 +222,4 @@ f35e1255024b66f7cf82517798f45f6e194e5567 jdk8-b107 d49a8c2173f5f90c9a39cc4af8e03cfa8f35ee4c jdk8-b110 75fd3486e584f20475c064a2cd4d01ac6406a511 jdk8-b111 6a4fdb3bb4e34af4c5bb8db467bb01e13b1a7e31 jdk8-b112 +676cd7bf5e092356f7ee2116c8cf88cdc12377c7 jdk8-b113 From 9620913796a9e2e774cad2902a63eac1cef8a58d Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Thu, 24 Oct 2013 16:23:07 -0700 Subject: [PATCH 12/36] 8026328: Setting a breakpoint on invokedynamic crashes the JVM Reviewed-by: jrose, roland --- .../src/cpu/sparc/vm/cppInterpreter_sparc.cpp | 2 +- .../sparc/vm/templateInterpreter_sparc.cpp | 41 +++------ .../src/cpu/sparc/vm/templateTable_sparc.cpp | 8 +- hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp | 2 +- .../cpu/x86/vm/templateInterpreter_x86_32.cpp | 40 +++------ .../cpu/x86/vm/templateInterpreter_x86_64.cpp | 30 ++----- .../src/cpu/x86/vm/templateTable_x86_32.cpp | 4 +- .../src/cpu/x86/vm/templateTable_x86_64.cpp | 4 +- .../src/cpu/zero/vm/cppInterpreter_zero.cpp | 2 +- hotspot/src/cpu/zero/vm/globals_zero.hpp | 2 + .../vm/interpreter/abstractInterpreter.hpp | 4 +- .../share/vm/interpreter/cppInterpreter.hpp | 2 +- .../src/share/vm/interpreter/interpreter.cpp | 18 ++-- .../vm/interpreter/templateInterpreter.cpp | 86 ++++++++++++++----- .../vm/interpreter/templateInterpreter.hpp | 18 ++-- .../templateInterpreterGenerator.hpp | 2 +- hotspot/src/share/vm/oops/method.cpp | 5 +- hotspot/src/share/vm/runtime/handles.cpp | 2 +- 18 files changed, 143 insertions(+), 129 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp index 5750e5f587f..371b6aa7f71 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp @@ -365,7 +365,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; } diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index b6f8a5a5d1a..40847f8c2df 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -153,13 +153,9 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; - - Label cont; - address compiled_entry = __ pc(); - +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); + #if !defined(_LP64) && defined(COMPILER2) // All return values are where we want them, except for Longs. C2 returns // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. @@ -170,14 +166,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // do this here. Unfortunately if we did a rethrow we'd see an machepilog node // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - if (incoming_state == ltos) { + if (state == ltos) { __ srl (G1, 0, O1); __ srlx(G1, 32, O0); } #endif // !_LP64 && COMPILER2 - __ bind(cont); - // The callee returns with the stack possibly adjusted by adapter transition // We remove that possible adjustment here. // All interpreter local registers are untouched. Any result is passed back @@ -186,28 +180,17 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ mov(Llast_SP, SP); // Remove any adapter added stack space. - Label L_got_cache, L_giant_index; const Register cache = G3_scratch; - const Register size = G1_scratch; - if (EnableInvokeDynamic) { - __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. - __ cmp_and_br_short(G1_scratch, Bytecodes::_invokedynamic, Assembler::equal, Assembler::pn, L_giant_index); - } - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); - __ bind(L_got_cache); - __ ld_ptr(cache, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset(), size); - __ and3(size, 0xFF, size); // argument size in words - __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes - __ add(Lesp, size, Lesp); // pop arguments - __ dispatch_next(state, step); + const Register index = G1_scratch; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4)); - __ ba_short(L_got_cache); - } + const Register flags = cache; + __ ld_ptr(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset(), flags); + const Register parameter_size = flags; + __ and3(flags, ConstantPoolCacheEntry::parameter_size_mask, parameter_size); // argument size in words + __ sll(parameter_size, Interpreter::logStackElementSize, parameter_size); // each argument size in bytes + __ add(Lesp, parameter_size, Lesp); // pop arguments + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index c3e8b298d6e..92098113cca 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -2932,9 +2932,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); AddressLiteral table(table_addr); __ set(table, temp); __ sll(ra, LogBytesPerWord, ra); @@ -2984,7 +2982,7 @@ void TemplateTable::invokevirtual(int byte_no) { __ verify_oop(O0_recv); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift @@ -3026,7 +3024,7 @@ void TemplateTable::invokevfinal_helper(Register Rscratch, Register Rret) { __ profile_final_call(O4); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp index 1eef095b9a5..e669f5b6638 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp @@ -367,7 +367,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 880b7732a0b..c7fc0472677 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -150,13 +150,12 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); #ifdef COMPILER2 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { for (int i = 1; i < 8; i++) { __ ffree(i); } @@ -164,7 +163,7 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ empty_FPU_stack(); } #endif - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled"); } else { __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); @@ -172,12 +171,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // In SSE mode, interpreter returns FP results in xmm0 but they need // to end up back on the FPU so it can operate on them. - if (incoming_state == ftos && UseSSE >= 1) { + if (state == ftos && UseSSE >= 1) { __ subptr(rsp, wordSize); __ movflt(Address(rsp, 0), xmm0); __ fld_s(Address(rsp, 0)); __ addptr(rsp, wordSize); - } else if (incoming_state == dtos && UseSSE >= 2) { + } else if (state == dtos && UseSSE >= 2) { __ subptr(rsp, 2*wordSize); __ movdbl(Address(rsp, 0), xmm0); __ fld_d(Address(rsp, 0)); @@ -194,32 +193,21 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - if (incoming_state == atos) { + if (state == atos) { Register mdp = rbx; Register tmp = rcx; __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset())); - __ andptr(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); - __ dispatch_next(state, step); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 39c49cc4346..ef1aa8409b9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -166,7 +166,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack @@ -183,27 +183,15 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, - in_bytes(ConstantPoolCache::base_offset()) + - 3 * wordSize)); - __ andl(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Address::times_8)); - __ dispatch_next(state, step); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 6e6033b02b6..3d07cb0ee32 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -2925,9 +2925,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr))); } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 8c49726e5ff..1da6efa85e0 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -2980,9 +2980,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ lea(rscratch1, table); __ movptr(flags, Address(rscratch1, flags, Address::times_ptr)); diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 42e88a7374b..27c9af71f17 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1006,7 +1006,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, istate->set_stack_limit(stack_base - method->max_stack() - 1); } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotCallThis(); return NULL; } diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 71b566fceb0..9a304c7f3fb 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -57,6 +57,8 @@ define_pd_global(bool, UseMembar, true); // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 0); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 4d7647ce05a..0ebfd1cdf13 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -158,8 +158,8 @@ class AbstractInterpreter: AllStatic { // Runtime support // length = invoke bytecode length (to advance to next bytecode) - static address deopt_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } - static address return_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } static address rethrow_exception_entry() { return _rethrow_exception_entry; } diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 4997a443257..71f78840b95 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -78,7 +78,7 @@ class CppInterpreter: public AbstractInterpreter { static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length); + static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); #ifdef TARGET_ARCH_x86 diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index dfd8b5b145a..60246e9013d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -329,15 +329,21 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { //------------------------------------------------------------------------------------------------------------------------ // Deoptimization support -// If deoptimization happens, this function returns the point of next bytecode to continue execution +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - int bci = method->bci_from(bcp); - int length = -1; // initial value for debugging + + const int bci = method->bci_from(bcp); + // compute continuation length - length = Bytecodes::length_at(method, bcp); + const int length = Bytecodes::length_at(method, bcp); + // compute result type BasicType type = T_ILLEGAL; @@ -393,7 +399,7 @@ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address return is_top_frame ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length); + : Interpreter::return_entry(as_TosState(type), length, code); } // If deoptimization happens, this function returns the point where the interpreter reexecutes diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 9f7ed4c7e97..e3e89e8eed9 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -184,8 +184,9 @@ EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deo EntryPoint TemplateInterpreter::_continuation_entry; EntryPoint TemplateInterpreter::_safept_entry; -address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; -address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; DispatchTable TemplateInterpreter::_active_table; DispatchTable TemplateInterpreter::_normal_table; @@ -237,22 +238,37 @@ void TemplateInterpreterGenerator::generate_all() { #endif // !PRODUCT { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); for (int i = 0; i < Interpreter::number_of_return_entries; i++) { Interpreter::_return_entry[i] = EntryPoint( - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(atos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(ltos, i), - generate_return_entry_for(ftos, i), - generate_return_entry_for(dtos, i), - generate_return_entry_for(vtos, i) + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) ); } } + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + { CodeletMark cm(_masm, "earlyret entry points"); Interpreter::_earlyret_entry = EntryPoint( @@ -298,13 +314,6 @@ void TemplateInterpreterGenerator::generate_all() { } } - for (int j = 0; j < number_of_states; j++) { - const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; - int index = Interpreter::TosState_as_index(states[j]); - Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); - Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); - } - { CodeletMark cm(_masm, "continuation entry points"); Interpreter::_continuation_entry = EntryPoint( @@ -534,9 +543,46 @@ void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState t //------------------------------------------------------------------------------------------------------------------------ // Entry points -address TemplateInterpreter::return_entry(TosState state, int length) { +/** + * Returns the return entry table for the given invoke bytecode. + */ +address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return Interpreter::invoke_return_entry_table(); + case Bytecodes::_invokeinterface: + return Interpreter::invokeinterface_return_entry_table(); + case Bytecodes::_invokedynamic: + return Interpreter::invokedynamic_return_entry_table(); + default: + fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code))); + return NULL; + } +} + +/** + * Returns the return entry address for the given top-of-stack state and bytecode. + */ +address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); - return _return_entry[length].entry(state); + const int index = TosState_as_index(state); + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return _invoke_return_entry[index]; + case Bytecodes::_invokeinterface: + return _invokeinterface_return_entry[index]; + case Bytecodes::_invokedynamic: + return _invokedynamic_return_entry[index]; + default: + assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code))); + return _return_entry[length].entry(state); + } } diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 43fe4bdb1c0..838e2e08473 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -120,8 +120,9 @@ class TemplateInterpreter: public AbstractInterpreter { static EntryPoint _continuation_entry; static EntryPoint _safept_entry; - static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries - static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries + static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries + static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries + static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) @@ -161,12 +162,15 @@ class TemplateInterpreter: public AbstractInterpreter { static address* normal_table() { return _normal_table.table_for(); } // Support for invokes - static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } - static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } - static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table + static address* invoke_return_entry_table() { return _invoke_return_entry; } + static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } + static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } + static int TosState_as_index(TosState state); - static address return_entry (TosState state, int length); - static address deopt_entry (TosState state, int length); + static address* invoke_return_entry_table_for(Bytecodes::Code code); + + static address deopt_entry(TosState state, int length); + static address return_entry(TosState state, int length, Bytecodes::Code code); // Safepoint support static void notice_safepoints(); // stops the thread when reaching a safepoint diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index fb7bdc5b6c2..a80caa96409 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -53,7 +53,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { address generate_ClassCastException_handler(); address generate_ArrayIndexOutOfBounds_handler(const char* name); address generate_continuation_for(TosState state); - address generate_return_entry_for(TosState state, int step); + address generate_return_entry_for(TosState state, int step, size_t index_size); address generate_earlyret_entry_for(TosState state); address generate_deopt_entry_for(TosState state, int step); address generate_safept_entry_for(TosState state, address runtime_entry); diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index c0b4a97fca0..7c292c3ffe5 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1515,7 +1515,10 @@ Bytecodes::Code Method::orig_bytecode_at(int bci) const { return bp->orig_bytecode(); } } - ShouldNotReachHere(); + { + ResourceMark rm; + fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci)); + } return Bytecodes::_shouldnotreachhere; } diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp index 1b4e9faecf9..ca73f86ba7f 100644 --- a/hotspot/src/share/vm/runtime/handles.cpp +++ b/hotspot/src/share/vm/runtime/handles.cpp @@ -45,7 +45,7 @@ oop* HandleArea::allocate_handle(oop obj) { assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); - assert(obj->is_oop(), "sanity check"); + assert(obj->is_oop(), err_msg("not an oop: " INTPTR_FORMAT, (intptr_t*) obj)); return real_allocate_handle(obj); } From c1f40ad95d1c64da03e4294c305865048224e045 Mon Sep 17 00:00:00 2001 From: David Dehaven Date: Thu, 24 Oct 2013 20:45:43 -0400 Subject: [PATCH 13/36] 8016096: [macosx] jawt_md.h shipped with jdk is outdated Revised build system and added platform specific headers for Mac OS X Reviewed-by: ihse, erikj --- common/autoconf/generated-configure.sh | 12 ++++++++++-- common/autoconf/platform.m4 | 7 +++++++ common/autoconf/spec.gmk.in | 1 + common/autoconf/toolchain.m4 | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 0c43de65644..34e2ef775e7 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -869,6 +869,7 @@ SRC_ROOT ZERO_ARCHDEF DEFINE_CROSS_COMPILE_ARCH LP64 +OPENJDK_TARGET_OS_EXPORT_DIR OPENJDK_TARGET_OS_API_DIR OPENJDK_TARGET_CPU_JLI_CFLAGS OPENJDK_TARGET_CPU_OSARCH @@ -3864,7 +3865,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1382540536 +DATE_WHEN_GENERATED=1382659005 ############################################################################### # @@ -7149,6 +7150,13 @@ $as_echo "$COMPILE_TYPE" >&6; } fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_OS_EXPORT_DIR=macosx + else + OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then A_LP64="LP64:=" # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in @@ -29638,7 +29646,7 @@ fi -I${JDK_OUTPUTDIR}/include \ -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ -I${JDK_TOPDIR}/src/share/javavm/export \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ -I${JDK_TOPDIR}/src/share/native/common \ -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 40c32526ca4..757bf227e78 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -327,6 +327,13 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], fi AC_SUBST(OPENJDK_TARGET_OS_API_DIR) + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_OS_EXPORT_DIR=macosx + else + OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} + fi + AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then A_LP64="LP64:=" # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a8cc664c178..3b08c6dc588 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -92,6 +92,7 @@ OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@ OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@ OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@ OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@ +OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@ # We are building on this build system. # When not cross-compiling, it is the same as the target. diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 5ad404d4fdd..c7cb93f2736 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -942,7 +942,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], -I${JDK_OUTPUTDIR}/include \ -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ -I${JDK_TOPDIR}/src/share/javavm/export \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ -I${JDK_TOPDIR}/src/share/native/common \ -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" From 93e44cac1e7bc50096a7d337a11ecc0c86660cba Mon Sep 17 00:00:00 2001 From: David Dehaven Date: Thu, 24 Oct 2013 20:46:23 -0400 Subject: [PATCH 14/36] 8016096: [macosx] jawt_md.h shipped with jdk is outdated Revised build system and added platform specific headers for Mac OS X Reviewed-by: anthony, art, ihse, erikj --- jdk/makefiles/CopyFiles.gmk | 2 +- jdk/makefiles/gensrc/GensrcX11Wrappers.gmk | 2 +- jdk/src/macosx/javavm/export/jawt_md.h | 77 ++++++++++++++++++ jdk/src/macosx/javavm/export/jni_md.h | 42 ++++++++++ jdk/src/macosx/javavm/export/jvm_md.h | 81 +++++++++++++++++++ .../macosx/native/sun/awt/AWTSurfaceLayers.h | 3 +- .../macosx/native/sun/awt/CMenuComponent.h | 2 +- jdk/src/macosx/native/sun/awt/jawt.m | 3 +- .../macosx/native/sun/font/CoreTextSupport.h | 2 +- jdk/src/share/javavm/export/jawt.h | 4 +- 10 files changed, 209 insertions(+), 9 deletions(-) create mode 100644 jdk/src/macosx/javavm/export/jawt_md.h create mode 100644 jdk/src/macosx/javavm/export/jni_md.h create mode 100644 jdk/src/macosx/javavm/export/jvm_md.h diff --git a/jdk/makefiles/CopyFiles.gmk b/jdk/makefiles/CopyFiles.gmk index 02bafafbbe8..0ac509cc7be 100644 --- a/jdk/makefiles/CopyFiles.gmk +++ b/jdk/makefiles/CopyFiles.gmk @@ -48,7 +48,7 @@ H_TARGET_FILES = $(INCLUDEDIR)/jdwpTransport.h \ $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h $(call install-file) -$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export/%.h +$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export/%.h $(call install-file) COPY_FILES = $(H_TARGET_FILES) diff --git a/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk b/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk index c6f7da80f74..4da4f37b2d9 100644 --- a/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk +++ b/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk @@ -99,7 +99,7 @@ ifneq ($(COMPILE_TYPE), cross) $(X_LIBS) \ -I$(JDK_OUTPUTDIR)/include \ -I$(JDK_TOPDIR)/src/share/javavm/export \ - -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export \ -I$(JDK_TOPDIR)/src/share/native/common \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \ diff --git a/jdk/src/macosx/javavm/export/jawt_md.h b/jdk/src/macosx/javavm/export/jawt_md.h new file mode 100644 index 00000000000..1d66461bf42 --- /dev/null +++ b/jdk/src/macosx/javavm/export/jawt_md.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +#ifndef _JAVASOFT_JAWT_MD_H_ +#define _JAVASOFT_JAWT_MD_H_ + +#include "jawt.h" + +#ifdef __OBJC__ +#import +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Mac OS X specific declarations for AWT native interface. + * See notes in jawt.h for an example of use. + */ + +/* + * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this + * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will + * return false. This is to maintain compatibility with applications that used the + * interface with Java 6 which had multiple rendering models. This flag is not necessary + * when JAWT version 1.7 or greater is used as this is the only supported rendering mode. + * + * Example: + * JAWT awt; + * awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER; + * jboolean success = JAWT_GetAWT(env, &awt); + */ +#define JAWT_MACOSX_USE_CALAYER 0x80000000 + +/* + * When the native Cocoa toolkit is in use, the pointer stored in + * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the + * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the + * specified layer to be overlaid on the Components rectangle. If the window the + * Component belongs to has a CALayer attached to it, this layer will be accessible via + * the windowLayer property. + */ +#ifdef __OBJC__ +@protocol JAWT_SurfaceLayers +@property (readwrite, retain) CALayer *layer; +@property (readonly) CALayer *windowLayer; +@end +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* !_JAVASOFT_JAWT_MD_H_ */ diff --git a/jdk/src/macosx/javavm/export/jni_md.h b/jdk/src/macosx/javavm/export/jni_md.h new file mode 100644 index 00000000000..9e47bedd61a --- /dev/null +++ b/jdk/src/macosx/javavm/export/jni_md.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT __attribute__((visibility("default"))) +#define JNIIMPORT __attribute__((visibility("default"))) +#define JNICALL + +typedef int jint; +#ifdef _LP64 /* 64-bit */ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/jdk/src/macosx/javavm/export/jvm_md.h b/jdk/src/macosx/javavm/export/jvm_md.h new file mode 100644 index 00000000000..012bb1babe2 --- /dev/null +++ b/jdk/src/macosx/javavm/export/jvm_md.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +#ifndef _JAVASOFT_JVM_MD_H_ +#define _JAVASOFT_JVM_MD_H_ + +/* + * This file is currently collecting system-specific dregs for the + * JNI conversion, which should be sorted out later. + */ + +#include /* For DIR */ +#include /* For MAXPATHLEN */ +#include /* For F_OK, R_OK, W_OK */ +#include /* For ptrdiff_t */ +#include /* For uintptr_t */ + +#define JNI_ONLOAD_SYMBOLS {"JNI_OnLoad"} +#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"} + +#define JNI_LIB_PREFIX "lib" +#define JNI_LIB_SUFFIX ".dylib" +#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX +#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX + +#define JVM_MAXPATHLEN MAXPATHLEN + +#define JVM_R_OK R_OK +#define JVM_W_OK W_OK +#define JVM_X_OK X_OK +#define JVM_F_OK F_OK + +/* + * File I/O + */ + +#include +#include +#include +#include +#include + +/* O Flags */ + +#define JVM_O_RDONLY O_RDONLY +#define JVM_O_WRONLY O_WRONLY +#define JVM_O_RDWR O_RDWR +#define JVM_O_O_APPEND O_APPEND +#define JVM_O_EXCL O_EXCL +#define JVM_O_CREAT O_CREAT +#define JVM_O_DELETE 0x10000 + +/* Signals */ + +#define JVM_SIGINT SIGINT +#define JVM_SIGTERM SIGTERM + + +#endif /* !_JAVASOFT_JVM_MD_H_ */ diff --git a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h index 820be377358..58aec0b6126 100644 --- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h +++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h @@ -23,8 +23,7 @@ * questions. */ -// REMIND: import -#import +#import /* * The CALayer-based rendering model returns an object conforming diff --git a/jdk/src/macosx/native/sun/awt/CMenuComponent.h b/jdk/src/macosx/native/sun/awt/CMenuComponent.h index 2e0a6454285..e5aff96c48b 100644 --- a/jdk/src/macosx/native/sun/awt/CMenuComponent.h +++ b/jdk/src/macosx/native/sun/awt/CMenuComponent.h @@ -24,7 +24,7 @@ */ #import -#import +#import @interface CMenuComponent : NSObject { diff --git a/jdk/src/macosx/native/sun/awt/jawt.m b/jdk/src/macosx/native/sun/awt/jawt.m index c295665fbf6..96669ef6e52 100644 --- a/jdk/src/macosx/native/sun/awt/jawt.m +++ b/jdk/src/macosx/native/sun/awt/jawt.m @@ -25,8 +25,7 @@ #import -// REMIND: import -#import +#import #import "awt_DrawingSurface.h" diff --git a/jdk/src/macosx/native/sun/font/CoreTextSupport.h b/jdk/src/macosx/native/sun/font/CoreTextSupport.h index 03735449266..467694d577a 100644 --- a/jdk/src/macosx/native/sun/font/CoreTextSupport.h +++ b/jdk/src/macosx/native/sun/font/CoreTextSupport.h @@ -24,7 +24,7 @@ */ #import -#import +#import #import #include "AWTFont.h" diff --git a/jdk/src/share/javavm/export/jawt.h b/jdk/src/share/javavm/export/jawt.h index be443a319b3..eb7fe4f15a2 100644 --- a/jdk/src/share/javavm/export/jawt.h +++ b/jdk/src/share/javavm/export/jawt.h @@ -154,7 +154,9 @@ typedef struct jawt_DrawingSurfaceInfo { /* * Pointer to the platform-specific information. This can be safely * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a - * JAWT_X11DrawingSurfaceInfo on Solaris. See jawt_md.h for details. + * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X this is a + * pointer to a NSObject that conforms to the JAWT_SurfaceLayers + * protocol. See jawt_md.h for details. */ void* platformInfo; /* Cached pointer to the underlying drawing surface */ From be6a9b1f9c19b0fe0f5eb8bbcff5d5387ccba986 Mon Sep 17 00:00:00 2001 From: David Dehaven Date: Thu, 24 Oct 2013 20:47:18 -0400 Subject: [PATCH 15/36] 8025673: [macosx] Disable X11 AWT toolkit Disable but not completely remove the XAWT and headless toolkits on Mac OS X Reviewed-by: dholmes --- hotspot/src/os/bsd/vm/os_bsd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index f182b2af88d..d1afaabf74d 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -4746,6 +4746,10 @@ int os::fork_and_exec(char* cmd) { // as libawt.so, and renamed libawt_xawt.so // bool os::is_headless_jre() { +#ifdef __APPLE__ + // We no longer build headless-only on Mac OS X + return false; +#else struct stat statbuf; char buf[MAXPATHLEN]; char libmawtpath[MAXPATHLEN]; @@ -4777,6 +4781,7 @@ bool os::is_headless_jre() { if (::stat(libmawtpath, &statbuf) == 0) return false; return true; +#endif } // Get the default path to the core file From 6c747ded77cb2bd8aa8f3e1eb9fb49ffe02ae378 Mon Sep 17 00:00:00 2001 From: David Dehaven Date: Thu, 24 Oct 2013 20:47:41 -0400 Subject: [PATCH 16/36] 8025673: [macosx] Disable X11 AWT toolkit Disable but not completely remove the XAWT and headless toolkits on Mac OS X Reviewed-by: anthony, art, ihse, erikj --- jdk/makefiles/CompileJavaClasses.gmk | 12 +-- jdk/makefiles/GenerateSources.gmk | 16 ++-- jdk/makefiles/Tools.gmk | 2 +- jdk/makefiles/lib/Awt2dLibraries.gmk | 77 ++++++------------- jdk/src/share/native/java/lang/System.c | 5 ++ jdk/src/share/native/java/lang/java_props.h | 2 + .../native/java/lang/java_props_macosx.c | 37 ++------- .../native/java/lang/java_props_macosx.h | 8 +- .../solaris/native/java/lang/java_props_md.c | 35 ++------- jdk/src/solaris/native/sun/awt/fontpath.c | 42 ++-------- .../WrappedToolkitTest/WrappedToolkitTest.sh | 22 ++++++ 11 files changed, 90 insertions(+), 168 deletions(-) diff --git a/jdk/makefiles/CompileJavaClasses.gmk b/jdk/makefiles/CompileJavaClasses.gmk index 88d50a5db0e..740222661b3 100644 --- a/jdk/makefiles/CompileJavaClasses.gmk +++ b/jdk/makefiles/CompileJavaClasses.gmk @@ -96,11 +96,7 @@ ifneq ($(OPENJDK_TARGET_OS), solaris) EXCLUDES += com/oracle/security endif -# In the old build, this isn't excluded on macosx, even though it probably -# should be. -ifneq ($(OPENJDK_TARGET_OS), macosx) - EXFILES += WrapperGenerator.java -endif +EXFILES += WrapperGenerator.java ifneq ($(OPENJDK_TARGET_OS), windows) # Exclude Window security related files in src/share/classes @@ -169,7 +165,11 @@ ifeq (, $(filter $(OPENJDK_TARGET_OS), windows macosx)) EXFILES += sun/awt/AWTCharset.java endif -ifneq ($(OPENJDK_TARGET_OS), macosx) +ifeq ($(OPENJDK_TARGET_OS), macosx) + # exclude all X11 on Mac, we can't exclude some like below or we'll have compilation errors + EXCLUDES += sun/awt/X11 +else + # TBD: figure out how to eliminate this long list EXFILES += sun/awt/X11/ScreenFormat.java \ sun/awt/X11/XArc.java \ sun/awt/X11/XChar2b.java \ diff --git a/jdk/makefiles/GenerateSources.gmk b/jdk/makefiles/GenerateSources.gmk index 5246cc97698..7674fcd3744 100644 --- a/jdk/makefiles/GenerateSources.gmk +++ b/jdk/makefiles/GenerateSources.gmk @@ -66,15 +66,17 @@ include gensrc/GensrcExceptions.gmk GENSRC += $(GENSRC_EXCEPTIONS) ifneq ($(OPENJDK_TARGET_OS), windows) -include gensrc/GensrcIcons.gmk -GENSRC += $(GENSRC_AWT_ICONS) + include gensrc/GensrcIcons.gmk + GENSRC += $(GENSRC_AWT_ICONS) -ifeq ($(OPENJDK_TARGET_OS), macosx) -GENSRC += $(GENSRC_OSX_ICONS) -endif + ifeq ($(OPENJDK_TARGET_OS), macosx) + GENSRC += $(GENSRC_OSX_ICONS) + endif -include gensrc/GensrcX11Wrappers.gmk -GENSRC += $(GENSRC_X11WRAPPERS) + ifneq ($(OPENJDK_TARGET_OS), macosx) + include gensrc/GensrcX11Wrappers.gmk + GENSRC += $(GENSRC_X11WRAPPERS) + endif endif include gensrc/GensrcCLDR.gmk diff --git a/jdk/makefiles/Tools.gmk b/jdk/makefiles/Tools.gmk index 49a3c61448a..d6d994a1582 100644 --- a/jdk/makefiles/Tools.gmk +++ b/jdk/makefiles/Tools.gmk @@ -32,7 +32,7 @@ TOOLS_SRC := $(JDK_TOPDIR)/make/tools/src \ $(JDK_TOPDIR)/makefiles/sun/osxapp \ $(JDK_TOPDIR)/make/tools/swing-beans -ifneq ($(OPENJDK_TARGET_OS), windows) +ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) TOOLS_SRC += $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator endif diff --git a/jdk/makefiles/lib/Awt2dLibraries.gmk b/jdk/makefiles/lib/Awt2dLibraries.gmk index 9d1caa2ba98..c58187a2340 100644 --- a/jdk/makefiles/lib/Awt2dLibraries.gmk +++ b/jdk/makefiles/lib/Awt2dLibraries.gmk @@ -226,7 +226,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d -else +else ifneq ($(OPENJDK_TARGET_OS), macosx) LIBAWT_DIRS += \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 endif @@ -509,15 +509,7 @@ BUILD_LIBRARIES += $(BUILD_LIBAWT) ########################################################################################## -# TODO!! -# Even though this variable as a general name, it is -# only used on macos, in fontpath.c, as prefix for where to find fonts. -# -# It's used for libawt_headless _and_ libawt_xawt -# -X11_PATH := /usr/X11R6 - -ifneq ($(OPENJDK_TARGET_OS), windows) +ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) ifndef BUILD_HEADLESS_ONLY LIBAWT_XAWT_DIRS := \ @@ -532,7 +524,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \ LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \ - -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ + -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ $(CUPS_CFLAGS) \ $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ @@ -627,11 +619,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows) LIBAWT_XAWT_LDFLAGS += -lpthread endif - ifeq ($(OPENJDK_TARGET_OS), macosx) - LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread - endif - - # On macosx, the shared library origin is set twice for this lib. $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \ LIBRARY := awt_xawt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -653,10 +640,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows) -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ - LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN) \ - $(call SET_SHARED_LIBRARY_ORIGIN). \ - $(call SET_SHARED_LIBRARY_ORIGIN) \ - $(call SET_SHARED_LIBRARY_ORIGIN)., \ LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ @@ -788,6 +771,11 @@ ifeq ($(OPENJDK_TARGET_OS), windows) LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ X11TextRenderer.c LIBFONTMANAGER_OPTIMIZATION := HIGHEST +else ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ + X11TextRenderer.c \ + fontpath.c \ + lcdglyph.c else LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \ lcdglyph.c @@ -845,7 +833,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) -ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris macosx)) +ifeq ($(OPENJDK_TARGET_OS), solaris) $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT) endif @@ -947,22 +935,21 @@ ifeq ($(OPENJDK_TARGET_OS), windows) else # OPENJDK_TARGET_OS not windows - JAWT_LIBS := - ifneq ($(OPENJDK_TARGET_OS), solaris) - JAWT_LIBS += -lawt - endif - - ifndef BUILD_HEADLESS_ONLY - JAWT_LIBS += -lawt_xawt - else - JAWT_LIBS += -lawt_headless - HEADLESS_CFLAG += -DHEADLESS - endif - - JAWT_FILES := jawt.c ifeq ($(OPENJDK_TARGET_OS), macosx) JAWT_FILES := jawt.m JAWT_LIBS := -lawt_lwawt + else + JAWT_FILES := jawt.c + JAWT_LIBS := + ifneq ($(OPENJDK_TARGET_OS), solaris) + JAWT_LIBS += -lawt + endif + ifndef BUILD_HEADLESS_ONLY + JAWT_LIBS += -lawt_xawt + else + JAWT_LIBS += -lawt_headless + HEADLESS_CFLAG += -DHEADLESS + endif endif $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \ @@ -1094,7 +1081,8 @@ endif ########################################################################################## ifeq ($(BUILD_HEADLESS), true) - ifneq ($(OPENJDK_TARGET_OS), windows) + # Mac and Windows only use the native AWT lib, do not build libawt_headless + ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),) LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \ $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ @@ -1108,7 +1096,7 @@ ifeq ($(BUILD_HEADLESS), true) endif LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \ - -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ + -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ $(CUPS_CFLAGS) \ $(X_CFLAGS) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ @@ -1155,16 +1143,6 @@ ifeq ($(BUILD_HEADLESS), true) AccelGlyphCache.c \ CUPSfuncs.c - ifeq ($(OPENJDK_TARGET_OS), macosx) - LIBAWT_HEADLESS_FILES += \ - AWTFont.m \ - AWTStrike.m \ - CCharToGlyphMapper.m \ - CGGlyphImages.m \ - CGGlyphOutlines.m \ - CoreTextSupport.m - endif - LIBAWT_HEADLESS_REORDER := ifeq ($(OPENJDK_TARGET_OS), solaris) ifneq ($(OPENJDK_TARGET_CPU), x86_64) @@ -1191,13 +1169,6 @@ ifeq ($(BUILD_HEADLESS), true) REORDER := $(LIBAWT_HEADLESS_REORDER), \ LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \ LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \ - LDFLAGS_SUFFIX_macosx := -ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \ - -framework Accelerate \ - -framework ApplicationServices \ - -framework Cocoa \ - -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ - -framework JavaNativeFoundation \ - -framework JavaRuntimeSupport, \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) diff --git a/jdk/src/share/native/java/lang/System.c b/jdk/src/share/native/java/lang/System.c index faef4b09314..660b21e68e1 100644 --- a/jdk/src/share/native/java/lang/System.c +++ b/jdk/src/share/native/java/lang/System.c @@ -206,6 +206,11 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props) if (sprops->awt_toolkit) { PUTPROP(props, "awt.toolkit", sprops->awt_toolkit); } +#ifdef MACOSX + if (sprops->awt_headless) { + PUTPROP(props, "java.awt.headless", sprops->awt_headless); + } +#endif /* os properties */ PUTPROP(props, "os.name", sprops->os_name); diff --git a/jdk/src/share/native/java/lang/java_props.h b/jdk/src/share/native/java/lang/java_props.h index 86a69d7a124..bf0f76a025f 100644 --- a/jdk/src/share/native/java/lang/java_props.h +++ b/jdk/src/share/native/java/lang/java_props.h @@ -116,6 +116,8 @@ typedef struct { char *gopherPort; char *exceptionList; + + char *awt_headless /* java.awt.headless setting, if NULL (default) will not be set */ #endif } java_props_t; diff --git a/jdk/src/solaris/native/java/lang/java_props_macosx.c b/jdk/src/solaris/native/java/lang/java_props_macosx.c index 13fc80d3052..1f0248ee558 100644 --- a/jdk/src/solaris/native/java/lang/java_props_macosx.c +++ b/jdk/src/solaris/native/java/lang/java_props_macosx.c @@ -105,40 +105,17 @@ char *setupMacOSXLocale(int cat) { } } -/* There are several toolkit options on Mac OS X, so we should try to - * pick the "best" one, given what we know about the environment Java - * is running under - */ - -static PreferredToolkit getPreferredToolkitFromEnv() { - char *envVar = getenv("AWT_TOOLKIT"); - if (envVar == NULL) return unset; - - if (strcasecmp(envVar, "CToolkit") == 0) return CToolkit; - if (strcasecmp(envVar, "XToolkit") == 0) return XToolkit; - if (strcasecmp(envVar, "HToolkit") == 0) return HToolkit; - return unset; -} - -static bool isInAquaSession() { +int isInAquaSession() { // Is the WindowServer available? SecuritySessionId session_id; SessionAttributeBits session_info; OSStatus status = SessionGetInfo(callerSecuritySession, &session_id, &session_info); - if (status != noErr) return false; - if (!(session_info & sessionHasGraphicAccess)) return false; - return true; -} - -PreferredToolkit getPreferredToolkit() { - static PreferredToolkit pref = unset; - if (pref != unset) return pref; - - PreferredToolkit prefFromEnv = getPreferredToolkitFromEnv(); - if (prefFromEnv != unset) return pref = prefFromEnv; - - if (isInAquaSession()) return pref = CToolkit; - return pref = HToolkit; + if (status == noErr) { + if (session_info & sessionHasGraphicAccess) { + return 1; + } + } + return 0; } void setOSNameAndVersion(java_props_t *sprops) { diff --git a/jdk/src/solaris/native/java/lang/java_props_macosx.h b/jdk/src/solaris/native/java/lang/java_props_macosx.h index 19ec220ed4b..df6fc457da2 100644 --- a/jdk/src/solaris/native/java/lang/java_props_macosx.h +++ b/jdk/src/solaris/native/java/lang/java_props_macosx.h @@ -29,10 +29,4 @@ char *setupMacOSXLocale(int cat); void setOSNameAndVersion(java_props_t *sprops); void setUserHome(java_props_t *sprops); void setProxyProperties(java_props_t *sProps); - -enum PreferredToolkit_enum { - unset = 0, CToolkit, XToolkit, HToolkit -}; -typedef enum PreferredToolkit_enum PreferredToolkit; - -PreferredToolkit getPreferredToolkit(); +int isInAquaSession(); diff --git a/jdk/src/solaris/native/java/lang/java_props_md.c b/jdk/src/solaris/native/java/lang/java_props_md.c index 894973d7c74..1830b20fd0c 100644 --- a/jdk/src/solaris/native/java/lang/java_props_md.c +++ b/jdk/src/solaris/native/java/lang/java_props_md.c @@ -454,40 +454,21 @@ GetJavaProperties(JNIEnv *env) /* patches/service packs installed */ sprops.patch_level = "unknown"; - /* Java 2D properties */ + /* Java 2D/AWT properties */ #ifdef MACOSX - PreferredToolkit prefToolkit = getPreferredToolkit(); - switch (prefToolkit) { - case CToolkit: - case HToolkit: - sprops.graphics_env = "sun.awt.CGraphicsEnvironment"; - break; - case XToolkit: -#endif + // Always the same GraphicsEnvironment and Toolkit on Mac OS X + sprops.graphics_env = "sun.awt.CGraphicsEnvironment"; + sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit"; + + // check if we're in a GUI login session and set java.awt.headless=true if not + sprops.awt_headless = isInAquaSession() ? NULL : "true"; +#else sprops.graphics_env = "sun.awt.X11GraphicsEnvironment"; -#ifdef MACOSX - break; - } -#endif - /* AWT properties */ #ifdef JAVASE_EMBEDDED sprops.awt_toolkit = getEmbeddedToolkit(); if (sprops.awt_toolkit == NULL) // default as below -#endif -#ifdef MACOSX - switch (prefToolkit) { - case CToolkit: - sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit"; - break; - case XToolkit: #endif sprops.awt_toolkit = "sun.awt.X11.XToolkit"; -#ifdef MACOSX - break; - default: - sprops.awt_toolkit = "sun.awt.HToolkit"; - break; - } #endif /* This is used only for debugging of font problems. */ diff --git a/jdk/src/solaris/native/sun/awt/fontpath.c b/jdk/src/solaris/native/sun/awt/fontpath.c index 00d95691169..12c8405beae 100644 --- a/jdk/src/solaris/native/sun/awt/fontpath.c +++ b/jdk/src/solaris/native/sun/awt/fontpath.c @@ -23,7 +23,7 @@ * questions. */ -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) #include #endif /* __linux__ */ #include @@ -59,26 +59,12 @@ extern Display *awt_display; #endif /* !HEADLESS */ -#ifdef MACOSX - -// -// XXXDARWIN: Hard-code the path to Apple's fontconfig, as it is -// not included in the dyld search path by default, and 10.4 -// does not support -rpath. -// -// This ignores the build time setting of ALT_FREETYPE_LIB_PATH, -// and should be replaced with -rpath/@rpath support on 10.5 or later, -// or via support for a the FREETYPE_LIB_PATH define. -#define FONTCONFIG_DLL_VERSIONED X11_PATH "/lib/" VERSIONED_JNI_LIB_NAME("fontconfig", "1") -#define FONTCONFIG_DLL X11_PATH "/lib/" JNI_LIB_NAME("fontconfig") -#else #define FONTCONFIG_DLL_VERSIONED VERSIONED_JNI_LIB_NAME("fontconfig", "1") #define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig") -#endif #define MAXFDIRS 512 /* Max number of directories that contain fonts */ -#if !defined(__linux__) && !defined(MACOSX) +#if !defined(__linux__) /* * This can be set in the makefile to "/usr/X11" if so desired. */ @@ -128,22 +114,6 @@ static char *fullSolarisFontPath[] = { NULL, /* terminates the list */ }; -#elif MACOSX -static char *full_MACOSX_X11FontPath[] = { - X11_PATH "/lib/X11/fonts/TrueType", - X11_PATH "/lib/X11/fonts/truetype", - X11_PATH "/lib/X11/fonts/tt", - X11_PATH "/lib/X11/fonts/TTF", - X11_PATH "/lib/X11/fonts/OTF", - PACKAGE_PATH "/share/fonts/TrueType", - PACKAGE_PATH "/share/fonts/truetype", - PACKAGE_PATH "/share/fonts/tt", - PACKAGE_PATH "/share/fonts/TTF", - PACKAGE_PATH "/share/fonts/OTF", - X11_PATH "/lib/X11/fonts/Type1", - PACKAGE_PATH "/share/fonts/Type1", - NULL, /* terminates the list */ -}; #else /* __linux */ /* All the known interesting locations we have discovered on * various flavors of Linux @@ -400,7 +370,7 @@ static char **getX11FontPath () #endif /* !HEADLESS */ -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) /* from awt_LoadLibrary.c */ JNIEXPORT jboolean JNICALL AWTIsHeadless(); #endif @@ -527,8 +497,6 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) { #if defined(__linux__) knowndirs = fullLinuxFontPath; -#elif defined(MACOSX) - knowndirs = full_MACOSX_X11FontPath; #else /* IF SOLARIS */ knowndirs = fullSolarisFontPath; #endif @@ -539,7 +507,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) { * be initialised. */ #ifndef HEADLESS -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) /* There's no headless build on linux ... */ if (!AWTIsHeadless()) { /* .. so need to call a function to check */ #endif @@ -555,7 +523,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) { x11dirs = getX11FontPath(); } AWT_UNLOCK(); -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) } #endif #endif /* !HEADLESS */ diff --git a/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh b/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh index 125dac7eb20..977f1b47361 100644 --- a/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh +++ b/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh @@ -77,6 +77,12 @@ case "$OS" in FILESEP="\\" ;; + Darwin) + VAR="Lets not forget about Mac" + DEFAULT_JDK=$(/usr/libexec/java_home) + FILESEP="/" + ;; + # catch all other OSs * ) echo "Unrecognized system! $OS" @@ -171,6 +177,22 @@ case "$OS" in fi ;; + Darwin) + ${TESTJAVA}/bin/java -Djava.awt.headless=true \ + TestWrapped sun.lwawt.macosx.LWCToolkit + status=$? + if [ ! $status -eq "0" ]; then + fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit"; + fi + ${TESTJAVA}/bin/java -Djava.awt.headless=true \ + -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit \ + TestWrapped sun.lwawt.macosx.LWCToolkit + status=$? + if [ ! $status -eq "0" ]; then + fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit"; + fi + ;; + esac pass "All the tests are PASSED"; From 86cd1aaa73ba274ccfad81936af7c4b119c76c9d Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Thu, 24 Oct 2013 22:19:48 -0700 Subject: [PATCH 17/36] 8020753: JNI_CreateJavaVM on Mac OSX 10.9 Mavericks corrupts the callers stack size Use hard-coded DEFAULT_MAIN_THREAD_STACK_PAGES = 2048 for 10.9 Reviewed-by: dcubed, iveresov --- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index ad3ebb2ead9..a1d7075af55 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -79,6 +79,15 @@ # include #endif +// needed by current_stack_region() workaround for Mavericks +#if defined(__APPLE__) +# include +# include +# include +# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 +# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 +#endif + #ifdef AMD64 #define SPELL_REG_SP "rsp" #define SPELL_REG_FP "rbp" @@ -828,6 +837,21 @@ static void current_stack_region(address * bottom, size_t * size) { pthread_t self = pthread_self(); void *stacktop = pthread_get_stackaddr_np(self); *size = pthread_get_stacksize_np(self); + // workaround for OS X 10.9.0 (Mavericks) + // pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages + if (pthread_main_np() == 1) { + if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) { + char kern_osrelease[256]; + size_t kern_osrelease_size = sizeof(kern_osrelease); + int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0); + if (ret == 0) { + // get the major number, atoi will ignore the minor amd micro portions of the version string + if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) { + *size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize()); + } + } + } + } *bottom = (address) stacktop - *size; #elif defined(__OpenBSD__) stack_t ss; From 76ac5b0c2835f4e35be9443ac28eae6185818f2d Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Fri, 25 Oct 2013 09:07:58 +0200 Subject: [PATCH 18/36] 8027294: Prepare hotspot for non TOD based uptime counter Use HR timer when available for os::elapsed_counter() on linux/bsd. Add a new counter for the JVM uptime. Reviewed-by: dholmes, sla --- hotspot/src/os/bsd/vm/os_bsd.cpp | 10 ++++------ hotspot/src/os/linux/vm/os_linux.cpp | 10 ++++------ hotspot/src/share/vm/services/jmm.h | 1 + hotspot/src/share/vm/services/management.cpp | 3 +++ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index f182b2af88d..549ab6a3d74 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -945,17 +945,15 @@ extern "C" Thread* get_thread() { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -3582,7 +3580,7 @@ void os::init(void) { Bsd::_main_thread = pthread_self(); Bsd::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); #ifdef __APPLE__ // XXXDARWIN diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 3aeb1b70484..1bb32901540 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1333,17 +1333,15 @@ void os::Linux::capture_initial_stack(size_t max_size) { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); // nanosecond resolution } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -4750,7 +4748,7 @@ void os::init(void) { Linux::_main_thread = pthread_self(); Linux::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); // pthread_condattr initialization for monotonic clock int status; diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h index 9f46499b4e8..e0a748a41d5 100644 --- a/hotspot/src/share/vm/services/jmm.h +++ b/hotspot/src/share/vm/services/jmm.h @@ -78,6 +78,7 @@ typedef enum { JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */ JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */ JMM_GC_COUNT = 10, /* Total number of collections */ + JMM_JVM_UPTIME_MS = 11, /* The JVM uptime in milliseconds */ JMM_INTERNAL_ATTRIBUTE_INDEX = 100, JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */ diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 9c87989601b..9585960daa2 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -1032,6 +1032,9 @@ static jlong get_long_attribute(jmmLongAttribute att) { case JMM_JVM_INIT_DONE_TIME_MS: return Management::vm_init_done_time(); + case JMM_JVM_UPTIME_MS: + return Management::ticks_to_ms(os::elapsed_counter()); + case JMM_COMPILE_TOTAL_TIME_MS: return Management::ticks_to_ms(CompileBroker::total_compilation_ticks()); From d9f039a45849c36565968fcbd940858cd543c361 Mon Sep 17 00:00:00 2001 From: Niclas Adlertz Date: Fri, 25 Oct 2013 10:13:40 +0200 Subject: [PATCH 19/36] 8026940: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc Remove input to junk phi if they also become dead during post_allocate_copy_removal Reviewed-by: roland --- hotspot/src/share/vm/opto/postaloc.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp index 76de2ed16a1..2ad809d1a58 100644 --- a/hotspot/src/share/vm/opto/postaloc.cpp +++ b/hotspot/src/share/vm/opto/postaloc.cpp @@ -97,7 +97,8 @@ int PhaseChaitin::yank( Node *old, Block *current_block, Node_List *value, Node_ static bool expected_yanked_node(Node *old, Node *orig_old) { // This code is expected only next original nodes: // - load from constant table node which may have next data input nodes: - // MachConstantBase, Phi, MachTemp, MachSpillCopy + // MachConstantBase, MachTemp, MachSpillCopy + // - Phi nodes that are considered Junk // - load constant node which may have next data input nodes: // MachTemp, MachSpillCopy // - MachSpillCopy @@ -112,7 +113,9 @@ static bool expected_yanked_node(Node *old, Node *orig_old) { return (old == orig_old); } else if (old->is_MachTemp()) { return orig_old->is_Con(); - } else if (old->is_Phi() || old->is_MachConstantBase()) { + } else if (old->is_Phi()) { // Junk phi's + return true; + } else if (old->is_MachConstantBase()) { return (orig_old->is_Con() && orig_old->is_MachConstant()); } return false; @@ -522,11 +525,9 @@ void PhaseChaitin::post_allocate_copy_removal() { u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } if (u != NodeSentinel) { // Junk Phi. Remove - block->remove_node(j--); - phi_dex--; - _cfg.unmap_node_from_block(phi); phi->replace_by(u); - phi->disconnect_inputs(NULL, C); + j -= yank_if_dead(phi, block, &value, ®nd); + phi_dex--; continue; } // Note that if value[pidx] exists, then we merged no new values here From 320d333208dbd5b8a4c8c18f433b07e8bd8859a0 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 25 Oct 2013 13:58:09 +0200 Subject: [PATCH 20/36] 8027300: configure should use LIBS instead of LDFLAGS when testing freetype Reviewed-by: erikj --- common/autoconf/generated-configure.sh | 8 ++++---- common/autoconf/libraries.m4 | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 34e2ef775e7..97c1733d451 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -3865,7 +3865,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1382659005 +DATE_WHEN_GENERATED=1382702260 ############################################################################### # @@ -34253,10 +34253,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" + PREV_LIBS="$LIBS" PREV_CXX="$CXX" CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $FREETYPE_LIBS" + LIBS="$LIBS $FREETYPE_LIBS" CXX="$FIXPATH $CXX" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -34323,7 +34323,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" + LIBS="$PREV_LIBS" CXX="$PREV_CXX" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index c41da30a70b..c2cc3794429 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -481,10 +481,10 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], AC_MSG_CHECKING([if we can compile and link with freetype]) AC_LANG_PUSH(C++) PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" + PREV_LIBS="$LIBS" PREV_CXX="$CXX" CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $FREETYPE_LIBS" + LIBS="$LIBS $FREETYPE_LIBS" CXX="$FIXPATH $CXX" AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include @@ -508,7 +508,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ] ) CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" + LIBS="$PREV_LIBS" CXX="$PREV_CXX" AC_LANG_POP(C++) From bf7f4866ebcae66ab0c3539b1f8f9a1d45d1d3fa Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Fri, 25 Oct 2013 11:05:32 -0400 Subject: [PATCH 21/36] 8026822: metaspace/flags/maxMetaspaceSize throws OOM of unexpected type.java.lang.OutOfMemoryError: Compressed class space Incorporate chunk size when seeing if OutOfMemoryError was caused by Metaspace or Compressed class space. Reviewed-by: stefank, coleenp --- hotspot/src/share/vm/memory/metaspace.cpp | 21 ++++++++++++++++++--- hotspot/src/share/vm/memory/metaspace.hpp | 3 +++ hotspot/src/share/vm/memory/universe.cpp | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 9b321de4c44..c87ecf81fb2 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -3312,6 +3312,11 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, return result; } +size_t Metaspace::class_chunk_size(size_t word_size) { + assert(using_class_space(), "Has to use class space"); + return class_vsm()->calc_chunk_size(word_size); +} + void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { // If result is still null, we are out of memory. if (Verbose && TraceMetadataChunkAllocation) { @@ -3323,9 +3328,19 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s MetaspaceAux::dump(gclog_or_tty); } + bool out_of_compressed_class_space = false; + if (is_class_space_allocation(mdtype)) { + Metaspace* metaspace = loader_data->metaspace_non_null(); + out_of_compressed_class_space = + MetaspaceAux::committed_bytes(Metaspace::ClassType) + + (metaspace->class_chunk_size(word_size) * BytesPerWord) > + CompressedClassSpaceSize; + } + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - const char* space_string = is_class_space_allocation(mdtype) ? "Compressed class space" : - "Metadata space"; + const char* space_string = out_of_compressed_class_space ? + "Compressed class space" : "Metaspace"; + report_java_out_of_memory(space_string); if (JvmtiExport::should_post_resource_exhausted()) { @@ -3338,7 +3353,7 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s vm_exit_during_initialization("OutOfMemoryError", space_string); } - if (is_class_space_allocation(mdtype)) { + if (out_of_compressed_class_space) { THROW_OOP(Universe::out_of_memory_error_class_metaspace()); } else { THROW_OOP(Universe::out_of_memory_error_metaspace()); diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index 974a1aac62d..925c2177a2a 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -192,6 +192,8 @@ class Metaspace : public CHeapObj { AllocRecord * _alloc_record_head; AllocRecord * _alloc_record_tail; + size_t class_chunk_size(size_t word_size); + public: Metaspace(Mutex* lock, MetaspaceType type); @@ -252,6 +254,7 @@ class Metaspace : public CHeapObj { static bool is_class_space_allocation(MetadataType mdType) { return mdType == ClassType && using_class_space(); } + }; class MetaspaceAux : AllStatic { diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 1f632ae478f..63775ae1deb 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1029,7 +1029,7 @@ bool universe_post_init() { Handle msg = java_lang_String::create_from_str("Java heap space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_java_heap, msg()); - msg = java_lang_String::create_from_str("Metadata space", CHECK_false); + msg = java_lang_String::create_from_str("Metaspace", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg()); msg = java_lang_String::create_from_str("Compressed class space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg()); From 4002278f342ab7a538eab40fca2b7fff80ef85bf Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 25 Oct 2013 10:15:33 -0700 Subject: [PATCH 22/36] 8027117: adapt JDK-7165611 to new build-infra whitespace/indent policy Fix whitespace/indent issues. Reviewed-by: hseigel, coleenp, erikj, ihse --- common/autoconf/basics.m4 | 2 +- common/autoconf/generated-configure.sh | 10 +-- common/autoconf/jdk-options.m4 | 10 +-- common/makefiles/NativeCompilation.gmk | 118 ++++++++++++------------- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 74eb88ad814..1d51a304503 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -656,7 +656,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) + BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) BASIC_REQUIRE_PROG(XATTR, xattr) AC_PATH_PROG(CODESIGN, codesign) if test "x$CODESIGN" != "x"; then diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 97c1733d451..8476ff7e448 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -29913,11 +29913,11 @@ $as_echo_n "checking if we should generate debug symbols... " >&6; } elif test "x$enable_debug_symbols" = "xno"; then ENABLE_DEBUG_SYMBOLS=false else - # Default is on if objcopy is found - if test "x$OBJCOPY" != x; then - ENABLE_DEBUG_SYMBOLS=true - # MacOS X and Windows don't use objcopy but default is on for those OSes - elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=true else ENABLE_DEBUG_SYMBOLS=false diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 126ab49c637..4397fb81123 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -516,11 +516,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], elif test "x$enable_debug_symbols" = "xno"; then ENABLE_DEBUG_SYMBOLS=false else - # Default is on if objcopy is found - if test "x$OBJCOPY" != x; then - ENABLE_DEBUG_SYMBOLS=true - # MacOS X and Windows don't use objcopy but default is on for those OSes - elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=true else ENABLE_DEBUG_SYMBOLS=false diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk index 3c9a0a1a490..6ee497f5262 100644 --- a/common/makefiles/NativeCompilation.gmk +++ b/common/makefiles/NativeCompilation.gmk @@ -435,36 +435,36 @@ define SetupNativeCompilation $(CP) $$< $$@ endif - ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X - ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif # Touch to not retrigger rule on rebuild + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif # Touch to not retrigger rule on rebuild $(TOUCH) $$@ - endif # !windows - endif # !macosx + endif # !windows + endif # !macosx ifeq ($(ZIP_DEBUGINFO_FILES), true) - ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet +ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz ifeq ($(OPENJDK_TARGET_OS), windows) @@ -477,12 +477,12 @@ define SetupNativeCompilation $(CD) $$($1_OBJECT_DIR) \ && $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo endif - endif # no MacOS X support yet +endif # no MacOS X support yet else ifeq ($(OPENJDK_TARGET_OS), windows) $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb - else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo endif endif @@ -519,36 +519,36 @@ define SetupNativeCompilation $(CP) $$< $$@ endif - ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X - ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif - $(TOUCH) $$@ - endif # !windows - endif # !macosx + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif + $(TOUCH) $$@ + endif # !windows + endif # !macosx ifeq ($(ZIP_DEBUGINFO_FILES), true) - ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet +ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz ifeq ($(OPENJDK_TARGET_OS), windows) @@ -561,12 +561,12 @@ define SetupNativeCompilation $(CD) $$($1_OBJECT_DIR) \ && $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo endif - endif # no MacOS X support yet +endif # no MacOS X support yet else ifeq ($(OPENJDK_TARGET_OS), windows) $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb - else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo endif endif From af6dec264813fd43a090fe99bad90de6518a1cd4 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 25 Oct 2013 10:16:40 -0700 Subject: [PATCH 23/36] 8027117: adapt JDK-7165611 to new build-infra whitespace/indent policy Fix whitespace/indent issues. Reviewed-by: hseigel, coleenp, erikj, ihse --- jdk/makefiles/Import.gmk | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jdk/makefiles/Import.gmk b/jdk/makefiles/Import.gmk index 50164b9f5d3..52db26e6295 100644 --- a/jdk/makefiles/Import.gmk +++ b/jdk/makefiles/Import.gmk @@ -120,11 +120,11 @@ $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $ $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES))) ifeq ($(OPENJDK_TARGET_OS), macosx) - JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.dSYM) \ - $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) + JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.dSYM) \ + $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) else - JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \ - $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) + JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \ + $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) endif ifneq ($(OPENJDK_TARGET_OS), windows) @@ -140,14 +140,14 @@ ifneq ($(OPENJDK_TARGET_OS), windows) IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I)) endif endif - ifneq ($(OPENJDK_TARGET_OS), macosx) - ifeq ($(JVM_VARIANT_MINIMAL1), true) - IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) - ifneq (,$(JSIG_DEBUGINFO)) - IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I)) - endif - endif + ifneq ($(OPENJDK_TARGET_OS), macosx) + ifeq ($(JVM_VARIANT_MINIMAL1), true) + IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) + ifneq (,$(JSIG_DEBUGINFO)) + IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I)) + endif endif + endif endif $(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX) From 3e6630c07bc98769b3ccc3e44bb9a86c22a315bd Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 25 Oct 2013 15:19:29 -0400 Subject: [PATCH 24/36] 8024927: Nashorn performance regression with CompressedOops Allocate compressed class space at end of Java heap. For small heap sizes, without CDS, save some space so compressed classes can have the same favorable compression as oops Reviewed-by: stefank, hseigel, goetz --- .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 92 +++++++----- hotspot/src/cpu/sparc/vm/sparc.ad | 14 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 45 +++--- hotspot/src/share/vm/memory/metaspace.cpp | 53 ++++--- hotspot/src/share/vm/memory/metaspace.hpp | 10 +- hotspot/src/share/vm/memory/universe.cpp | 38 +++-- .../share/vm/utilities/globalDefinitions.hpp | 2 - .../CompressedClassPointers.java | 136 ++++++++++++++++++ 8 files changed, 295 insertions(+), 95 deletions(-) create mode 100644 hotspot/test/runtime/CompressedOops/CompressedClassPointers.java diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index f4f45c0ae19..1f08c55e7e4 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -4096,15 +4096,19 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { void MacroAssembler::encode_klass_not_null(Register r) { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sub(r, G6_heapbase, r); - if (Universe::narrow_klass_shift() != 0) { - assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); - srlx(r, LogKlassAlignmentInBytes, r); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sub(r, G6_heapbase, r); + if (Universe::narrow_klass_shift() != 0) { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); + srlx(r, LogKlassAlignmentInBytes, r); + } + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(r, Universe::narrow_klass_shift(), r); } - reinit_heapbase(); } void MacroAssembler::encode_klass_not_null(Register src, Register dst) { @@ -4112,11 +4116,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { encode_klass_not_null(src); } else { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - set((intptr_t)Universe::narrow_klass_base(), dst); - sub(src, dst, dst); - if (Universe::narrow_klass_shift() != 0) { - srlx(dst, LogKlassAlignmentInBytes, dst); + if (Universe::narrow_klass_base() != NULL) { + set((intptr_t)Universe::narrow_klass_base(), dst); + sub(src, dst, dst); + if (Universe::narrow_klass_shift() != 0) { + srlx(dst, LogKlassAlignmentInBytes, dst); + } + } else { + // shift src into dst + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(src, Universe::narrow_klass_shift(), dst); } } } @@ -4126,14 +4135,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { // the instructions they generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // set + add + set - int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 + - insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); - if (Universe::narrow_klass_shift() == 0) { - return num_instrs * BytesPerInstWord; - } else { // sllx - return (num_instrs + 1) * BytesPerInstWord; + int num_instrs = 1; // shift src,dst or add + if (Universe::narrow_klass_base() != NULL) { + // set + add + set + num_instrs += insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + + insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); + if (Universe::narrow_klass_shift() != 0) { + num_instrs += 1; // sllx + } } + return num_instrs * BytesPerInstWord; } // !!! If the instructions that get generated here change then function @@ -4142,13 +4153,17 @@ void MacroAssembler::decode_klass_not_null(Register r) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - if (Universe::narrow_klass_shift() != 0) - sllx(r, LogKlassAlignmentInBytes, r); - add(r, G6_heapbase, r); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + if (Universe::narrow_klass_shift() != 0) + sllx(r, LogKlassAlignmentInBytes, r); + add(r, G6_heapbase, r); + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(r, Universe::narrow_klass_shift(), r); + } } void MacroAssembler::decode_klass_not_null(Register src, Register dst) { @@ -4158,16 +4173,21 @@ void MacroAssembler::decode_klass_not_null(Register src, Register dst) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - if (Universe::narrow_klass_shift() != 0) { - assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sllx(src, LogKlassAlignmentInBytes, dst); - add(dst, G6_heapbase, dst); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + if (Universe::narrow_klass_shift() != 0) { + assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sllx(src, LogKlassAlignmentInBytes, dst); + add(dst, G6_heapbase, dst); + reinit_heapbase(); + } else { + set((intptr_t)Universe::narrow_klass_base(), dst); + add(src, dst, dst); + } } else { - set((intptr_t)Universe::narrow_klass_base(), dst); - add(src, dst, dst); + // shift/mov src into dst. + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(src, Universe::narrow_klass_shift(), dst); } } } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 06235820bb8..298bc1c1d4d 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1660,12 +1660,16 @@ void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { if (UseCompressedClassPointers) { assert(Universe::heap() != NULL, "java heap should be initialized"); st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass"); - st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); - if (Universe::narrow_klass_shift() != 0) { - st->print_cr("\tSLL R_G5,3,R_G5"); + if (Universe::narrow_klass_base() != 0) { + st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); + if (Universe::narrow_klass_shift() != 0) { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); + } + st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); + st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); + } else { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); } - st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); - st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); } else { st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check"); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index c39c50082aa..cc4fe6869dc 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -5049,25 +5049,32 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { } void MacroAssembler::encode_klass_not_null(Register r) { - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); - // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - assert(r != r12_heapbase, "Encoding a klass in r12"); - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - subq(r, r12_heapbase); + if (Universe::narrow_klass_base() != NULL) { + // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. + assert(r != r12_heapbase, "Encoding a klass in r12"); + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + subq(r, r12_heapbase); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(r, LogKlassAlignmentInBytes); } - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + reinit_heapbase(); + } } void MacroAssembler::encode_klass_not_null(Register dst, Register src) { if (dst == src) { encode_klass_not_null(src); } else { - mov64(dst, (int64_t)Universe::narrow_klass_base()); - negq(dst); - addq(dst, src); + if (Universe::narrow_klass_base() != NULL) { + mov64(dst, (int64_t)Universe::narrow_klass_base()); + negq(dst); + addq(dst, src); + } else { + movptr(dst, src); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(dst, LogKlassAlignmentInBytes); @@ -5081,15 +5088,19 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) { // generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). - return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + if (Universe::narrow_klass_base() != NULL) { + // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). + return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + } else { + // longest load decode klass function, mov64, leaq + return 16; + } } // !!! If the instructions that get generated here change then function // instr_size_for_decode_klass_not_null() needs to get updated. void MacroAssembler::decode_klass_not_null(Register r) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); assert(r != r12_heapbase, "Decoding a klass in r12"); // Cannot assert, unverified entry point counts instructions (see .ad file) @@ -5100,14 +5111,15 @@ void MacroAssembler::decode_klass_not_null(Register r) { shlq(r, LogKlassAlignmentInBytes); } // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - addq(r, r12_heapbase); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + addq(r, r12_heapbase); + reinit_heapbase(); + } } void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); if (dst == src) { decode_klass_not_null(dst); @@ -5115,7 +5127,6 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. // Also do not verify_oop as this is called by verify_oop. - mov64(dst, (int64_t)Universe::narrow_klass_base()); if (Universe::narrow_klass_shift() != 0) { assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index c87ecf81fb2..ba2806d84f6 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -56,7 +56,7 @@ size_t const allocation_from_dictionary_limit = 4 * K; MetaWord* last_allocated = 0; -size_t Metaspace::_class_metaspace_size; +size_t Metaspace::_compressed_class_space_size; // Used in declarations in SpaceManager and ChunkManager enum ChunkIndex { @@ -2799,6 +2799,8 @@ ChunkManager* Metaspace::_chunk_manager_class = NULL; #define VIRTUALSPACEMULTIPLIER 2 #ifdef _LP64 +static const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); + void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address cds_base) { // Figure out the narrow_klass_base and the narrow_klass_shift. The // narrow_klass_base is the lower of the metaspace base and the cds base @@ -2808,14 +2810,22 @@ void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address address higher_address; if (UseSharedSpaces) { higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); + (address)(metaspace_base + compressed_class_space_size())); lower_base = MIN2(metaspace_base, cds_base); } else { - higher_address = metaspace_base + class_metaspace_size(); + higher_address = metaspace_base + compressed_class_space_size(); lower_base = metaspace_base; + + uint64_t klass_encoding_max = UnscaledClassSpaceMax << LogKlassAlignmentInBytes; + // If compressed class space fits in lower 32G, we don't need a base. + if (higher_address <= (address)klass_encoding_max) { + lower_base = 0; // effectively lower base is zero. + } } + Universe::set_narrow_klass_base(lower_base); - if ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint) { + + if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) { Universe::set_narrow_klass_shift(0); } else { assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces"); @@ -2830,24 +2840,24 @@ bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cd assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); address lower_base = MIN2((address)metaspace_base, cds_base); address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); - return ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint); + (address)(metaspace_base + compressed_class_space_size())); + return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax); } // Try to allocate the metaspace at the requested addr. void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base) { assert(using_class_space(), "called improperly"); assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); - assert(class_metaspace_size() < KlassEncodingMetaspaceMax, + assert(compressed_class_space_size() < KlassEncodingMetaspaceMax, "Metaspace size is too big"); - assert_is_ptr_aligned(requested_addr, _reserve_alignment); - assert_is_ptr_aligned(cds_base, _reserve_alignment); - assert_is_size_aligned(class_metaspace_size(), _reserve_alignment); + assert_is_ptr_aligned(requested_addr, _reserve_alignment); + assert_is_ptr_aligned(cds_base, _reserve_alignment); + assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); // Don't use large pages for the class space. bool large_pages = false; - ReservedSpace metaspace_rs = ReservedSpace(class_metaspace_size(), + ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, requested_addr, 0); @@ -2862,7 +2872,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a while (!metaspace_rs.is_reserved() && (addr + increment > addr) && can_use_cds_with_metaspace_addr(addr + increment, cds_base)) { addr = addr + increment; - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, addr, 0); } } @@ -2873,11 +2883,11 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a // initialization has happened that depends on UseCompressedClassPointers. // So, UseCompressedClassPointers cannot be turned off at this point. if (!metaspace_rs.is_reserved()) { - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages); if (!metaspace_rs.is_reserved()) { vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes", - class_metaspace_size())); + compressed_class_space_size())); } } } @@ -2899,8 +2909,8 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT, Universe::narrow_klass_base(), Universe::narrow_klass_shift()); - gclog_or_tty->print_cr("Metaspace Size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, - class_metaspace_size(), metaspace_rs.base(), requested_addr); + gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, + compressed_class_space_size(), metaspace_rs.base(), requested_addr); } } @@ -2966,7 +2976,7 @@ void Metaspace::ergo_initialize() { MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, _commit_alignment); CompressedClassSpaceSize = restricted_align_down(CompressedClassSpaceSize, _reserve_alignment); - set_class_metaspace_size(CompressedClassSpaceSize); + set_compressed_class_space_size(CompressedClassSpaceSize); } void Metaspace::global_initialize() { @@ -2995,12 +3005,12 @@ void Metaspace::global_initialize() { } #ifdef _LP64 - if (cds_total + class_metaspace_size() > (uint64_t)max_juint) { + if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) { vm_exit_during_initialization("Unable to dump shared archive.", err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space (" SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed " - "klass limit: " SIZE_FORMAT, cds_total, class_metaspace_size(), - cds_total + class_metaspace_size(), (size_t)max_juint)); + "klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(), + cds_total + compressed_class_space_size(), UnscaledClassSpaceMax)); } // Set the compressed klass pointer base so that decoding of these pointers works @@ -3048,7 +3058,8 @@ void Metaspace::global_initialize() { cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment); allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address); } else { - allocate_metaspace_compressed_klass_ptrs((char *)CompressedKlassPointersBase, 0); + char* base = (char*)align_ptr_up(Universe::heap()->reserved_region().end(), _reserve_alignment); + allocate_metaspace_compressed_klass_ptrs(base, 0); } } #endif diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index 925c2177a2a..c22d2170761 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -115,13 +115,13 @@ class Metaspace : public CHeapObj { static size_t align_word_size_up(size_t); // Aligned size of the metaspace. - static size_t _class_metaspace_size; + static size_t _compressed_class_space_size; - static size_t class_metaspace_size() { - return _class_metaspace_size; + static size_t compressed_class_space_size() { + return _compressed_class_space_size; } - static void set_class_metaspace_size(size_t metaspace_size) { - _class_metaspace_size = metaspace_size; + static void set_compressed_class_space_size(size_t size) { + _compressed_class_space_size = size; } static size_t _first_chunk_word_size; diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 63775ae1deb..043962c6304 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -677,13 +677,13 @@ jint universe_init() { // HeapBased - Use compressed oops with heap base + encoding. // 4Gb -static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); +static const uint64_t UnscaledOopHeapMax = (uint64_t(max_juint) + 1); // 32Gb -// OopEncodingHeapMax == NarrowOopHeapMax << LogMinObjAlignmentInBytes; +// OopEncodingHeapMax == UnscaledOopHeapMax << LogMinObjAlignmentInBytes; char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode) { assert(is_size_aligned((size_t)OopEncodingHeapMax, alignment), "Must be"); - assert(is_size_aligned((size_t)NarrowOopHeapMax, alignment), "Must be"); + assert(is_size_aligned((size_t)UnscaledOopHeapMax, alignment), "Must be"); assert(is_size_aligned(heap_size, alignment), "Must be"); uintx heap_base_min_address_aligned = align_size_up(HeapBaseMinAddress, alignment); @@ -702,20 +702,40 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // If the total size is small enough to allow UnscaledNarrowOop then // just use UnscaledNarrowOop. } else if ((total_size <= OopEncodingHeapMax) && (mode != HeapBasedNarrowOop)) { - if ((total_size <= NarrowOopHeapMax) && (mode == UnscaledNarrowOop) && + if ((total_size <= UnscaledOopHeapMax) && (mode == UnscaledNarrowOop) && (Universe::narrow_oop_shift() == 0)) { // Use 32-bits oops without encoding and // place heap's top on the 4Gb boundary - base = (NarrowOopHeapMax - heap_size); + base = (UnscaledOopHeapMax - heap_size); } else { // Can't reserve with NarrowOopShift == 0 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); + if (mode == UnscaledNarrowOop || - mode == ZeroBasedNarrowOop && total_size <= NarrowOopHeapMax) { + mode == ZeroBasedNarrowOop && total_size <= UnscaledOopHeapMax) { + // Use zero based compressed oops with encoding and // place heap's top on the 32Gb boundary in case // total_size > 4Gb or failed to reserve below 4Gb. - base = (OopEncodingHeapMax - heap_size); + uint64_t heap_top = OopEncodingHeapMax; + + // For small heaps, save some space for compressed class pointer + // space so it can be decoded with no base. + if (UseCompressedClassPointers && !UseSharedSpaces && + OopEncodingHeapMax <= 32*G) { + + uint64_t class_space = align_size_up(CompressedClassSpaceSize, alignment); + assert(is_size_aligned((size_t)OopEncodingHeapMax-class_space, + alignment), "difference must be aligned too"); + uint64_t new_top = OopEncodingHeapMax-class_space; + + if (total_size <= new_top) { + heap_top = new_top; + } + } + + // Align base to the adjusted top of the heap + base = heap_top - heap_size; } } } else { @@ -737,7 +757,7 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // Set to a non-NULL value so the ReservedSpace ctor computes // the correct no-access prefix. // The final value will be set in initialize_heap() below. - Universe::set_narrow_oop_base((address)NarrowOopHeapMax); + Universe::set_narrow_oop_base((address)UnscaledOopHeapMax); #ifdef _WIN64 if (UseLargePages) { // Cannot allocate guard pages for implicit checks in indexed @@ -833,7 +853,7 @@ jint Universe::initialize_heap() { Universe::set_narrow_oop_use_implicit_null_checks(true); } #endif // _WIN64 - if((uint64_t)Universe::heap()->reserved_region().end() > NarrowOopHeapMax) { + if((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) { // Can't reserve heap below 4Gb. Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); } else { diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 06a32dc9037..7806cdc0811 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -368,8 +368,6 @@ const int KlassAlignment = KlassAlignmentInBytes / HeapWordSize; // Klass encoding metaspace max size const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes; -const jlong CompressedKlassPointersBase = NOT_LP64(0) LP64_ONLY(CONST64(0x800000000)); // 32*G - // Machine dependent stuff #ifdef TARGET_ARCH_x86 diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java new file mode 100644 index 00000000000..1892e6fd0b5 --- /dev/null +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * 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 8024927 + * @summary Testing address of compressed class pointer space as best as possible. + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class CompressedClassPointers { + + public static void smallHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedBaseAddress=8g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000"); + output.shouldHaveExitValue(0); + } + + public static void smallHeapTestWith3G() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=3g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3"); + output.shouldHaveExitValue(0); + } + + public static void largeHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx30g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("Narrow klass base: 0x0000000000000000"); + output.shouldContain("Narrow klass shift: 0"); + output.shouldHaveExitValue(0); + } + + public static void largePagesTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx128m", + "-XX:+UseLargePages", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base:"); + output.shouldHaveExitValue(0); + } + + public static void sharingTest() throws Exception { + // Test small heaps + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", + "-Xshare:dump"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + try { + output.shouldContain("Loading classes to share"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-Xshare:on", + "-version"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("sharing"); + output.shouldHaveExitValue(0); + + } catch (RuntimeException e) { + output.shouldContain("Unable to use shared archive"); + output.shouldHaveExitValue(1); + } + } + + public static void main(String[] args) throws Exception { + if (!Platform.is64bit()) { + // Can't test this on 32 bit, just pass + System.out.println("Skipping test on 32bit"); + return; + } + // Solaris 10 can't mmap compressed oops space without a base + if (Platform.isSolaris()) { + String name = System.getProperty("os.version"); + if (name.equals("5.10")) { + System.out.println("Skipping test on Solaris 10"); + return; + } + } + smallHeapTest(); + smallHeapTestWith3G(); + largeHeapTest(); + largePagesTest(); + sharingTest(); + } +} From 87fe2fdf4212ceb312a9e993f878df71a5f560db Mon Sep 17 00:00:00 2001 From: Albert Noll Date: Fri, 25 Oct 2013 22:57:13 +0200 Subject: [PATCH 25/36] 8026949: -Xint flag prints wrong warning: Initialization of C1 thread failed (no space to run compilers) Exit compiler threads early during startup so that wrong error message is not printed Reviewed-by: iveresov, twisti --- .../src/share/vm/compiler/compileBroker.cpp | 4 ++ .../test/compiler/startup/StartupOutput.java | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 hotspot/test/compiler/startup/StartupOutput.java diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index bdfe2abd315..fb47df28267 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -780,6 +780,10 @@ CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) void CompileBroker::compilation_init() { _last_method_compiled[0] = '\0'; + // No need to initialize compilation system if we do not use it. + if (!UseCompiler) { + return; + } #ifndef SHARK // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java new file mode 100644 index 00000000000..f677853d51c --- /dev/null +++ b/hotspot/test/compiler/startup/StartupOutput.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * 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 8026949 + * @summary Test ensures correct VM output during startup + * @library ../../testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class StartupOutput { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldNotContain("no space to run compilers"); + + out.shouldHaveExitValue(0); + } +} From 9ba485b29fa3d8f41509aaa4cad18acb4860cdff Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 28 Oct 2013 09:58:59 +0100 Subject: [PATCH 26/36] 8027140: Assertion in compiler when running bigapps/Kitchensink/stability Filter() code for TypeKlassPtr not moved when permgen removal was introduced Reviewed-by: twisti, iveresov --- hotspot/src/share/vm/opto/type.cpp | 41 ++++++++++++++++++++---------- hotspot/src/share/vm/opto/type.hpp | 5 +++- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index faf1555161f..3f628195f78 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -2787,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const { //-----------------------------filter------------------------------------------ // Do not allow interface-vs.-noninterface joins to collapse to top. -const Type *TypeOopPtr::filter( const Type *kills ) const { +const Type *TypeOopPtr::filter(const Type *kills) const { const Type* ft = join(kills); const TypeInstPtr* ftip = ft->isa_instptr(); const TypeInstPtr* ktip = kills->isa_instptr(); - const TypeKlassPtr* ftkp = ft->isa_klassptr(); - const TypeKlassPtr* ktkp = kills->isa_klassptr(); if (ft->empty()) { // Check for evil case of 'this' being a class and 'kills' expecting an @@ -2807,8 +2805,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { // uplift the type. if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) return kills; // Uplift to interface - if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) - return kills; // Uplift to interface return Type::TOP; // Canonical empty value } @@ -2825,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { assert(!ftip->klass_is_exact(), "interface could not be exact"); return ktip->cast_to_ptr_type(ftip->ptr()); } - // Interface klass type could be exact in opposite to interface type, - // return it here instead of incorrect Constant ptr J/L/Object (6894807). - if (ftkp != NULL && ktkp != NULL && - ftkp->is_loaded() && ftkp->klass()->is_interface() && - !ftkp->klass_is_exact() && // Keep exact interface klass - ktkp->is_loaded() && !ktkp->klass()->is_interface()) { - return ktkp->cast_to_ptr_type(ftkp->ptr()); - } return ft; } @@ -4385,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const { return (_offset == 0) && !below_centerline(_ptr); } +// Do not allow interface-vs.-noninterface joins to collapse to top. +const Type *TypeKlassPtr::filter(const Type *kills) const { + // logic here mirrors the one from TypeOopPtr::filter. See comments + // there. + const Type* ft = join(kills); + const TypeKlassPtr* ftkp = ft->isa_klassptr(); + const TypeKlassPtr* ktkp = kills->isa_klassptr(); + + if (ft->empty()) { + if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) + return kills; // Uplift to interface + + return Type::TOP; // Canonical empty value + } + + // Interface klass type could be exact in opposite to interface type, + // return it here instead of incorrect Constant ptr J/L/Object (6894807). + if (ftkp != NULL && ktkp != NULL && + ftkp->is_loaded() && ftkp->klass()->is_interface() && + !ftkp->klass_is_exact() && // Keep exact interface klass + ktkp->is_loaded() && !ktkp->klass()->is_interface()) { + return ktkp->cast_to_ptr_type(ftkp->ptr()); + } + + return ft; +} + //----------------------compute_klass------------------------------------------ // Compute the defining klass for this class ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index e72baa96b1d..9810edfe724 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -63,7 +63,7 @@ class TypeRawPtr; class TypeOopPtr; class TypeInstPtr; class TypeAryPtr; -class TypeKlassPtr; +class TypeKlassPtr; class TypeMetadataPtr; //------------------------------Type------------------------------------------- @@ -1202,6 +1202,9 @@ public: virtual intptr_t get_con() const; + // Do not allow interface-vs.-noninterface joins to collapse to top. + virtual const Type *filter( const Type *kills ) const; + // Convenience common pre-built types. static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same From 4d9e812aa2ec9445cfcbcc3f2c02cd4d6d771f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rickard=20B=C3=A4ckman?= Date: Mon, 28 Oct 2013 08:34:10 +0100 Subject: [PATCH 27/36] 8027353: Exact intrinsics: assert(n != NULL) failed: must not be null Reviewed-by: kvn, roland --- hotspot/src/share/vm/opto/library_call.cpp | 6 +++--- .../intrinsics/mathexact/SubExactLConstantTest.java | 1 + .../intrinsics/mathexact/SubExactLNonConstantTest.java | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 6a7ee628844..df6c29f5766 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -2006,9 +2006,9 @@ bool LibraryCallKit::inline_math_addExactI(bool is_increment) { Node* arg2 = NULL; if (is_increment) { - arg2 = intcon(1); + arg2 = intcon(1); } else { - arg2 = argument(1); + arg2 = argument(1); } Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) ); @@ -2056,7 +2056,7 @@ bool LibraryCallKit::inline_math_subtractExactL(bool is_decrement) { if (is_decrement) { arg2 = longcon(1); } else { - Node* arg2 = argument(2); // type long + arg2 = argument(2); // type long // argument(3) == TOP } diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java index 46eefcd194a..ec554d7662b 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test constant subtractExact * @compile SubExactLConstantTest.java Verify.java * @run main SubExactLConstantTest diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java index 2bd67bb0f9b..86ecf20f366 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test non constant subtractExact * @compile SubExactLNonConstantTest.java Verify.java * @run main SubExactLNonConstantTest From 3e0a2a86bf8dadf9e393d5c884fef0e4c7b47e01 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Mon, 28 Oct 2013 21:41:48 +0400 Subject: [PATCH 28/36] 8026950: Nits in agent ps_proc.c file breaks compilation of open hotspot Fixed two compilation-breaking nits Reviewed-by: sla, dholmes --- hotspot/agent/src/os/bsd/ps_proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hotspot/agent/src/os/bsd/ps_proc.c b/hotspot/agent/src/os/bsd/ps_proc.c index cf4a5d71d75..53cafe1f44e 100644 --- a/hotspot/agent/src/os/bsd/ps_proc.c +++ b/hotspot/agent/src/os/bsd/ps_proc.c @@ -131,7 +131,7 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void static bool ptrace_continue(pid_t pid, int signal) { // pass the signal to the process so we don't swallow it - if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) { + if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) { print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); return false; } @@ -434,7 +434,6 @@ static ps_prochandle_ops process_ops = { // attach to the process. One and only one exposed stuff struct ps_prochandle* Pgrab(pid_t pid) { struct ps_prochandle* ph = NULL; - thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { print_debug("can't allocate memory for ps_prochandle\n"); From 8f2b923945c4fa8e949b6d1c2451ab6b5edc418d Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 29 Oct 2013 15:44:30 +0100 Subject: [PATCH 29/36] 8027298: broken link in jdk8b113 macosx binaries Reviewed-by: dcubed, ihse --- jdk/makefiles/Import.gmk | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/jdk/makefiles/Import.gmk b/jdk/makefiles/Import.gmk index 52db26e6295..46c64d4d468 100644 --- a/jdk/makefiles/Import.gmk +++ b/jdk/makefiles/Import.gmk @@ -120,11 +120,11 @@ $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $ $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES))) ifeq ($(OPENJDK_TARGET_OS), macosx) - JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.dSYM) \ - $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) + JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \ + $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) else JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \ - $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) + $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) endif ifneq ($(OPENJDK_TARGET_OS), windows) @@ -156,26 +156,26 @@ $(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_ $(LN) -s ../$(@F) $@ ifeq ($(OPENJDK_TARGET_OS), macosx) -$(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM + $(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../$(@F) $@ -$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz + $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz $(MKDIR) -p $(@D) $(RM) $@ - $(RM) $@.tmp $(basename $@).dSYM - $(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM - $(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM - $(RM) $(basename $@).dSYM + $(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM + $(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM + $(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM + $(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM $(MV) $@.tmp $@ else -$(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo + $(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../$(@F) $@ -$(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz + $(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz $(MKDIR) -p $(@D) $(RM) $@ $(RM) $@.tmp $(basename $@).debuginfo @@ -191,26 +191,26 @@ $(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_ $(LN) -s ../$(@F) $@ ifeq ($(OPENJDK_TARGET_OS), macosx) -$(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM + $(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../$(@F) $@ -$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz + $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz $(MKDIR) -p $(@D) $(RM) $@ - $(RM) $@.tmp $(basename $@).dSYM - $(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM - $(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM - $(RM) $(basename $@).dSYM + $(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM + $(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM + $(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM + $(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM $(MV) $@.tmp $@ else -$(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo + $(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../$(@F) $@ -$(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz + $(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz $(MKDIR) -p $(@D) $(RM) $@ $(RM) $@.tmp $(basename $@).debuginfo @@ -226,12 +226,12 @@ $(INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES $(LN) -s ../$(@F) $@ ifneq ($(OPENJDK_TARGET_OS), macosx) -$(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo + $(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../$(@F) $@ -$(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz + $(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz $(MKDIR) -p $(@D) $(RM) $@ $(RM) $@.tmp $(basename $@).debuginfo From 612252d7a24c68a1b18d0d762229040f519bdfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rickard=20B=C3=A4ckman?= Date: Wed, 30 Oct 2013 13:14:09 +0100 Subject: [PATCH 30/36] 8027444: mathExact: assert(i < _max) failed: oob: i=1, _max=1 Reviewed-by: duke --- hotspot/src/share/vm/opto/loopTransform.cpp | 4 ++ .../mathexact/NestedMathExactTest.java | 54 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 41c0a9d416d..55a533bc38a 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -713,6 +713,10 @@ bool IdealLoopTree::policy_unroll( PhaseIdealLoop *phase ) const { case Op_ModL: body_size += 30; break; case Op_DivL: body_size += 30; break; case Op_MulL: body_size += 10; break; + case Op_FlagsProj: + // Can't handle unrolling of loops containing + // nodes that generate a FlagsProj at the moment + return false; case Op_StrComp: case Op_StrEquals: case Op_StrIndexOf: diff --git a/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java new file mode 100644 index 00000000000..211dc8baff1 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * 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 8027444 + * @summary Test nested loops + * @compile NestedMathExactTest.java + * @run main NestedMathExactTest + * + */ + +public class NestedMathExactTest { + public static final int LIMIT = 100; + public static int[] result = new int[LIMIT]; + public static int value = 17; + + public static void main(String[] args) { + for (int i = 0; i < 100; ++i) { + result[i] = runTest(); + } + } + + public static int runTest() { + int sum = 0; + for (int j = 0; j < 100000; j = Math.addExact(j, 1)) { + sum = 1; + for (int i = 0; i < 5; ++i) { + sum *= value; + } + } + return sum; + } +} From e43ac255842efb666aba6d97abaac23fd0d68647 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Wed, 30 Oct 2013 22:55:11 -0700 Subject: [PATCH 31/36] 8026735: Stream tests throw java.lang.IncompatibleClassChangeError Put a band-aid to disable CHA-based inlining for interfaces with default methods in C1 Reviewed-by: kvn, twisti --- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 2 +- hotspot/src/share/vm/ci/ciInstanceKlass.cpp | 1 + hotspot/src/share/vm/ci/ciInstanceKlass.hpp | 6 ++ .../inlining/InlineDefaultMethod.java | 64 +++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 hotspot/test/compiler/inlining/InlineDefaultMethod.java diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 75e827b3b43..26bb8d0227e 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1873,7 +1873,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // number of implementors for decl_interface is 0 or 1. If // it's 0 then no class implements decl_interface and there's // no point in inlining. - if (!holder->is_loaded() || decl_interface->nof_implementors() != 1) { + if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_default_methods()) { singleton = NULL; } } diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index d40e460dcf3..f4389da46a6 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -57,6 +57,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : _init_state = ik->init_state(); _nonstatic_field_size = ik->nonstatic_field_size(); _has_nonstatic_fields = ik->has_nonstatic_fields(); + _has_default_methods = ik->has_default_methods(); _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: _implementor = NULL; // we will fill these lazily diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index fdd93ddc58c..34eb84ccfeb 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -52,6 +52,7 @@ private: bool _has_finalizer; bool _has_subklass; bool _has_nonstatic_fields; + bool _has_default_methods; ciFlags _flags; jint _nonstatic_field_size; @@ -171,6 +172,11 @@ public: } } + bool has_default_methods() { + assert(is_loaded(), "must be loaded"); + return _has_default_methods; + } + ciInstanceKlass* get_canonical_holder(int offset); ciField* get_field_by_offset(int field_offset, bool is_static); ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static); diff --git a/hotspot/test/compiler/inlining/InlineDefaultMethod.java b/hotspot/test/compiler/inlining/InlineDefaultMethod.java new file mode 100644 index 00000000000..609eaf217d5 --- /dev/null +++ b/hotspot/test/compiler/inlining/InlineDefaultMethod.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * 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 8026735 + * @summary CHA in C1 should make correct decisions about default methods + * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod + */ + + +interface InterfaceWithDefaultMethod0 { + default public int defaultMethod() { + return 1; + } +} + +interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + +abstract class Subtype implements InterfaceWithDefaultMethod1 { } + +class Decoy extends Subtype { + public int defaultMethod() { + return 2; + } +} + +class Instance extends Subtype { } + +public class InlineDefaultMethod { + public static int test(InterfaceWithDefaultMethod1 x) { + return x.defaultMethod(); + } + public static void main(String[] args) { + InterfaceWithDefaultMethod1 a = new Decoy(); + InterfaceWithDefaultMethod1 b = new Instance(); + if (test(a) != 2 || + test(b) != 1) { + System.err.println("FAILED"); + System.exit(97); + } + System.err.println("PASSED"); + } +} From 7a38dabd09a13868c7589534406100073d435348 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 31 Oct 2013 04:16:40 -0700 Subject: [PATCH 32/36] 8024919: G1: SPECjbb2013 crashes due to a broken object reference Pass correct new value to post_barrer() in Unsafe.getAndSetObject() C1 intrinsic Reviewed-by: kvn, roland --- hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 308befddc77..4a30d597b3e 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1468,19 +1468,18 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { addr = new LIR_Address(src.result(), offset, type); } - if (data != dst) { - __ move(data, dst); - data = dst; - } + // Because we want a 2-arg form of xchg and xadd + __ move(data, dst); + if (x->is_add()) { - __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); } else { if (is_obj) { // Do the pre-write barrier, if any. pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, true /* do_load */, false /* patch */, NULL); } - __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); if (is_obj) { // Seems to be a precise address post_barrier(LIR_OprFact::address(addr), data); From 2aa30fbbffe9af52915674dd546b1092d8cd3386 Mon Sep 17 00:00:00 2001 From: "J. Duke" Date: Wed, 5 Jul 2017 19:18:50 +0200 Subject: [PATCH 33/36] Added tag jdk8-b113 for changeset 4a4dbcf7cb7d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 0990efaad3b..5df287b11d4 100644 --- a/.hgtags +++ b/.hgtags @@ -234,3 +234,4 @@ af9a674e12a16da1a4bd53e4990ddb1121a21ef1 jdk8-b109 b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 +4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 From 05b28dbe44677090fa3a892727786f68b0aa67da Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 31 Oct 2013 12:36:10 -0700 Subject: [PATCH 34/36] Added tag jdk8-b114 for changeset 07a68f9401e4 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f794add23e0..f9a2f859243 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -389,3 +389,4 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 +7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 From c544fbe101d8351f0f6ab6a04ce599cafcfb8772 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Fri, 1 Nov 2013 08:26:55 -0700 Subject: [PATCH 35/36] Added tag hs25-b57 for changeset 6290e790c312 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f9a2f859243..22734a967f6 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -390,3 +390,4 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 +3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57 From 38bf4f6aa6a8ba318cf091dc6dbd23028590da28 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Fri, 1 Nov 2013 08:35:58 -0700 Subject: [PATCH 36/36] 8027580: new hotspot build - hs25-b58 Reviewed-by: jcoomes --- hotspot/make/hotspot_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 69d9e8e9e59..ef45285a489 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=57 +HS_BUILD_NUMBER=58 JDK_MAJOR_VER=1 JDK_MINOR_VER=8