# HG changeset patch # User Doug Simon # Date 1396880689 -7200 # Node ID cc844a4512f170745aba6e9226b58bd2a5b7d070 # Parent ab81149f602919a1bf9b2824f106a29cda593931 added graal.version system property that is (only) defined by Graal enabled VMs diff -r ab81149f6029 -r cc844a4512f1 make/bsd/makefiles/vm.make --- a/make/bsd/makefiles/vm.make Mon Apr 07 11:46:20 2014 +0200 +++ b/make/bsd/makefiles/vm.make Mon Apr 07 16:24:49 2014 +0200 @@ -111,6 +111,10 @@ CXXFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\"" endif +ifeq ($(INCLUDE_GRAAL), true) + CXXFLAGS += -DGRAAL_VERSION="\"$(GRAAL_VERSION)\"" +endif + # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN/BYFILE) diff -r ab81149f6029 -r cc844a4512f1 make/linux/makefiles/vm.make --- a/make/linux/makefiles/vm.make Mon Apr 07 11:46:20 2014 +0200 +++ b/make/linux/makefiles/vm.make Mon Apr 07 16:24:49 2014 +0200 @@ -113,6 +113,10 @@ CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 endif # ifneq ($(LP64), 1) +ifeq ($(INCLUDE_GRAAL), true) + CXXFLAGS += -DGRAAL_VERSION="\"$(GRAAL_VERSION)\"" +endif + # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN/BYFILE) diff -r ab81149f6029 -r cc844a4512f1 make/solaris/makefiles/vm.make --- a/make/solaris/makefiles/vm.make Mon Apr 07 11:46:20 2014 +0200 +++ b/make/solaris/makefiles/vm.make Mon Apr 07 16:24:49 2014 +0200 @@ -100,6 +100,10 @@ CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 endif # ifneq ($(LP64), 1) +ifeq ($(INCLUDE_GRAAL), true) + CXXFLAGS += -DGRAAL_VERSION="\"$(GRAAL_VERSION)\"" +endif + # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN) diff -r ab81149f6029 -r cc844a4512f1 make/windows/makefiles/vm.make --- a/make/windows/makefiles/vm.make Mon Apr 07 11:46:20 2014 +0200 +++ b/make/windows/makefiles/vm.make Mon Apr 07 16:24:49 2014 +0200 @@ -71,6 +71,10 @@ # Define that so jni.h is on correct side CXX_FLAGS=$(CXX_FLAGS) /D "_JNI_IMPLEMENTATION_" +!if "$(INCLUDE_GRAAL)" == "true" + CXX_FLAGS=$(CXX_FLAGS) /D "GRAAL_VERSION=\"$(GRAAL_VERSION)\"" +!endif + !if "$(BUILDARCH)" == "ia64" STACK_SIZE="/STACK:1048576,262144" !else diff -r ab81149f6029 -r cc844a4512f1 mx/mx_graal.py --- a/mx/mx_graal.py Mon Apr 07 11:46:20 2014 +0200 +++ b/mx/mx_graal.py Mon Apr 07 16:24:49 2014 +0200 @@ -654,18 +654,6 @@ env.setdefault('HOTSPOT_BUILD_JOBS', str(cpus)) env.setdefault('ALT_BOOTDIR', mx.java().jdk) - # extract latest release tag for graal - try: - tags = [x.split(' ')[0] for x in subprocess.check_output(['hg', 'tags']).split('\n') if x.startswith("graal-")] - except: - # not a mercurial repository or hg commands are not available. - tags = None - - if tags: - # extract the most recent tag - tag = sorted(tags, key=lambda e: [int(x) for x in e[len("graal-"):].split('.')], reverse=True)[0] - env.setdefault('USER_RELEASE_SUFFIX', tag) - if not mx._opts.verbose: runCmd.append('MAKE_VERBOSE=') env['JAVA_HOME'] = jdk @@ -673,6 +661,22 @@ env['INCLUDE_GRAAL'] = 'false' env.setdefault('ALT_OUTPUTDIR', join(_graal_home, 'build-nograal', mx.get_os())) else: + # extract latest release tag for graal + try: + tags = [x.split(' ')[0] for x in subprocess.check_output(['hg', '-R', _graal_home, 'tags']).split('\n') if x.startswith("graal-")] + except: + # not a mercurial repository or hg commands are not available. + tags = None + + if tags: + # extract the most recent tag + tag = sorted(tags, key=lambda e: [int(x) for x in e[len("graal-"):].split('.')], reverse=True)[0] + env.setdefault('USER_RELEASE_SUFFIX', tag) + env.setdefault('GRAAL_VERSION', tag[len("graal-"):]) + else: + version = 'unknown-{}-{}'.format(platform.node(), time.strftime('%Y-%m-%d_%H-%M-%S_%Z')) + env.setdefault('USER_RELEASE_SUFFIX', 'graal-' + version) + env.setdefault('GRAAL_VERSION', version) env['INCLUDE_GRAAL'] = 'true' env.setdefault('INSTALL', 'y') if mx.get_os() == 'solaris': diff -r ab81149f6029 -r cc844a4512f1 src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Mon Apr 07 11:46:20 2014 +0200 +++ b/src/share/vm/runtime/arguments.cpp Mon Apr 07 16:24:49 2014 +0200 @@ -182,6 +182,9 @@ PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(), false)); PropertyList_add(&_system_properties, new SystemProperty("java.vm.name", VM_Version::vm_name(), false)); PropertyList_add(&_system_properties, new SystemProperty("java.vm.info", VM_Version::vm_info_string(), true)); +#ifdef GRAAL + PropertyList_add(&_system_properties, new SystemProperty("graal.version", GRAAL_VERSION, true)); +#endif // following are JVMTI agent writeable properties. // Properties values are set to NULL and they are