Initial import (with javadoc-zip arch-dependent because of aot being x86-64 only)

This commit is contained in:
Jiri Vanek 2017-08-15 19:46:54 +02:00
parent 429e156844
commit eb6fa00c67
28 changed files with 3369 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/systemtap-tapset-3.1.0.tar.xz
/jdk9-jdk9-jdk-9+181.tar.xz

40
PStack-808293.patch Normal file
View File

@ -0,0 +1,40 @@
--- jdk9/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:33.322164601 +0200
+++ jdk9/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java 2012-04-06 02:26:57.958514071 +0200
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Red Hat Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,7 +85,8 @@
out.print("----------------- ");
out.print(th);
out.println(" -----------------");
- while (f != null) {
+ int maxStack = 256;
+ while (f != null && maxStack-- > 0) {
ClosestSymbol sym = f.closestSymbolToPC();
Address pc = f.pc();
out.print(pc + "\t");
@@ -158,10 +160,19 @@
}
}
}
+ Address oldPC = f.pc();
+ Address oldFP = f.localVariableBase();
f = f.sender(th);
+ if (f != null
+ && oldPC.equals(f.pc())
+ && oldFP.equals(f.localVariableBase())) {
+ // We didn't make any progress
+ f = null;
+ }
}
} catch (Exception exp) {
- exp.printStackTrace();
+ // exp.printStackTrace();
+ out.println("bad stack: " + exp);
// continue, may be we can do a better job for other threads
}
if (concurrentLocks) {

View File

@ -1,3 +1,6 @@
# java-9-openjdk
The java-9-openjdk package
The java-9-openjdk package
The java-1.9.0-openjdk-src subpackage contains the complete OpenJDK 9
class library source code for use by IDE indexers and debuggers.

72
TestCryptoLevel.java Normal file
View File

@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.security.Permission;
import java.security.PermissionCollection;
public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;
try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}

49
TestECDSA.java Normal file
View File

@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
/**
* @test
*/
public class TestECDSA {
public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();
byte[] data = "This is a string to sign".getBytes("UTF-8");
Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}

14
aarch64BuildFailure.patch Normal file
View File

@ -0,0 +1,14 @@
diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp
--- openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000
+++ openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100
@@ -343,7 +343,7 @@
CodeBuffer cb(code_pos, instruction_size);
MacroAssembler a(&cb);
- a.mov(rscratch1, entry);
+ a.movptr(rscratch1, (uintptr_t)entry);
a.br(rscratch1);
ICache::invalidate_range(code_pos, instruction_size);

18
accessible-toolkit.patch Normal file
View File

@ -0,0 +1,18 @@
diff -uNr jdk9/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java jdk8/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
--- jdk9/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
+++ jdk9/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
@@ -883,9 +883,13 @@
return null;
}
});
if (!GraphicsEnvironment.isHeadless()) {
- loadAssistiveTechnologies();
+ try {
+ loadAssistiveTechnologies();
+ } catch (AWTError error) {
+ // ignore silently
+ }
}
}
return toolkit;
}

25
bootcycle_jobs.patch Normal file
View File

@ -0,0 +1,25 @@
diff -r 21b063d75b3e make/Init.gmk
--- jdk9/make/Init.gmk Thu Mar 16 16:34:33 2017 +0000
+++ jdk9/make/Init.gmk Tue Apr 04 13:49:37 2017 +0100
@@ -303,7 +303,8 @@
$(call PrepareSmartJavac)
( cd $(TOPDIR) && \
$(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
- -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
+ $(if $(DISABLE_JOBS),, -j $(JOBS)) \
+ -f make/Main.gmk $(USER_MAKE_VARS) \
$(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
( exitcode=$$? && \
$(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
diff -r 21b063d75b3e make/Main.gmk
--- jdk9/make/Main.gmk Thu Mar 16 16:34:33 2017 +0000
+++ jdk9/make/Main.gmk Tue Apr 04 13:49:37 2017 +0100
@@ -320,7 +320,7 @@
ifneq ($(COMPILE_TYPE), cross)
$(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
+$(MAKE) $(MAKE_ARGS) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
- JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
+ DISABLE_JOBS=true SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
else
$(call LogWarn, Boot cycle build disabled when cross compiling)
endif

148
generate_source_tarball.sh Executable file
View File

@ -0,0 +1,148 @@
#!/bin/bash
# Generates the 'source tarball' for JDK 8 projects.
#
# Example:
# When used from local repo set REPO_ROOT pointing to file:// with your repo
# if your local repo follows upstream forests conventions, you may be enough by setting OPENJDK_URL
# if you wont to use local copy of patch PR2126 set path to it to PR2126 variable
#
# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg:
# PROJECT_NAME=jdk9
# REPO_NAME=jdk9
# VERSION=inDevelopment (but keyword tip will still do its job)
#
# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set)
# This script creates a single source tarball out of the repository
# based on the given tag and removes code not allowed in fedora/rhel. For
# consistency, the source tarball will always contain 'openjdk' as the top
# level folder, name is created, based on parameter
#
if [ ! "x$PR2126" = "x" ] ; then
if [ ! -f "$PR2126" ] ; then
echo "You have specified PR2126 as $PR2126 but it does not exists. exiting"
exit 1
fi
fi
set -e
OPENJDK_URL_DEFAULT=http://hg.openjdk.java.net
COMPRESSION_DEFAULT=xz
# jdk is last for its size
REPOS_DEFAULT="hotspot corba jaxws jaxp langtools nashorn jdk"
if [ "x$1" = "xhelp" ] ; then
echo -e "Behaviour may be specified by setting the following variables:\n"
echo "VERSION - the version of the specified OpenJDK project"
echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)"
echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)"
echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})"
echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})"
echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)"
echo "REPO_ROOT - the location of the Mercurial repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)"
echo "PR2126 - the path to the PR2126 patch to apply (optional; downloaded if unavailable)"
echo "REPOS - specify the repositories to use (optional; defaults to ${REPOS_DEFAULT})"
exit 1;
fi
if [ "x$VERSION" = "x" ] ; then
echo "No VERSION specified"
exit -2
fi
echo "Version: ${VERSION}"
# REPO_NAME is only needed when we default on REPO_ROOT and FILE_NAME_ROOT
if [ "x$FILE_NAME_ROOT" = "x" -o "x$REPO_ROOT" = "x" ] ; then
if [ "x$PROJECT_NAME" = "x" ] ; then
echo "No PROJECT_NAME specified"
exit -1
fi
echo "Project name: ${PROJECT_NAME}"
if [ "x$REPO_NAME" = "x" ] ; then
echo "No REPO_NAME specified"
exit -3
fi
echo "Repository name: ${REPO_NAME}"
fi
if [ "x$OPENJDK_URL" = "x" ] ; then
OPENJDK_URL=${OPENJDK_URL_DEFAULT}
echo "No OpenJDK URL specified; defaulting to ${OPENJDK_URL}"
else
echo "OpenJDK URL: ${OPENJDK_URL}"
fi
if [ "x$COMPRESSION" = "x" ] ; then
# rhel 5 needs tar.gz
COMPRESSION=${COMPRESSION_DEFAULT}
fi
echo "Creating a tar.${COMPRESSION} archive"
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
echo "No file name root specified; default to ${FILE_NAME_ROOT}"
fi
if [ "x$REPO_ROOT" = "x" ] ; then
REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}"
echo "No repository root specified; default to ${REPO_ROOT}"
fi;
mkdir "${FILE_NAME_ROOT}"
pushd "${FILE_NAME_ROOT}"
echo "Cloning ${VERSION} root repository from ${REPO_ROOT}"
hg clone ${REPO_ROOT} openjdk -r ${VERSION}
pushd openjdk
if [ "x$REPOS" = "x" ] ; then
repos=${REPOS_DEFAULT}
echo "No repositories specified; defaulting to ${repos}"
else
repos=$REPOS
echo "Repositories: ${repos}"
fi;
for subrepo in $repos
do
echo "Cloning ${VERSION} ${subrepo} repository from ${REPO_ROOT}"
hg clone ${REPO_ROOT}/${subrepo} -r ${VERSION}
done
if [ -d jdk ]; then
echo "Removing EC source code we don't build"
#mv -v jdk/src/share/native/sun/security/ec/impl/ecc_impl.h .
#rm -vrf jdk/src/share/native/sun/security/ec/impl
#mkdir jdk/src/share/native/sun/security/ec/impl
#mv -v ecc_impl.h jdk/src/share/native/sun/security/ec/impl
echo "Syncing EC list with NSS"
#if [ "x$PR2126" = "x" ] ; then
# get pr2126.patch (from http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8d2c9a898f50) from most correct tag
# Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126)
# wget http://icedtea.classpath.org/hg/icedtea8/raw-file/tip/patches/pr2126.patch
# patch -Np1 < pr2126.patch
# rm pr2126.patch
#else
# echo "Applying ${PR2126}"
# patch -Np1 < $PR2126
#fi;
fi
find . -name '*.orig' -exec rm -vf '{}' ';'
popd
echo "Compressing remaining forest"
if [ "X$COMPRESSION" = "Xxz" ] ; then
tar --exclude-vcs -cJf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk
else
tar --exclude-vcs -czf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk
fi
mv ${FILE_NAME_ROOT}.tar.${COMPRESSION} ..
popd
echo "Done. You may want to remove the uncompressed version."

25
generate_tarballs.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
VERSION=3506c375241e
ICEDTEA_URL=http://icedtea.classpath.org/hg/icedtea7/
wget -O icedtea7.tar.gz ${ICEDTEA_URL}/archive/${VERSION}.tar.gz
tar xzf icedtea7.tar.gz
rm -f icedtea7.tar.gz
pushd icedtea7-${VERSION}
# desktop files
#mv jconsole.desktop ../jconsole.desktop.in
#mv policytool.desktop ../policytool.desktop.in
# Icons were generally cloned fromicedtea, but now are mucvh more specific
# tapsets
mv tapset/hotspot{,-1.8.0}.stp.in || exit 1
mv tapset/hotspot_gc{,-1.8.0}.stp.in || exit 1
mv tapset/hotspot_jni{,-1.8.0}.stp.in || exit 1
mv tapset/jstack{,-1.8.0}.stp.in || exit 1
tar cvzf systemtap-tapset.tar.gz tapset
mv systemtap-tapset.tar.gz ../
popd
rm -rf icedtea7-${VERSION}

View File

@ -0,0 +1,14 @@
diff -r b515beb3b4ad jdk9/hotspot/src/share/vm/utilities/globalDefinitions.hpp
--- jdk9/hotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Jul 07 18:40:53 2016 +0100
+++ jdk9/hotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Jul 12 19:13:51 2016 +0100
@@ -1163,8 +1163,10 @@
#undef min
#endif
+#ifndef _GLIBCXX_STDLIB_H
#define max(a,b) Do_not_use_max_use_MAX2_instead
#define min(a,b) Do_not_use_min_use_MIN2_instead
+#endif
// It is necessary to use templates here. Having normal overloaded
// functions does not work because it is necessary to provide both 32-

View File

@ -0,0 +1,19 @@
diff -up jdk9/common/autoconf/boot-jdk.m4 jdk9/common/autoconf/boot-jdk.m4
--- jdk9/common/autoconf/boot-jdk.m4 16:01:27.000000000 -0400
+++ jdk9/common/autoconf/boot-jdk.m4 2014-05-21 11:50:36.507890197 -0400
@@ -315,12 +315,12 @@
fi
# Minimum amount of heap memory.
- ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
+ ADD_JVM_ARG_IF_OK([-Xms256M],boot_jdk_jvmargs,[$JAVA])
if test "x$OPENJDK_TARGET_OS" = "xmacosx" || test "x$OPENJDK_TARGET_CPU" = "xppc64" ; then
# Why does macosx need more heap? Its the huge JDK batch.
ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
else
- ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
+ ADD_JVM_ARG_IF_OK([-Xmx768M],boot_jdk_jvmargs,[$JAVA])
fi
# When is adding -client something that speeds up the JVM?
# ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])

View File

@ -0,0 +1,307 @@
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2014-09-04 22:47:14.059845388 -0400
@@ -2686,7 +2686,7 @@
if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
n_blks += CMSOldPLABReactivityFactor*multiple*n_blks;
- n_blks = MIN2(n_blks, CMSOldPLABMax);
+ n_blks = MIN2(n_blks, (size_t)CMSOldPLABMax);
}
assert(n_blks > 0, "Error");
_cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl);
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-09-04 22:47:14.061845394 -0400
@@ -950,7 +950,7 @@
if (free_percentage < desired_free_percentage) {
size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
assert(desired_capacity >= capacity(), "invalid expansion size");
- size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
+ size_t expand_bytes = MAX2(desired_capacity - capacity(), (size_t)MinHeapDeltaBytes);
if (PrintGCDetails && Verbose) {
size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
gclog_or_tty->print_cr("\nFrom compute_new_size: ");
@@ -6559,7 +6559,7 @@
HeapWord* curAddr = _markBitMap.startWord();
while (curAddr < _markBitMap.endWord()) {
size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr);
- MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining));
+ MemRegion chunk(curAddr, MIN2((size_t)CMSBitMapYieldQuantum, remaining));
_markBitMap.clear_large_range(chunk);
if (ConcurrentMarkSweepThread::should_yield() &&
!foregroundGCIsActive() &&
@@ -6858,7 +6858,7 @@
return;
}
// Double capacity if possible
- size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax);
+ size_t new_capacity = MIN2(_capacity*2, (size_t)MarkStackSizeMax);
// Do not give up existing stack until we have managed to
// get the double capacity that we desired.
ReservedSpace rs(ReservedSpace::allocation_align_size_up(
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-09-04 22:47:14.063845410 -0400
@@ -3767,7 +3767,7 @@
// of things to do) or totally (at the very end).
size_t target_size;
if (partially) {
- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
+ target_size = MIN2((size_t)(_task_queue->max_elems()/3), (size_t) GCDrainStackTargetSize);
} else {
target_size = 0;
}
@@ -4605,7 +4605,7 @@
// The > 0 check is to deal with the prev and next live bytes which
// could be 0.
if (*hum_bytes > 0) {
- bytes = MIN2(HeapRegion::GrainBytes, *hum_bytes);
+ bytes = MIN2(HeapRegion::GrainBytes, (size_t)*hum_bytes);
*hum_bytes -= bytes;
}
return bytes;
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-09-04 22:47:14.065845427 -0400
@@ -1730,7 +1730,7 @@
verify_region_sets_optional();
- size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes);
+ size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t)MinHeapDeltaBytes);
ergo_verbose1(ErgoHeapSizing,
"attempt heap expansion",
ergo_format_reason("allocation request failed")
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp 2014-09-04 22:47:14.065845427 -0400
@@ -160,7 +160,7 @@
if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
region_size = MAX2(average_heap_size / TARGET_REGION_NUMBER,
- (uintx) MIN_REGION_SIZE);
+ (size_t) MIN_REGION_SIZE);
}
int region_size_log = log2_long((jlong) region_size);
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2014-09-04 22:47:14.067845443 -0400
@@ -71,7 +71,7 @@
if (_virtual_space != NULL && _virtual_space->expand_by(_reserved_byte_size)) {
_region_start = covered_region.start();
_region_size = covered_region.word_size();
- idx_t* map = (idx_t*)_virtual_space->reserved_low_addr();
+ BitMap::bm_word_t* map = (BitMap::bm_word_t*)_virtual_space->reserved_low_addr();
_beg_bits.set_map(map);
_beg_bits.set_size(bits / 2);
_end_bits.set_map(map + words / 2);
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2014-09-04 22:47:14.068845451 -0400
@@ -910,8 +910,8 @@
void PSParallelCompact::initialize_dead_wood_limiter()
{
const size_t max = 100;
- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+ _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+ _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
_dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
DEBUG_ONLY(_dwl_initialized = true;)
_dwl_adjustment = normal_distribution(1.0);
diff -ruN jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
--- jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2014-09-04 22:47:14.068845451 -0400
@@ -194,7 +194,7 @@
const size_t num_overflow_elems = of_stack->size();
const size_t space_available = queue->max_elems() - queue->size();
const size_t num_take_elems = MIN3(space_available / 4,
- ParGCDesiredObjsFromOverflowList,
+ (size_t)ParGCDesiredObjsFromOverflowList,
num_overflow_elems);
// Transfer the most recent num_take_elems from the overflow
// stack to our work queue.
diff -ruN jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp
--- jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp 2014-09-04 22:55:49.271922585 -0400
@@ -389,7 +389,7 @@
uintx calculated_size = NewSize + OldSize;
double shrink_factor = (double) MaxHeapSize / calculated_size;
uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment);
- FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
+ FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), (size_t)smaller_new_size));
_initial_gen0_size = NewSize;
// OldSize is already aligned because above we aligned MaxHeapSize to
@@ -437,7 +437,7 @@
// yield a size that is too small) and bound it by MaxNewSize above.
// Ergonomics plays here by previously calculating the desired
// NewSize and MaxNewSize.
- max_new_size = MIN2(MAX2(max_new_size, NewSize), MaxNewSize);
+ max_new_size = MIN2(MAX2(max_new_size, (size_t)NewSize), (size_t)MaxNewSize);
}
assert(max_new_size > 0, "All paths should set max_new_size");
@@ -459,23 +459,23 @@
// lower limit.
_min_gen0_size = NewSize;
desired_new_size = NewSize;
- max_new_size = MAX2(max_new_size, NewSize);
+ max_new_size = MAX2(max_new_size, (size_t)NewSize);
} else if (FLAG_IS_ERGO(NewSize)) {
// If NewSize is set ergonomically, we should use it as a lower
// limit, but use NewRatio to calculate the initial size.
_min_gen0_size = NewSize;
desired_new_size =
- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize);
- max_new_size = MAX2(max_new_size, NewSize);
+ MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize);
+ max_new_size = MAX2(max_new_size, (size_t)NewSize);
} else {
// For the case where NewSize is the default, use NewRatio
// to size the minimum and initial generation sizes.
// Use the default NewSize as the floor for these values. If
// NewRatio is overly large, the resulting sizes can be too
// small.
- _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize);
+ _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), (size_t)NewSize);
desired_new_size =
- MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize);
+ MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize);
}
assert(_min_gen0_size > 0, "Sanity check");
@@ -577,7 +577,7 @@
} else {
// It's been explicitly set on the command line. Use the
// OldSize and then determine the consequences.
- _min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size);
+ _min_gen1_size = MIN2((size_t)OldSize, _min_heap_byte_size - _min_gen0_size);
_initial_gen1_size = OldSize;
// If the user has explicitly set an OldSize that is inconsistent
diff -ruN jdk8/hotspot/src/share/vm/memory/metaspace.cpp jdk8/hotspot/src/share/vm/memory/metaspace.cpp
--- jdk8/hotspot/src/share/vm/memory/metaspace.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/memory/metaspace.cpp 2014-09-04 22:47:14.071845475 -0400
@@ -1431,7 +1431,7 @@
void MetaspaceGC::post_initialize() {
// Reset the high-water mark once the VM initialization is done.
- _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize);
+ _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), (size_t)MetaspaceSize);
}
bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
@@ -1491,7 +1491,7 @@
(size_t)MIN2(min_tmp, double(max_uintx));
// Don't shrink less than the initial generation size
minimum_desired_capacity = MAX2(minimum_desired_capacity,
- MetaspaceSize);
+ (size_t)MetaspaceSize);
if (PrintGCDetails && Verbose) {
gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: ");
@@ -1546,7 +1546,7 @@
const double max_tmp = used_after_gc / minimum_used_percentage;
size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx));
maximum_desired_capacity = MAX2(maximum_desired_capacity,
- MetaspaceSize);
+ (size_t)MetaspaceSize);
if (PrintGCDetails && Verbose) {
gclog_or_tty->print_cr(" "
" maximum_free_percentage: %6.2f"
@@ -3197,7 +3197,7 @@
// on the medium chunk list. The next chunk will be small and progress
// from there. This size calculated by -version.
_first_class_chunk_word_size = MIN2((size_t)MediumChunk*6,
- (CompressedClassSpaceSize/BytesPerWord)*2);
+ (size_t)(CompressedClassSpaceSize/BytesPerWord)*2);
_first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size);
// Arbitrarily set the initial virtual space to a multiple
// of the boot class loader size.
diff -ruN jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
--- jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp 2014-09-04 22:47:14.071845475 -0400
@@ -48,7 +48,7 @@
const size_t beg_index = size_t(index);
assert(beg_index < len || len == 0, "index too large");
- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
+ const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
const size_t end_index = beg_index + stride;
T* const base = (T*)a->base();
T* const beg = base + beg_index;
@@ -82,7 +82,7 @@
const size_t beg_index = size_t(index);
assert(beg_index < len || len == 0, "index too large");
- const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
+ const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
const size_t end_index = beg_index + stride;
T* const base = (T*)a->base();
T* const beg = base + beg_index;
diff -ruN jdk8/hotspot/src/share/vm/runtime/arguments.cpp jdk8/hotspot/src/share/vm/runtime/arguments.cpp
--- jdk8/hotspot/src/share/vm/runtime/arguments.cpp 2014-07-30 06:51:43.000000000 -0400
+++ jdk8/hotspot/src/share/vm/runtime/arguments.cpp 2014-09-04 22:47:14.072845483 -0400
@@ -1244,7 +1244,7 @@
// NewSize was set on the command line and it is larger than
// preferred_max_new_size.
if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line
- FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
+ FLAG_SET_ERGO(uintx, MaxNewSize, MAX2((size_t)NewSize, preferred_max_new_size));
} else {
FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
}
@@ -1269,8 +1269,8 @@
// Unless explicitly requested otherwise, make young gen
// at least min_new, and at most preferred_max_new_size.
if (FLAG_IS_DEFAULT(NewSize)) {
- FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
- FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
+ FLAG_SET_ERGO(uintx, NewSize, MAX2((size_t)NewSize, min_new));
+ FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t)NewSize));
if (PrintGCDetails && Verbose) {
// Too early to use gclog_or_tty
tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
@@ -1280,7 +1280,7 @@
// so it's NewRatio x of NewSize.
if (FLAG_IS_DEFAULT(OldSize)) {
if (max_heap > NewSize) {
- FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
+ FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize));
if (PrintGCDetails && Verbose) {
// Too early to use gclog_or_tty
tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
@@ -1401,7 +1401,7 @@
return true;
}
-uintx Arguments::max_heap_for_compressed_oops() {
+size_t Arguments::max_heap_for_compressed_oops() {
// Avoid sign flip.
assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
// We need to fit both the NULL page and the heap into the memory budget, while
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp 2014-06-12 03:58:35.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp 2014-06-12 03:58:35.000000000 -0400
@@ -38,7 +38,7 @@
_cancel(false),
_empty(true),
_dropped(0) {
- _nqueues = MAX2(ParallelGCThreads, (size_t)1);
+ _nqueues = MAX2(ParallelGCThreads, (uintx)1);
_queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC);
for (size_t i = 0; i < _nqueues; i++) {
new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size);
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp 2014-06-12 03:58:35.000000000 -0400
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp 2014-06-12 03:58:35.000000000 -0400
@@ -110,7 +110,7 @@
};
G1StringDedupEntryCache::G1StringDedupEntryCache() {
- _nlists = MAX2(ParallelGCThreads, (size_t)1);
+ _nlists = MAX2(ParallelGCThreads, (uintx)1);
_lists = PaddedArray<G1StringDedupEntryFreeList, mtGC>::create_unfreeable((uint)_nlists);
}

1801
java-9-openjdk.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
--- jdk9/jdk/src/java.base/share/conf/security/java.security
+++ jdk9/jdk/src/java.base/share/conf/security/java.security
@@ -304,6 +304,8 @@
#
package.access=sun.misc.,\
sun.reflect.,\
+ org.GNOME.Accessibility.,\
+ org.GNOME.Bonobo.,\
#
# List of comma-separated packages that start with or equal this string
@@ -316,6 +318,8 @@
#
package.definition=sun.misc.,\
sun.reflect.,\
+ org.GNOME.Accessibility.,\
+ org.GNOME.Bonobo.,\
#
# Determines whether this properties file can be appended to

10
jconsole.desktop.in Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=OpenJDK 9 Monitoring & Management Console #ARCH#
Comment=Monitor and manage OpenJDK applications for #ARCH#
Exec=#JAVA_HOME#/jconsole
Icon=java-9
Terminal=false
Type=Application
StartupWMClass=sun-tools-jconsole-JConsole
Categories=Development;Monitor;Java;
Version=1.0

274
jstack-pr1845.patch Normal file
View File

@ -0,0 +1,274 @@
diff -r c728621e76f2 tapset/jstack.stp.in
--- tapset/jstack-9.stp.in Mon Jun 02 18:41:24 2014 +0100
+++ tapset/jstack-9.stp.in Sat Jun 14 00:21:14 2014 +0900
@@ -45,11 +45,7 @@
semantic error: failed to retrieve location attribute for local
*/
-global Universe_methodKlassObj;
-global Universe_collectedHeap;
-global HeapWordSize;
global CodeCache_heap;
-global NarrowOopStruct;
global sp_register;
global fp_register;
@@ -57,9 +53,8 @@
global ptr_size;
global ptr_mask;
-global constantPoolOopDesc_size;
+global constantPool_size;
global HeapBlock_Header_size;
-global oopDesc_size;
global vm_inited;
@@ -67,26 +62,6 @@
in a bare function and vm_init_end seems a good place to use. */
probe hotspot.vm_init_end
{
- // The parent/type oop for a methodOop.
- Universe_methodKlassObj[pid()] = %( systemtap_v >= "1.8"
- %? @var("_methodKlassObj@universe.cpp")
- %: $_methodKlassObj %);
-
- /**
- * The Universe class holds some of the interesting statics for
- * introspection into HotSpot. The CollectedHeap
- * (Universe::_collectedHeap) is an abstraction of a java heap for Hotspot
- * it contains a _reserved MemRegion which represents a contigous
- * region of the address space consisting of HeapWords (which just
- * have one field member char *i).
- *
- * Note that we access it through its "short name" _collectedHeap.
- */
- Universe_collectedHeap[pid()] = %( systemtap_v >= "1.8"
- %? @var("_collectedHeap@universe.cpp")
- %: $_collectedHeap %);
- HeapWordSize[pid()] = $HeapWordSize;
-
/**
* The CodeCache class contains the static CodeHeap _heap that
* is malloced at the start of the vm run and holds all generated
@@ -107,17 +82,6 @@
%? @var("_heap@codeCache.cpp")
%: $_heap %);
- /**
- * Does target process use CompressedOops ?
- */
- NarrowOopStruct[pid()] = 0;
- %( systemtap_v >= "1.8"
- %? if (@var("UseCompressedOops@globals.cpp"))
- NarrowOopStruct[pid()] = &@var("_narrow_oop@universe.cpp");
- %: if($UseCompressedOops)
- NarrowOopStruct[pid()] = $_narrow_oop;
- %)
-
// Should really check arch of user space (for 32bit jvm on 64bit kernel).
%( arch == "i386" %?
sp_register = "esp";
@@ -136,22 +100,17 @@
// Pretend we have an array at address zero and take address of second
// element and we have the size.
- constantPoolOopDesc_size = &@cast(0, "constantPoolOopDesc")[1];
+ constantPool_size = &@cast(0, "ConstantPool")[1];
// Really should get from dwarf: @size("HeapBlock::Header"), @size("oopDesc")
HeapBlock_Header_size = 2 * ptr_size;
- oopDesc_size = 2 * ptr_size;
vm_inited[pid()] = 1;
}
probe hotspot.vm_shutdown
{
- delete(Universe_methodKlassObj[pid()]);
- delete(Universe_collectedHeap[pid()]);
- delete(HeapWordSize[pid()]);
delete(CodeCache_heap[pid()]);
- delete(NarrowOopStruct[pid()]);
delete(vm_inited[pid()]);
}
@@ -262,15 +221,7 @@
return frame;
}
- // Extract heap and code bounds.
- heap_start = @cast(Universe_collectedHeap[pid()],
- "CollectedHeap",
- "@ABS_SERVER_LIBJVM_SO@")->_reserved->_start;
- heap_size = HeapWordSize[pid()] * @cast(Universe_collectedHeap[pid()],
- "CollectedHeap",
- "@ABS_SERVER_LIBJVM_SO@")->_reserved->_word_size;
- heap_end = heap_start + heap_size;
-
+ // Extract code bounds.
CodeCache_low = @cast(CodeCache_heap[pid()], "CodeHeap",
"@ABS_SERVER_LIBJVM_SO@")->_memory->_low;
CodeCache_high = @cast(CodeCache_heap[pid()], "CodeHeap",
@@ -351,105 +302,69 @@
// For the interpreter (and other code blobs) it is on the
// stack relative to the frame pointer.
if (blob_name == "nmethod")
- methodOopPtr = @cast(blob, "nmethod",
+ methodPtr = @cast(blob, "nmethod",
"@ABS_SERVER_LIBJVM_SO@")->_method
else
- methodOopPtr = user_long(fp + (-3 * ptr_size)) & ptr_mask
-
- // Start optimistic. A methodOop is only valid if it was
- // heap allocated. And if the "type class" oop equals the
- // Universe::methodKlassObj.
- if (heap_start > methodOopPtr || methodOopPtr >= heap_end)
- isMethodOop = 0
- else
- {
- if (NarrowOopStruct[pid()])
- {
- methodOopKlass = @cast(methodOopPtr, "methodOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_metadata->_compressed_klass;
- methodOopKlass = (@cast(NarrowOopStruct[pid()],
- "NarrowOopStruct",
- "@ABS_SERVER_LIBJVM_SO@")->_base
- + (methodOopKlass
- << @cast(NarrowOopStruct[pid()],
- "NarrowOopStruct",
- "@ABS_SERVER_LIBJVM_SO@")->_shift));
- }
- else
- methodOopKlass = @cast(methodOopPtr, "methodOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_metadata->_klass;
+ methodPtr = user_long(fp + (-3 * ptr_size)) & ptr_mask
- isMethodOop = (methodOopKlass == Universe_methodKlassObj[pid()]);
- }
+ // The java class is the holder of the constants (strings)
+ // that describe the method and signature. This constant pool
+ // contains symbolic information that describe the properties
+ // of the class. The indexes for methods and signaturates in
+ // the constant pool are Symbols that contain utf8
+ // strings (plus lenghts). (We could also sanity check that
+ // the tag value is correct [CONSTANT_String = 8]).
+ // Note that the class name uses '/' instead of '.' as
+ // package name separator and that the method signature is
+ // encoded as a method descriptor string. Both of which we
+ // don't demangle here.
+ constMethod = @cast(methodPtr, "Method",
+ "@ABS_SERVER_LIBJVM_SO@")->_constMethod;
+ constantPool = @cast(constMethod, "ConstMethod",
+ "@ABS_SERVER_LIBJVM_SO@")->_constants;
+ constantPool_base = constantPool + constantPool_size;
+
+ klass = @cast(constantPool, "ConstantPool",
+ "@ABS_SERVER_LIBJVM_SO@")->_pool_holder;
+ klassSymbol = @cast(klass, "Klass",
+ "@ABS_SERVER_LIBJVM_SO@")->_name;
+ klassName = &@cast(klassSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_body[0];
+ klassLength = @cast(klassSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_length;
+
+ methodIndex = @cast(constMethod, "ConstMethod",
+ "@ABS_SERVER_LIBJVM_SO@")->_name_index;
+ methodSymbol = user_long(constantPool_base + (methodIndex * ptr_size));
+ methodName = &@cast(methodSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_body[0];
+ methodLength = @cast(methodSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_length;
- if (isMethodOop)
+ if (log_sig)
{
- // The java class is the holder of the constants (strings)
- // that describe the method and signature. This constant pool
- // contains symbolic information that describe the properties
- // of the class. The indexes for methods and signaturates in
- // the constant pool are Symbols that contain utf8
- // strings (plus lenghts). (We could also sanity check that
- // the tag value is correct [CONSTANT_String = 8]).
- // Note that the class name uses '/' instead of '.' as
- // package name separator and that the method signature is
- // encoded as a method descriptor string. Both of which we
- // don't demangle here.
- constantPoolOopDesc = @cast(methodOopPtr, "methodOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_constants;
- constantPoolOop_base = constantPoolOopDesc + constantPoolOopDesc_size;
-
- klassPtr = @cast(constantPoolOopDesc, "constantPoolOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_pool_holder;
- klassSymbol = @cast(klassPtr + oopDesc_size, "Klass",
- "@ABS_SERVER_LIBJVM_SO@")->_name;
- klassName = &@cast(klassSymbol, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_body[0];
- klassLength = @cast(klassSymbol, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_length;
-
- methodIndex = @cast(methodOopPtr, "methodOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_constMethod->_name_index;
- methodOopDesc = user_long(constantPoolOop_base + (methodIndex * ptr_size)) - 1;
- methodName = &@cast(methodOopDesc, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_body[0];
- methodLength = @cast(methodOopDesc, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_length;
-
- if (log_sig)
- {
- sigIndex = @cast(methodOopPtr, "methodOopDesc",
- "@ABS_SERVER_LIBJVM_SO@")->_constMethod->_signature_index;
- sigOopDesc = user_long(constantPoolOop_base
- + (sigIndex * ptr_size)) - 1;
- sigName = &@cast(sigOopDesc, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_body[0];
- sigLength = @cast(sigOopDesc, "Symbol",
- "@ABS_SERVER_LIBJVM_SO@")->_length;
- sig = user_string_n(sigName, sigLength);
- }
- else
- sig = "";
-
- code_name = (log_native
- ? sprintf("<%s@0x%x>",
- str_replace(blob_name, " ", "_"), pc)
- : "");
-
- frame = sprintf("%s.%s%s%s",
- user_string_n(klassName, klassLength),
- user_string_n(methodName, methodLength),
- sig, code_name);
+ sigIndex = @cast(constMethod, "ConstMethod",
+ "@ABS_SERVER_LIBJVM_SO@")->_signature_index;
+ sigSymbol = user_long(constantPool_base
+ + (sigIndex * ptr_size));
+ sigName = &@cast(sigSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_body[0];
+ sigLength = @cast(sigSymbol, "Symbol",
+ "@ABS_SERVER_LIBJVM_SO@")->_length;
+ sig = user_string_n(sigName, sigLength);
}
else
- {
- // This is probably just an internal function, not a java
- // method, just print the blob_name and continue.
- // fp is probably still trusted.
- if (log_native)
- frame = sprintf("<%s@0x%x>",
- str_replace(blob_name, " ", "_"), pc);
- }
+ sig = "";
+
+ code_name = (log_native
+ ? sprintf("<%s@0x%x>",
+ str_replace(blob_name, " ", "_"), pc)
+ : "");
+
+ frame = sprintf("%s.%s%s%s",
+ user_string_n(klassName, klassLength),
+ user_string_n(methodName, methodLength),
+ sig, code_name);
// We cannot trust the frame pointer of compiled methods.
// The server (c2) jit compiler uses the fp register.

View File

@ -0,0 +1,19 @@
Remove uses of FAR in jpeg code
Upstream libjpeg-trubo removed the (empty) FAR macro:
http://sourceforge.net/p/libjpeg-turbo/code/1312/
Adjust our code to not use the undefined FAR macro anymore.
diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
--- jdk9/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
+++ jdk9/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
@@ -1385,7 +1385,7 @@
/* and fill it in */
dst_ptr = icc_data;
for (seq_no = first; seq_no < last; seq_no++) {
- JOCTET FAR *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN;
+ JOCTET *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN;
unsigned int length =
icc_markers[seq_no]->data_length - ICC_OVERHEAD_LEN;

View File

@ -0,0 +1,74 @@
# HG changeset patch
# User andrew
# Date 1352129932 0
# Node ID e9c857dcb964dbfa5eef3a3590244cb4d999cf7a
# Parent 1406789608b76d0906881979335d685855f44190
Allow multiple PKCS11 library initialisation to be a non-critical error.
diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/Config.java
--- jdk9/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Tue Oct 30 13:05:14 2012 +0000
+++ jdk9/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java Mon Nov 05 15:38:52 2012 +0000
@@ -52,6 +52,7 @@
static final int ERR_HALT = 1;
static final int ERR_IGNORE_ALL = 2;
static final int ERR_IGNORE_LIB = 3;
+ static final int ERR_IGNORE_MULTI_INIT = 4;
// same as allowSingleThreadedModules but controlled via a system property
// and applied to all providers. if set to false, no SunPKCS11 instances
@@ -980,6 +981,8 @@
handleStartupErrors = ERR_IGNORE_LIB;
} else if (val.equals("halt")) {
handleStartupErrors = ERR_HALT;
+ } else if (val.equals("ignoreMultipleInitialisation")) {
+ handleStartupErrors = ERR_IGNORE_MULTI_INIT;
} else {
throw excToken("Invalid value for handleStartupErrors:");
}
diff -r 1406789608b7 -r e9c857dcb964 src/share/classes/sun/security/pkcs11/SunPKCS11.java
--- jdk9/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Tue Oct 30 13:05:14 2012 +0000
+++ jdk9/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java Mon Nov 05 15:38:52 2012 +0000
@@ -168,26 +168,37 @@
String nssLibraryDirectory = config.getNssLibraryDirectory();
String nssSecmodDirectory = config.getNssSecmodDirectory();
boolean nssOptimizeSpace = config.getNssOptimizeSpace();
+ int errorHandling = config.getHandleStartupErrors();
if (secmod.isInitialized()) {
if (nssSecmodDirectory != null) {
String s = secmod.getConfigDir();
if ((s != null) &&
(s.equals(nssSecmodDirectory) == false)) {
- throw new ProviderException("Secmod directory "
- + nssSecmodDirectory
- + " invalid, NSS already initialized with "
- + s);
+ String msg = "Secmod directory " + nssSecmodDirectory
+ + " invalid, NSS already initialized with " + s;
+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
+ errorHandling == Config.ERR_IGNORE_ALL) {
+ throw new UnsupportedOperationException(msg);
+ } else {
+ throw new ProviderException(msg);
+ }
}
}
if (nssLibraryDirectory != null) {
String s = secmod.getLibDir();
if ((s != null) &&
(s.equals(nssLibraryDirectory) == false)) {
- throw new ProviderException("NSS library directory "
+ String msg = "NSS library directory "
+ nssLibraryDirectory
+ " invalid, NSS already initialized with "
- + s);
+ + s;
+ if (errorHandling == Config.ERR_IGNORE_MULTI_INIT ||
+ errorHandling == Config.ERR_IGNORE_ALL) {
+ throw new UnsupportedOperationException(msg);
+ } else {
+ throw new ProviderException(msg);
+ }
}
}
} else {

5
nss.cfg Normal file
View File

@ -0,0 +1,5 @@
name = NSS
nssLibraryDirectory = @NSS_LIBDIR@
nssDbMode = noDb
attributes = compatibility
handleStartupErrors = ignoreMultipleInitialisation

10
policytool.desktop.in Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=OpenJDK 9 Policy Tool #ARCH#
Comment=Manage OpenJDK policy files #ARCH#
Exec=#JRE_HOME#/policytool
Icon=java-9
Terminal=false
Type=Application
StartupWMClass=sun-security-tools-PolicyTool
Categories=Settings;Java;
Version=1.0

View File

@ -0,0 +1,48 @@
diff --git a/src/cpu/zero/vm/stack_zero.hpp b/src/cpu/zero/vm/stack_zero.hpp
--- jdk9/hotspot/src/cpu/zero/vm/stack_zero.hpp
+++ jdk9/hotspot/src/cpu/zero/vm/stack_zero.hpp
@@ -99,7 +99,7 @@
int shadow_pages_size() const {
return _shadow_pages_size;
}
- int abi_stack_available(Thread *thread) const;
+ ssize_t abi_stack_available(Thread *thread) const;
public:
void overflow_check(int required_words, TRAPS);
diff --git a/src/cpu/zero/vm/stack_zero.inline.hpp b/src/cpu/zero/vm/stack_zero.inline.hpp
--- jdk9/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
+++ jdk9/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
@@ -47,12 +47,12 @@
// This method returns the amount of ABI stack available for us
// to use under normal circumstances. Note that the returned
// value can be negative.
-inline int ZeroStack::abi_stack_available(Thread *thread) const {
+inline ssize_t ZeroStack::abi_stack_available(Thread *thread) const {
guarantee(Thread::current() == thread, "should run in the same thread");
- int stack_used = thread->stack_base() - (address) &stack_used
+ ssize_t stack_used = thread->stack_base() - (address) &stack_used
+ (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size());
- int stack_free = thread->stack_size() - stack_used;
+ ssize_t stack_free = thread->stack_size() - stack_used;
return stack_free;
}
#endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
--- jdk9/hotspot/src/os/posix/vm/os_posix.cpp
+++ jdk9/hotspot/src/os/posix/vm/os_posix.cpp
@@ -4791,6 +4791,13 @@
JavaThread::stack_shadow_zone_size();
_java_thread_min_stack_allowed = align_size_up(_java_thread_min_stack_allowed, vm_page_size());
+#ifdef ZERO
+ // If this is Zero, allow at the very minimum one page each for the
+ // Zero stack and the native stack. This won't make any difference
+ // for 4k pages, but is significant for large pages.
+ _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed,
+ align_size_up((size_t)(JavaThread::stack_guard_zone_size()+JavaThread::stack_shadow_zone_size()+2) * vm_page_size(), vm_page_size());
+#endif
size_t stack_size_in_bytes = ThreadStackSize * K;
if (stack_size_in_bytes != 0 &&

129
remove-intree-libraries.sh Normal file
View File

@ -0,0 +1,129 @@
#!/bin/sh
ZIP_SRC=jdk/src/java.base/share/native/libzip/zlib/
JPEG_SRC=jdk/src/java.desktop/share/native/libjavajpeg/
GIF_SRC=jdk/src/java.desktop/share/native/libsplashscreen/giflib/
PNG_SRC=jdk/src/java.desktop/share/native/libsplashscreen/libpng/
LCMS_SRC=jdk/src/java.desktop/share/native/liblcms/
cd openjdk
echo "Removing built-in libs (they will be linked)"
echo "Removing zlib"
if [ ! -d ${ZIP_SRC} ]; then
echo "${ZIP_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${ZIP_SRC}
echo "Removing libjpeg"
if [ ! -f ${JPEG_SRC}/jdhuff.c ]; then # some file that sound definitely exist
echo "${JPEG_SRC} does not contain jpeg sources. Refusing to proceed."
exit 1
fi
rm -vf ${JPEG_SRC}/jcomapi.c
rm -vf ${JPEG_SRC}/jdapimin.c
rm -vf ${JPEG_SRC}/jdapistd.c
rm -vf ${JPEG_SRC}/jdcoefct.c
rm -vf ${JPEG_SRC}/jdcolor.c
rm -vf ${JPEG_SRC}/jdct.h
rm -vf ${JPEG_SRC}/jddctmgr.c
rm -vf ${JPEG_SRC}/jdhuff.c
rm -vf ${JPEG_SRC}/jdhuff.h
rm -vf ${JPEG_SRC}/jdinput.c
rm -vf ${JPEG_SRC}/jdmainct.c
rm -vf ${JPEG_SRC}/jdmarker.c
rm -vf ${JPEG_SRC}/jdmaster.c
rm -vf ${JPEG_SRC}/jdmerge.c
rm -vf ${JPEG_SRC}/jdphuff.c
rm -vf ${JPEG_SRC}/jdpostct.c
rm -vf ${JPEG_SRC}/jdsample.c
rm -vf ${JPEG_SRC}/jerror.c
rm -vf ${JPEG_SRC}/jerror.h
rm -vf ${JPEG_SRC}/jidctflt.c
rm -vf ${JPEG_SRC}/jidctfst.c
rm -vf ${JPEG_SRC}/jidctint.c
rm -vf ${JPEG_SRC}/jidctred.c
rm -vf ${JPEG_SRC}/jinclude.h
rm -vf ${JPEG_SRC}/jmemmgr.c
rm -vf ${JPEG_SRC}/jmemsys.h
rm -vf ${JPEG_SRC}/jmemnobs.c
rm -vf ${JPEG_SRC}/jmorecfg.h
rm -vf ${JPEG_SRC}/jpegint.h
rm -vf ${JPEG_SRC}/jpeglib.h
rm -vf ${JPEG_SRC}/jquant1.c
rm -vf ${JPEG_SRC}/jquant2.c
rm -vf ${JPEG_SRC}/jutils.c
rm -vf ${JPEG_SRC}/jcapimin.c
rm -vf ${JPEG_SRC}/jcapistd.c
rm -vf ${JPEG_SRC}/jccoefct.c
rm -vf ${JPEG_SRC}/jccolor.c
rm -vf ${JPEG_SRC}/jcdctmgr.c
rm -vf ${JPEG_SRC}/jchuff.c
rm -vf ${JPEG_SRC}/jchuff.h
rm -vf ${JPEG_SRC}/jcinit.c
rm -vf ${JPEG_SRC}/jconfig.h
rm -vf ${JPEG_SRC}/jcmainct.c
rm -vf ${JPEG_SRC}/jcmarker.c
rm -vf ${JPEG_SRC}/jcmaster.c
rm -vf ${JPEG_SRC}/jcparam.c
rm -vf ${JPEG_SRC}/jcphuff.c
rm -vf ${JPEG_SRC}/jcprepct.c
rm -vf ${JPEG_SRC}/jcsample.c
rm -vf ${JPEG_SRC}/jctrans.c
rm -vf ${JPEG_SRC}/jdtrans.c
rm -vf ${JPEG_SRC}/jfdctflt.c
rm -vf ${JPEG_SRC}/jfdctfst.c
rm -vf ${JPEG_SRC}/jfdctint.c
rm -vf ${JPEG_SRC}/jversion.h
rm -vf ${JPEG_SRC}/README
echo "Removing giflib"
if [ ! -d ${GIF_SRC} ]; then
echo "${GIF_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${GIF_SRC}
echo "Removing libpng"
if [ ! -d ${PNG_SRC} ]; then
echo "${PNG_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -rvf ${PNG_SRC}
echo "Removing lcms"
if [ ! -d ${LCMS_SRC} ]; then
echo "${LCMS_SRC} does not exist. Refusing to proceed."
exit 1
fi
rm -vf ${LCMS_SRC}/cmscam02.c
rm -vf ${LCMS_SRC}/cmscgats.c
rm -vf ${LCMS_SRC}/cmscnvrt.c
rm -vf ${LCMS_SRC}/cmserr.c
rm -vf ${LCMS_SRC}/cmsgamma.c
rm -vf ${LCMS_SRC}/cmsgmt.c
rm -vf ${LCMS_SRC}/cmshalf.c
rm -vf ${LCMS_SRC}/cmsintrp.c
rm -vf ${LCMS_SRC}/cmsio0.c
rm -vf ${LCMS_SRC}/cmsio1.c
rm -vf ${LCMS_SRC}/cmslut.c
rm -vf ${LCMS_SRC}/cmsmd5.c
rm -vf ${LCMS_SRC}/cmsmtrx.c
rm -vf ${LCMS_SRC}/cmsnamed.c
rm -vf ${LCMS_SRC}/cmsopt.c
rm -vf ${LCMS_SRC}/cmspack.c
rm -vf ${LCMS_SRC}/cmspcs.c
rm -vf ${LCMS_SRC}/cmsplugin.c
rm -vf ${LCMS_SRC}/cmsps2.c
rm -vf ${LCMS_SRC}/cmssamp.c
rm -vf ${LCMS_SRC}/cmssm.c
rm -vf ${LCMS_SRC}/cmstypes.c
rm -vf ${LCMS_SRC}/cmsvirt.c
rm -vf ${LCMS_SRC}/cmswtpnt.c
rm -vf ${LCMS_SRC}/cmsxform.c
rm -vf ${LCMS_SRC}/lcms2.h
rm -vf ${LCMS_SRC}/lcms2_internal.h
rm -vf ${LCMS_SRC}/lcms2_plugin.h

View File

@ -0,0 +1,10 @@
--- jdk9/jdk/src/java.base/share/conf/security/java.security
+++ jdk9/jdk/src/java.base/share/conf/security/java.security
@@ -67,7 +67,6 @@
#endif
security.provider.tbd=SUN
security.provider.tbd=SunRsaSign
-security.provider.tbd=SunEC
security.provider.tbd=SunJSSE
security.provider.tbd=SunJCE
security.provider.tbd=SunJGSS

View File

@ -0,0 +1,34 @@
#!/bin/sh
# https://bugzilla.redhat.com/show_bug.cgi?id=1142153
M=META-INF/MANIFEST.MF
#P=/usr/lib/jvm/java/jre/lib/security
P=$1/lib/security
for f in local_policy.jar US_export_policy.jar ; do
ORIG=$P/$f
echo "processing $f ($ORIG)"
if [ ! -f $ORIG ]; then
echo "File not found!"
continue
fi
d=`mktemp -d`
NW=$d/$f
pushd $d
jar xf $ORIG
cat $M
# sed -i "s/Created-By.*/Created-By: 1.7.0/g" $M
sed -i "s/Created-By.*/Created-By: $2/g" $M
cat $M
find . -exec touch -t 201401010000 {} +
zip -rX $f *
popd
echo "replacing $ORIG"
md5sum $ORIG
sha256sum $ORIG
echo "by $NW"
md5sum $NW
sha256sum $NW
cp $NW $ORIG
md5sum $ORIG
sha256sum $ORIG
rm -rfv $d
done

12
sorted-diff.patch Normal file
View File

@ -0,0 +1,12 @@
--- jdk9/jdk/make/gensrc/GensrcX11Wrappers.gmk
+++ jdk9/jdk/make/gensrc/GensrcX11Wrappers.gmk
@@ -117,7 +117,8 @@
$(call LogInfo, Verifying X11 wrapper sizes)
$(call MakeDir, $(@D))
$(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp
- $(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
+ $(SORT) $(GENSRC_X11WRAPPERS_TMP)/sizes.$* > $@-orig.tmp
+ $(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification-orig.tmp
mv $@.tmp $@
GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/sizes.$(OPENJDK_TARGET_CPU_BITS).verification

2
sources Normal file
View File

@ -0,0 +1,2 @@
SHA512 (systemtap-tapset-3.1.0.tar.xz) = 0dbddb55d9e92df02b6f39ed57261d44a78fba21a9e53f9645a754a5394d322be6eaf92e98e60fa5f2f5339b89f262a3646ac341338993d83b83092d1e2a14a5
SHA512 (jdk9-jdk9-jdk-9+181.tar.xz) = dc9b20538d4d08e1ecdc7764dad1e3b308b62ba6cce7b78c754444f5b48598a73c3e64728871c9129bee51e4964daf29eaf331e89b2b06801188d562c8887940

184
update_package.sh Executable file
View File

@ -0,0 +1,184 @@
#!/bin/bash -x
# Generates the 'source tarball' for JDK 8 projects and update spec infrastructure
# By default, this script regenerate source as they are currently used.
# so if the version of sources change, this file changes and is pushed
#
# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg:
# PROJECT_NAME=jdk9
# REPO_NAME=jdk9
# VERSION=inDevelopment (but keyword tip will still do its job)
#
# If you don't, default are used and so already uploaded tarball regenerated
# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set)
#
# For other useful variables see generate_source_tarball.sh
#
# the used values are then substituted to spec and sources
if [ ! "x$PR2126" = "x" ] ; then
if [ ! -f "$PR2126" ] ; then
echo "You have specified PR2126 as $PR2126 but it does not exists. exiting"
exit 1
fi
fi
set -e
if [ "x$PROJECT_NAME" = "x" ] ; then
PROJECT_NAME="jdk9"
fi
if [ "x$REPO_NAME" = "x" ] ; then
REPO_NAME="jdk9"
fi
if [ "x$VERSION" = "x" ] ; then
VERSION="jdk-9+181"
fi
if [ "x$COMPRESSION" = "x" ] ; then
# rhel 5 needs tar.gz
COMPRESSION=xz
fi
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
fi
#if [ "x$PKG" = "x" ] ; then
# URL=`cat .git/config | grep url`
# PKG=${URL##*/}
#fi
if [ "x$SPEC" = "x" ] ; then
SPEC=${PKG}.spec
fi
if [ "x$RELEASE" = "x" ] ; then
RELEASE=1
fi
FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
if [ ! -f ${FILENAME} ] ; then
echo "Generating ${FILENAME}"
. ./generate_source_tarball.sh
else
echo "${FILENAME} already exists, using"
fi
echo "nothing more TBD for 9!!"
exit 0
echo "Touching spec: $SPEC"
sed -i "s/^%global\s\+project.*/%global project ${PROJECT_NAME}/" $SPEC
sed -i "s/^%global\s\+repo.*/%global repo ${REPO_NAME}/" $SPEC
sed -i "s/^%global\s\+revision.*/%global revision ${VERSION}/" $SPEC
# updated sources, resetting release
sed -i "s/^Release:.*/Release: $RELEASE.%{buildver}%{?dist}/" $SPEC
#https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Bash
function levenshtein {
if [ "$#" -ne "2" ]; then
echo "Usage: $0 word1 word2" >&2
elif [ "${#1}" -lt "${#2}" ]; then
levenshtein "$2" "$1"
else
local str1len=$((${#1}))
local str2len=$((${#2}))
local d i j
for i in $(seq 0 $(((str1len+1)*(str2len+1)))); do
d[i]=0
done
for i in $(seq 0 $((str1len))); do
d[$((i+0*str1len))]=$i
done
for j in $(seq 0 $((str2len))); do
d[$((0+j*(str1len+1)))]=$j
done
for j in $(seq 1 $((str2len))); do
for i in $(seq 1 $((str1len))); do
[ "${1:i-1:1}" = "${2:j-1:1}" ] && local cost=0 || local cost=1
local del=$((d[(i-1)+str1len*j]+1))
local ins=$((d[i+str1len*(j-1)]+1))
local alt=$((d[(i-1)+str1len*(j-1)]+cost))
d[i+str1len*j]=$(echo -e "$del\n$ins\n$alt" | sort -n | head -1)
done
done
echo ${d[str1len+str1len*(str2len)]}
fi
}
# generate shenandoah hotspot
# that means supply the underlying script with new values
# to new filename.
MAIN_VERSION=$VERSION
if [ "x$VERSION" = "xtip" ] ; then
VERSION="tip"
else
#hardcoding version for anything else except tip
VERSION="aarch64-shenandoah-jdk8u131-b12-shenandoah-merge-2017-04-20"
fi
MAIN_REPO_NAME=$REPO_NAME
REPO_NAME=jdk8u-shenandoah
MAIN_FILE_NAME_ROOT=$FILE_NAME_ROOT
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
FILENAME_SH=${FILE_NAME_ROOT}.tar.${COMPRESSION}
REPOS="hotspot"
if [ ! -f ${FILENAME_SH} ] ; then
echo "Generating ${FILENAME_SH}"
. ./generate_source_tarball.sh
else
echo "${FILENAME_SH} already exists, using"
fi
sed -i "s/^Source1:.*/Source1: ${FILENAME_SH}/" $SPEC
git --no-pager diff $SPEC
# find the most similar sources name and replace it by newly generated one.
echo "Old sources"
cat sources
a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"`
winner=""
winnerDistance=999999
for x in $a_sources ; do
distance=`levenshtein $x ${FILENAME}`
if [ $distance -lt $winnerDistance ] ; then
winner=$x
winnerDistance=$distance
fi
done
sum=`md5sum ${FILENAME}`
sed -i "s;.*$winner;$sum;" sources
# now shenandoah hotspot
winner=""
winnerDistance=999999
for x in $a_sources ; do
distance=`levenshtein $x ${FILENAME_SH}`
if [ $distance -lt $winnerDistance ] ; then
winner=$x
winnerDistance=$distance
fi
done
sum=`md5sum ${FILENAME_SH}`
sed -i "s;.*$winner;$sum;" sources
echo "New sources"
cat sources
a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"`
echo " you can get inspired by following %changelog template:"
user_name=`whoami`
user_record=$(getent passwd $user_name)
user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5)
user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1)
spec_date=`date +"%a %b %d %Y"`
# See spec:
revision_helper=`echo ${MAIN_VERSION%-*}`
updatever=`echo ${revision_helper##*u}`
buildver=`echo ${MAIN_VERSION##*-}`
echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:1.8.0.$updatever-$RELEASE.$buildver"
echo "- updated to $MAIN_VERSION (from $PROJECT_NAME/$MAIN_REPO_NAME)"
echo "- updated to $VERSION (from $PROJECT_NAME/$REPO_NAME) of hotspot"
echo "- used $FILENAME as new sources"
echo "- used $FILENAME_SH as new sources for hotspot"
echo " execute:"
echo "fedpkg/rhpkg new-sources "$a_sources
echo " to upload sources"
echo "you can verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl"