This commit is contained in:
Jesper Wilhelmsson 2017-08-16 21:16:30 +02:00
commit 31ebdb6fdd
56 changed files with 240 additions and 368 deletions

View File

@ -46,6 +46,7 @@ $(eval $(call SetupBuildLauncher, jaotc, \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
-XX:+UseAOT \ -XX:+UseAOT \
-XX:+CalculateClassFingerprint \
-Djvmci.UseProfilingInformation=false \ -Djvmci.UseProfilingInformation=false \
-Dgraal.UseExceptionProbability=false \ -Dgraal.UseExceptionProbability=false \
-Djvmci.Compiler=graal \ -Djvmci.Compiler=graal \

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -35,12 +35,14 @@ include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include TestFilesCompilation.gmk include TestFilesCompilation.gmk
$(eval $(call IncludeCustomExtension, jdk, test/JtregNative.gmk))
################################################################################ ################################################################################
# Targets for building the native tests themselves. # Targets for building the native tests themselves.
################################################################################ ################################################################################
# Add more directories here when needed. # Add more directories here when needed.
BUILD_JDK_JTREG_NATIVE_SRC := \ BUILD_JDK_JTREG_NATIVE_SRC += \
$(JDK_TOPDIR)/test/native_sanity \ $(JDK_TOPDIR)/test/native_sanity \
$(JDK_TOPDIR)/test/java/lang/String/nativeEncoding \ $(JDK_TOPDIR)/test/java/lang/String/nativeEncoding \
# #

View File

@ -64,7 +64,7 @@
#include <sys/uio.h> #include <sys/uio.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sys/poll.h> #include <poll.h>
#include "jvm.h" #include "jvm.h"
#include "net_util.h" #include "net_util.h"

View File

@ -34,7 +34,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/poll.h> #include <poll.h>
#include <sys/pollset.h> #include <sys/pollset.h>
#include <fcntl.h> #include <fcntl.h>
#include <stddef.h> #include <stddef.h>

View File

@ -36,7 +36,7 @@
#include <sys/uio.h> #include <sys/uio.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sys/poll.h> #include <poll.h>
#include "jvm.h" #include "jvm.h"
#include "net_util.h" #include "net_util.h"

View File

@ -32,7 +32,7 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/poll.h> #include <poll.h>
#include <sys/inotify.h> #include <sys/inotify.h>
#include "sun_nio_fs_LinuxWatchService.h" #include "sun_nio_fs_LinuxWatchService.h"

View File

@ -60,7 +60,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <sys/signal.h> #include <signal.h>
/* O Flags */ /* O Flags */

View File

@ -290,8 +290,6 @@ static int (*main_fptr)(int argc, char **argv) = NULL;
*/ */
static void *apple_main (void *arg) static void *apple_main (void *arg)
{ {
objc_registerThreadWithCollector();
if (main_fptr == NULL) { if (main_fptr == NULL) {
#ifdef STATIC_BUILD #ifdef STATIC_BUILD
extern int main(int argc, char **argv); extern int main(int argc, char **argv);
@ -732,6 +730,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (stack_size > 0) { if (stack_size > 0) {
pthread_attr_setstacksize(&attr, stack_size); pthread_attr_setstacksize(&attr, stack_size);
} }
pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp; void * tmp;
@ -771,7 +770,7 @@ JLI_GetJavaVMInstance()
void void
RegisterThread() RegisterThread()
{ {
objc_registerThreadWithCollector(); // stubbed out for windows and *nixes.
} }
static void static void

View File

@ -38,7 +38,7 @@
#include <sys/uio.h> #include <sys/uio.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sys/poll.h> #include <poll.h>
#include "jvm.h" #include "jvm.h"
#include "net_util.h" #include "net_util.h"

View File

@ -2241,22 +2241,12 @@ public class File
UNSAFE.putIntVolatile(this, PREFIX_LENGTH_OFFSET, fs.prefixLength(path)); UNSAFE.putIntVolatile(this, PREFIX_LENGTH_OFFSET, fs.prefixLength(path));
} }
private static final long PATH_OFFSET; private static final jdk.internal.misc.Unsafe UNSAFE
private static final long PREFIX_LENGTH_OFFSET; = jdk.internal.misc.Unsafe.getUnsafe();
private static final jdk.internal.misc.Unsafe UNSAFE; private static final long PATH_OFFSET
static { = UNSAFE.objectFieldOffset(File.class, "path");
try { private static final long PREFIX_LENGTH_OFFSET
jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe(); = UNSAFE.objectFieldOffset(File.class, "prefixLength");
PATH_OFFSET = unsafe.objectFieldOffset(
File.class.getDeclaredField("path"));
PREFIX_LENGTH_OFFSET = unsafe.objectFieldOffset(
File.class.getDeclaredField("prefixLength"));
UNSAFE = unsafe;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */ /** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = 301077366599181567L; private static final long serialVersionUID = 301077366599181567L;

View File

@ -2864,26 +2864,14 @@ public final class Class<T> implements java.io.Serializable,
// and have to avoid calling it in the static initializer of the Class class... // and have to avoid calling it in the static initializer of the Class class...
private static final Unsafe unsafe = Unsafe.getUnsafe(); private static final Unsafe unsafe = Unsafe.getUnsafe();
// offset of Class.reflectionData instance field // offset of Class.reflectionData instance field
private static final long reflectionDataOffset; private static final long reflectionDataOffset
= unsafe.objectFieldOffset(Class.class, "reflectionData");
// offset of Class.annotationType instance field // offset of Class.annotationType instance field
private static final long annotationTypeOffset; private static final long annotationTypeOffset
= unsafe.objectFieldOffset(Class.class, "annotationType");
// offset of Class.annotationData instance field // offset of Class.annotationData instance field
private static final long annotationDataOffset; private static final long annotationDataOffset
= unsafe.objectFieldOffset(Class.class, "annotationData");
static {
Field[] fields = Class.class.getDeclaredFields0(false); // bypass caches
reflectionDataOffset = objectFieldOffset(fields, "reflectionData");
annotationTypeOffset = objectFieldOffset(fields, "annotationType");
annotationDataOffset = objectFieldOffset(fields, "annotationData");
}
private static long objectFieldOffset(Field[] fields, String fieldName) {
Field field = searchFields(fields, fieldName);
if (field == null) {
throw new Error("No " + fieldName + " field found in java.lang.Class");
}
return unsafe.objectFieldOffset(field);
}
static <T> boolean casReflectionData(Class<?> clazz, static <T> boolean casReflectionData(Class<?> clazz,
SoftReference<ReflectionData<T>> oldData, SoftReference<ReflectionData<T>> oldData,

View File

@ -30,7 +30,6 @@ import java.io.IOException;
import java.io.UncheckedIOException; import java.io.UncheckedIOException;
import java.io.File; import java.io.File;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.security.AccessController; import java.security.AccessController;
import java.security.AccessControlContext; import java.security.AccessControlContext;
@ -2895,12 +2894,7 @@ public abstract class ClassLoader {
Unsafe unsafe = Unsafe.getUnsafe(); Unsafe unsafe = Unsafe.getUnsafe();
Class<?> k = ClassLoader.class; Class<?> k = ClassLoader.class;
long offset; long offset;
try { offset = unsafe.objectFieldOffset(k, name);
Field f = k.getDeclaredField(name);
offset = unsafe.objectFieldOffset(f);
} catch (NoSuchFieldException e) {
throw new InternalError(e);
}
return unsafe.compareAndSetObject(this, offset, null, obj); return unsafe.compareAndSetObject(this, offset, null, obj);
} }
} }

View File

@ -130,7 +130,7 @@ public final class Module implements AnnotatedElement {
// define module to VM // define module to VM
boolean isOpen = descriptor.isOpen(); boolean isOpen = descriptor.isOpen() || descriptor.isAutomatic();
Version version = descriptor.version().orElse(null); Version version = descriptor.version().orElse(null);
String vs = Objects.toString(version, null); String vs = Objects.toString(version, null);
String loc = Objects.toString(uri, null); String loc = Objects.toString(uri, null);
@ -1156,18 +1156,14 @@ public final class Module implements AnnotatedElement {
m.implAddReads(ALL_UNNAMED_MODULE, true); m.implAddReads(ALL_UNNAMED_MODULE, true);
} }
// exports and opens // exports and opens, skipped for open and automatic
if (descriptor.isOpen() || descriptor.isAutomatic()) { if (!descriptor.isOpen() && !descriptor.isAutomatic()) {
// The VM doesn't special case open or automatic modules yet if (isBootLayer && descriptor.opens().isEmpty()) {
// so need to export all packages // no open packages, no qualified exports to modules in parent layers
for (String source : descriptor.packages()) { initExports(m, nameToModule);
addExportsToAll0(m, source); } else {
initExportsAndOpens(m, nameToSource, nameToModule, layer.parents());
} }
} else if (isBootLayer && descriptor.opens().isEmpty()) {
// no open packages, no qualified exports to modules in parent layers
initExports(m, nameToModule);
} else {
initExportsAndOpens(m, nameToSource, nameToModule, layer.parents());
} }
} }

View File

@ -276,11 +276,9 @@ public class CallSite {
if (offset > 0) { if (offset > 0) {
return offset; return offset;
} }
try { offset = TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class, "target");
offset = TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target")); assert(offset > 0);
assert(offset > 0); return offset;
return offset;
} catch (Exception ex) { throw newInternalError(ex); }
} }
/*package-private*/ /*package-private*/

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -70,13 +70,18 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError;
* and those seven fields omit much of the information in Method. * and those seven fields omit much of the information in Method.
* @author jrose * @author jrose
*/ */
/*non-public*/ final class ResolvedMethodName {
//@Injected JVM_Method* vmtarget;
//@Injected Class<?> vmholder;
};
/*non-public*/ final class MemberName implements Member, Cloneable { /*non-public*/ final class MemberName implements Member, Cloneable {
private Class<?> clazz; // class in which the method is defined private Class<?> clazz; // class in which the member is defined
private String name; // may be null if not yet materialized private String name; // may be null if not yet materialized
private Object type; // may be null if not yet materialized private Object type; // may be null if not yet materialized
private int flags; // modifier bits; see reflect.Modifier private int flags; // modifier bits; see reflect.Modifier
//@Injected JVM_Method* vmtarget; private ResolvedMethodName method; // cached resolved method information
//@Injected int vmindex; //@Injected intptr_t vmindex; // vtable index or offset of resolved member
Object resolution; // if null, this guy is resolved Object resolution; // if null, this guy is resolved
/** Return the declaring class of this member. /** Return the declaring class of this member.

View File

@ -1587,12 +1587,6 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
} }
} }
private static final long FORM_OFFSET; private static final long FORM_OFFSET
static { = UNSAFE.objectFieldOffset(MethodHandle.class, "form");
try {
FORM_OFFSET = UNSAFE.objectFieldOffset(MethodHandle.class.getDeclaredField("form"));
} catch (ReflectiveOperationException ex) {
throw newInternalError(ex);
}
}
} }

View File

@ -1239,17 +1239,11 @@ s.writeObject(this.parameterArray());
// Support for resetting final fields while deserializing. Implement Holder // Support for resetting final fields while deserializing. Implement Holder
// pattern to make the rarely needed offset calculation lazy. // pattern to make the rarely needed offset calculation lazy.
private static class OffsetHolder { private static class OffsetHolder {
private static final long rtypeOffset, ptypesOffset; static final long rtypeOffset
static { = UNSAFE.objectFieldOffset(MethodType.class, "rtype");
try {
rtypeOffset = UNSAFE.objectFieldOffset static final long ptypesOffset
(MethodType.class.getDeclaredField("rtype")); = UNSAFE.objectFieldOffset(MethodType.class, "ptypes");
ptypesOffset = UNSAFE.objectFieldOffset
(MethodType.class.getDeclaredField("ptypes"));
} catch (Exception ex) {
throw new Error(ex);
}
}
} }
/** /**

View File

@ -2014,12 +2014,7 @@ public abstract class VarHandle {
private static final long VFORM_OFFSET; private static final long VFORM_OFFSET;
static { static {
try { VFORM_OFFSET = UNSAFE.objectFieldOffset(VarHandle.class, "vform");
VFORM_OFFSET = UNSAFE.objectFieldOffset(VarHandle.class.getDeclaredField("vform"));
}
catch (ReflectiveOperationException e) {
throw newInternalError(e);
}
// The VarHandleGuards must be initialized to ensure correct // The VarHandleGuards must be initialized to ensure correct
// compilation of the guard methods // compilation of the guard methods

View File

@ -35,32 +35,20 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
*/ */
abstract class VarHandleByteArrayBase { abstract class VarHandleByteArrayBase {
// Buffer.address // Buffer.address
static final long BUFFER_ADDRESS; static final long BUFFER_ADDRESS
= UNSAFE.objectFieldOffset(Buffer.class, "address");
// Buffer.limit // Buffer.limit
static final long BUFFER_LIMIT; static final long BUFFER_LIMIT
= UNSAFE.objectFieldOffset(Buffer.class, "limit");
// ByteBuffer.hb // ByteBuffer.hb
static final long BYTE_BUFFER_HB; static final long BYTE_BUFFER_HB
= UNSAFE.objectFieldOffset(ByteBuffer.class, "hb");
// ByteBuffer.isReadOnly // ByteBuffer.isReadOnly
static final long BYTE_BUFFER_IS_READ_ONLY; static final long BYTE_BUFFER_IS_READ_ONLY
= UNSAFE.objectFieldOffset(ByteBuffer.class, "isReadOnly");
static {
try {
BUFFER_ADDRESS = UNSAFE.objectFieldOffset(
Buffer.class.getDeclaredField("address"));
BUFFER_LIMIT = UNSAFE.objectFieldOffset(
Buffer.class.getDeclaredField("limit"));
BYTE_BUFFER_HB = UNSAFE.objectFieldOffset(
ByteBuffer.class.getDeclaredField("hb"));
BYTE_BUFFER_IS_READ_ONLY = UNSAFE.objectFieldOffset(
ByteBuffer.class.getDeclaredField("isReadOnly"));
}
catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
static final boolean BE = UNSAFE.isBigEndian(); static final boolean BE = UNSAFE.isBigEndian();

View File

@ -4067,20 +4067,13 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
} }
private static class UnsafeHolder { private static class UnsafeHolder {
private static final jdk.internal.misc.Unsafe unsafe; private static final jdk.internal.misc.Unsafe unsafe
private static final long intCompactOffset; = jdk.internal.misc.Unsafe.getUnsafe();
private static final long intValOffset; private static final long intCompactOffset
static { = unsafe.objectFieldOffset(BigDecimal.class, "intCompact");
try { private static final long intValOffset
unsafe = jdk.internal.misc.Unsafe.getUnsafe(); = unsafe.objectFieldOffset(BigDecimal.class, "intVal");
intCompactOffset = unsafe.objectFieldOffset
(BigDecimal.class.getDeclaredField("intCompact"));
intValOffset = unsafe.objectFieldOffset
(BigDecimal.class.getDeclaredField("intVal"));
} catch (Exception ex) {
throw new ExceptionInInitializerError(ex);
}
}
static void setIntCompact(BigDecimal bd, long val) { static void setIntCompact(BigDecimal bd, long val) {
unsafe.putLong(bd, intCompactOffset, val); unsafe.putLong(bd, intCompactOffset, val);
} }

View File

@ -4582,20 +4582,12 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
// Support for resetting final fields while deserializing // Support for resetting final fields while deserializing
private static class UnsafeHolder { private static class UnsafeHolder {
private static final jdk.internal.misc.Unsafe unsafe; private static final jdk.internal.misc.Unsafe unsafe
private static final long signumOffset; = jdk.internal.misc.Unsafe.getUnsafe();
private static final long magOffset; private static final long signumOffset
static { = unsafe.objectFieldOffset(BigInteger.class, "signum");
try { private static final long magOffset
unsafe = jdk.internal.misc.Unsafe.getUnsafe(); = unsafe.objectFieldOffset(BigInteger.class, "mag");
signumOffset = unsafe.objectFieldOffset
(BigInteger.class.getDeclaredField("signum"));
magOffset = unsafe.objectFieldOffset
(BigInteger.class.getDeclaredField("mag"));
} catch (Exception ex) {
throw new ExceptionInInitializerError(ex);
}
}
static void putSign(BigInteger bi, int sign) { static void putSign(BigInteger bi, int sign) {
unsafe.putInt(bi, signumOffset, sign); unsafe.putInt(bi, signumOffset, sign);

View File

@ -576,19 +576,10 @@ class Inet6Address extends InetAddress {
new ObjectStreamField("ifname", String.class) new ObjectStreamField("ifname", String.class)
}; };
private static final long FIELDS_OFFSET; private static final jdk.internal.misc.Unsafe UNSAFE
private static final jdk.internal.misc.Unsafe UNSAFE; = jdk.internal.misc.Unsafe.getUnsafe();
private static final long FIELDS_OFFSET = UNSAFE.objectFieldOffset(
static { Inet6Address.class, "holder6");
try {
jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
FIELDS_OFFSET = unsafe.objectFieldOffset(
Inet6Address.class.getDeclaredField("holder6"));
UNSAFE = unsafe;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
/** /**
* restore the state of this object from stream * restore the state of this object from stream

View File

@ -1707,20 +1707,10 @@ class InetAddress implements java.io.Serializable {
} }
} }
private static final long FIELDS_OFFSET; private static final jdk.internal.misc.Unsafe UNSAFE
private static final jdk.internal.misc.Unsafe UNSAFE; = jdk.internal.misc.Unsafe.getUnsafe();
private static final long FIELDS_OFFSET
static { = UNSAFE.objectFieldOffset(InetAddress.class, "holder");
try {
jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
FIELDS_OFFSET = unsafe.objectFieldOffset(
InetAddress.class.getDeclaredField("holder")
);
UNSAFE = unsafe;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
private void readObject (ObjectInputStream s) throws private void readObject (ObjectInputStream s) throws
IOException, ClassNotFoundException { IOException, ClassNotFoundException {

View File

@ -302,18 +302,10 @@ public class InetSocketAddress
throw new InvalidObjectException("Stream data required"); throw new InvalidObjectException("Stream data required");
} }
private static final long FIELDS_OFFSET; private static final jdk.internal.misc.Unsafe UNSAFE
private static final jdk.internal.misc.Unsafe UNSAFE; = jdk.internal.misc.Unsafe.getUnsafe();
static { private static final long FIELDS_OFFSET
try { = UNSAFE.objectFieldOffset(InetSocketAddress.class, "holder");
jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
FIELDS_OFFSET = unsafe.objectFieldOffset(
InetSocketAddress.class.getDeclaredField("holder"));
UNSAFE = unsafe;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
/** /**
* Gets the port number. * Gets the port number.

View File

@ -3306,15 +3306,8 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
} }
private static final Unsafe U = Unsafe.getUnsafe(); private static final Unsafe U = Unsafe.getUnsafe();
private static final long LOCKSTATE; private static final long LOCKSTATE
static { = U.objectFieldOffset(TreeBin.class, "lockState");
try {
LOCKSTATE = U.objectFieldOffset
(TreeBin.class.getDeclaredField("lockState"));
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
} }
/* ----------------Table Traversal -------------- */ /* ----------------Table Traversal -------------- */
@ -6380,27 +6373,23 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
private static final int ASHIFT; private static final int ASHIFT;
static { static {
try { SIZECTL = U.objectFieldOffset
SIZECTL = U.objectFieldOffset (ConcurrentHashMap.class, "sizeCtl");
(ConcurrentHashMap.class.getDeclaredField("sizeCtl")); TRANSFERINDEX = U.objectFieldOffset
TRANSFERINDEX = U.objectFieldOffset (ConcurrentHashMap.class, "transferIndex");
(ConcurrentHashMap.class.getDeclaredField("transferIndex")); BASECOUNT = U.objectFieldOffset
BASECOUNT = U.objectFieldOffset (ConcurrentHashMap.class, "baseCount");
(ConcurrentHashMap.class.getDeclaredField("baseCount")); CELLSBUSY = U.objectFieldOffset
CELLSBUSY = U.objectFieldOffset (ConcurrentHashMap.class, "cellsBusy");
(ConcurrentHashMap.class.getDeclaredField("cellsBusy"));
CELLVALUE = U.objectFieldOffset CELLVALUE = U.objectFieldOffset
(CounterCell.class.getDeclaredField("value")); (CounterCell.class, "value");
ABASE = U.arrayBaseOffset(Node[].class); ABASE = U.arrayBaseOffset(Node[].class);
int scale = U.arrayIndexScale(Node[].class); int scale = U.arrayIndexScale(Node[].class);
if ((scale & (scale - 1)) != 0) if ((scale & (scale - 1)) != 0)
throw new Error("array index scale not a power of two"); throw new Error("array index scale not a power of two");
ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
// Reduce the risk of rare disastrous classloading in first call to // Reduce the risk of rare disastrous classloading in first call to
// LockSupport.park: https://bugs.openjdk.java.net/browse/JDK-8074773 // LockSupport.park: https://bugs.openjdk.java.net/browse/JDK-8074773

View File

@ -1050,30 +1050,18 @@ public class ThreadLocalRandom extends Random {
// Unsafe mechanics // Unsafe mechanics
private static final Unsafe U = Unsafe.getUnsafe(); private static final Unsafe U = Unsafe.getUnsafe();
private static final long SEED; private static final long SEED = U.objectFieldOffset
private static final long PROBE; (Thread.class, "threadLocalRandomSeed");
private static final long SECONDARY; private static final long PROBE = U.objectFieldOffset
private static final long THREADLOCALS; (Thread.class, "threadLocalRandomProbe");
private static final long INHERITABLETHREADLOCALS; private static final long SECONDARY = U.objectFieldOffset
private static final long INHERITEDACCESSCONTROLCONTEXT; (Thread.class, "threadLocalRandomSecondarySeed");
static { private static final long THREADLOCALS = U.objectFieldOffset
try { (Thread.class, "threadLocals");
SEED = U.objectFieldOffset private static final long INHERITABLETHREADLOCALS = U.objectFieldOffset
(Thread.class.getDeclaredField("threadLocalRandomSeed")); (Thread.class, "inheritableThreadLocals");
PROBE = U.objectFieldOffset private static final long INHERITEDACCESSCONTROLCONTEXT = U.objectFieldOffset
(Thread.class.getDeclaredField("threadLocalRandomProbe")); (Thread.class, "inheritedAccessControlContext");
SECONDARY = U.objectFieldOffset
(Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
THREADLOCALS = U.objectFieldOffset
(Thread.class.getDeclaredField("threadLocals"));
INHERITABLETHREADLOCALS = U.objectFieldOffset
(Thread.class.getDeclaredField("inheritableThreadLocals"));
INHERITEDACCESSCONTROLCONTEXT = U.objectFieldOffset
(Thread.class.getDeclaredField("inheritedAccessControlContext"));
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
/** Rarely-used holder for the second of a pair of Gaussians */ /** Rarely-used holder for the second of a pair of Gaussians */
private static final ThreadLocal<Double> nextLocalGaussian = private static final ThreadLocal<Double> nextLocalGaussian =

View File

@ -59,16 +59,7 @@ public class AtomicInteger extends Number implements java.io.Serializable {
* are unresolved cyclic startup dependencies. * are unresolved cyclic startup dependencies.
*/ */
private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe(); private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
private static final long VALUE; private static final long VALUE = U.objectFieldOffset(AtomicInteger.class, "value");
static {
try {
VALUE = U.objectFieldOffset
(AtomicInteger.class.getDeclaredField("value"));
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
private volatile int value; private volatile int value;

View File

@ -73,16 +73,7 @@ public class AtomicLong extends Number implements java.io.Serializable {
* are unresolved cyclic startup dependencies. * are unresolved cyclic startup dependencies.
*/ */
private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe(); private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe();
private static final long VALUE; private static final long VALUE = U.objectFieldOffset(AtomicLong.class, "value");
static {
try {
VALUE = U.objectFieldOffset
(AtomicLong.class.getDeclaredField("value"));
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
private volatile long value; private volatile long value;

View File

@ -421,21 +421,11 @@ public class LockSupport {
// Hotspot implementation via intrinsics API // Hotspot implementation via intrinsics API
private static final Unsafe U = Unsafe.getUnsafe(); private static final Unsafe U = Unsafe.getUnsafe();
private static final long PARKBLOCKER; private static final long PARKBLOCKER = U.objectFieldOffset
private static final long SECONDARY; (Thread.class, "parkBlocker");
private static final long TID; private static final long SECONDARY = U.objectFieldOffset
static { (Thread.class, "threadLocalRandomSecondarySeed");
try { private static final long TID = U.objectFieldOffset
PARKBLOCKER = U.objectFieldOffset (Thread.class, "tid");
(Thread.class.getDeclaredField("parkBlocker"));
SECONDARY = U.objectFieldOffset
(Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
TID = U.objectFieldOffset
(Thread.class.getDeclaredField("tid"));
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
} }

View File

@ -135,17 +135,16 @@ public final class InnocuousThread extends Thread {
Class<?> tk = Thread.class; Class<?> tk = Thread.class;
Class<?> gk = ThreadGroup.class; Class<?> gk = ThreadGroup.class;
THREAD_LOCALS = UNSAFE.objectFieldOffset THREAD_LOCALS = UNSAFE.objectFieldOffset(tk, "threadLocals");
(tk.getDeclaredField("threadLocals"));
INHERITABLE_THREAD_LOCALS = UNSAFE.objectFieldOffset INHERITABLE_THREAD_LOCALS = UNSAFE.objectFieldOffset
(tk.getDeclaredField("inheritableThreadLocals")); (tk, "inheritableThreadLocals");
INHERITEDACCESSCONTROLCONTEXT = UNSAFE.objectFieldOffset INHERITEDACCESSCONTROLCONTEXT = UNSAFE.objectFieldOffset
(tk.getDeclaredField("inheritedAccessControlContext")); (tk, "inheritedAccessControlContext");
CONTEXTCLASSLOADER = UNSAFE.objectFieldOffset CONTEXTCLASSLOADER = UNSAFE.objectFieldOffset
(tk.getDeclaredField("contextClassLoader")); (tk, "contextClassLoader");
long tg = UNSAFE.objectFieldOffset(tk.getDeclaredField("group")); long tg = UNSAFE.objectFieldOffset(tk, "group");
long gp = UNSAFE.objectFieldOffset(gk.getDeclaredField("parent")); long gp = UNSAFE.objectFieldOffset(gk, "parent");
ThreadGroup group = (ThreadGroup) ThreadGroup group = (ThreadGroup)
UNSAFE.getObject(Thread.currentThread(), tg); UNSAFE.getObject(Thread.currentThread(), tg);

View File

@ -953,6 +953,25 @@ public final class Unsafe {
return objectFieldOffset0(f); return objectFieldOffset0(f);
} }
/**
* Reports the location of the field with a given name in the storage
* allocation of its class.
*
* @throws NullPointerException if any parameter is {@code null}.
* @throws InternalError if there is no field named {@code name} declared
* in class {@code c}, i.e., if {@code c.getDeclaredField(name)}
* would throw {@code java.lang.NoSuchFieldException}.
*
* @see #objectFieldOffset(Field)
*/
public long objectFieldOffset(Class<?> c, String name) {
if (c == null || name == null) {
throw new NullPointerException();
}
return objectFieldOffset1(c, name);
}
/** /**
* Reports the location of a given static field, in conjunction with {@link * Reports the location of a given static field, in conjunction with {@link
* #staticFieldBase}. * #staticFieldBase}.
@ -3685,6 +3704,7 @@ public final class Unsafe {
private native void copyMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes); private native void copyMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes);
private native void copySwapMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes, long elemSize); private native void copySwapMemory0(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes, long elemSize);
private native long objectFieldOffset0(Field f); private native long objectFieldOffset0(Field f);
private native long objectFieldOffset1(Class<?> c, String name);
private native long staticFieldOffset0(Field f); private native long staticFieldOffset0(Field f);
private native Object staticFieldBase0(Field f); private native Object staticFieldBase0(Field f);
private native boolean shouldBeInitialized0(Class<?> c); private native boolean shouldBeInitialized0(Class<?> c);

View File

@ -614,20 +614,13 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
} }
private static class UnsafeAccessor { private static class UnsafeAccessor {
private static final jdk.internal.misc.Unsafe unsafe; private static final jdk.internal.misc.Unsafe unsafe
private static final long typeOffset; = jdk.internal.misc.Unsafe.getUnsafe();
private static final long memberValuesOffset; private static final long typeOffset = unsafe.objectFieldOffset
static { (AnnotationInvocationHandler.class, "type");
try { private static final long memberValuesOffset = unsafe.objectFieldOffset
unsafe = jdk.internal.misc.Unsafe.getUnsafe(); (AnnotationInvocationHandler.class, "memberValues");
typeOffset = unsafe.objectFieldOffset
(AnnotationInvocationHandler.class.getDeclaredField("type"));
memberValuesOffset = unsafe.objectFieldOffset
(AnnotationInvocationHandler.class.getDeclaredField("memberValues"));
} catch (Exception ex) {
throw new ExceptionInInitializerError(ex);
}
}
static void setType(AnnotationInvocationHandler o, static void setType(AnnotationInvocationHandler o,
Class<? extends Annotation> type) { Class<? extends Annotation> type) {
unsafe.putObject(o, typeOffset, type); unsafe.putObject(o, typeOffset, type);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,7 @@
#ifdef __NEWVALID /* special setup for Sun test regime */ #ifdef __NEWVALID /* special setup for Sun test regime */
#if defined(i386) || defined(i486) || \ #if defined(i386) || defined(i486) || \
defined(intel) || defined(x86) || defined(arm) || \ defined(intel) || defined(x86) || defined(arm) || \
defined(i86pc) || defined(_M_IA64) || defined(ia64) defined(i86pc) || defined(ia64)
#define _LITTLE_ENDIAN #define _LITTLE_ENDIAN
#endif #endif
#endif #endif

View File

@ -206,7 +206,7 @@ static jlong initialHeapSize = 0; /* inital heap size */
* A minimum -Xss stack size suitable for all platforms. * A minimum -Xss stack size suitable for all platforms.
*/ */
#ifndef STACK_SIZE_MINIMUM #ifndef STACK_SIZE_MINIMUM
#define STACK_SIZE_MINIMUM (32 * KB) #define STACK_SIZE_MINIMUM (64 * KB)
#endif #endif
/* /*

View File

@ -28,7 +28,7 @@
#include "jvm.h" #include "jvm.h"
#include "jlong.h" #include "jlong.h"
#include "sun_nio_ch_DevPollArrayWrapper.h" #include "sun_nio_ch_DevPollArrayWrapper.h"
#include <sys/poll.h> #include <poll.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,5 +23,3 @@
* questions. * questions.
*/ */
// AOT uses jdk.internal.misc.Unsafe
exports jdk.internal.misc to jdk.aot;

View File

@ -65,7 +65,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <sys/signal.h> #include <signal.h>
/* O Flags */ /* O Flags */

View File

@ -742,6 +742,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (stack_size > 0) { if (stack_size > 0) {
pthread_attr_setstacksize(&attr, stack_size); pthread_attr_setstacksize(&attr, stack_size);
} }
pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp; void * tmp;

View File

@ -27,7 +27,7 @@
#define NET_UTILS_MD_H #define NET_UTILS_MD_H
#include <netdb.h> #include <netdb.h>
#include <sys/poll.h> #include <poll.h>
#include <sys/socket.h> #include <sys/socket.h>
/************************************************************************ /************************************************************************

View File

@ -31,24 +31,21 @@
#include "jlong.h" #include "jlong.h"
#include "sun_nio_ch_NativeThread.h" #include "sun_nio_ch_NativeThread.h"
#include "nio_util.h" #include "nio_util.h"
#include <signal.h>
#ifdef __linux__ #ifdef __linux__
#include <pthread.h> #include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/linux_close.c */ /* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2) #define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#elif _AIX #elif _AIX
#include <pthread.h> #include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/aix_close.c */ /* Also defined in net/aix_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 1) #define INTERRUPT_SIGNAL (SIGRTMAX - 1)
#elif __solaris__ #elif __solaris__
#include <thread.h> #include <thread.h>
#include <signal.h>
#define INTERRUPT_SIGNAL (SIGRTMAX - 2) #define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _ALLBSD_SOURCE #elif _ALLBSD_SOURCE
#include <pthread.h> #include <pthread.h>
#include <signal.h>
/* Also defined in net/bsd_close.c */ /* Also defined in net/bsd_close.c */
#define INTERRUPT_SIGNAL SIGIO #define INTERRUPT_SIGNAL SIGIO
#else #else

View File

@ -23,7 +23,7 @@
* questions. * questions.
*/ */
#include <sys/poll.h> #include <poll.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <string.h> #include <string.h>

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,3 +26,4 @@
exports sun.security.rsa to jdk.crypto.mscapi; exports sun.security.rsa to jdk.crypto.mscapi;
exports sun.security.internal.spec to jdk.crypto.mscapi; exports sun.security.internal.spec to jdk.crypto.mscapi;
exports sun.security.util to jdk.crypto.mscapi; exports sun.security.util to jdk.crypto.mscapi;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -559,9 +559,7 @@ GetJavaProperties(JNIEnv* env)
} }
sprintf(buf, "%d.%d", majorVersion, minorVersion); sprintf(buf, "%d.%d", majorVersion, minorVersion);
sprops.os_version = _strdup(buf); sprops.os_version = _strdup(buf);
#if _M_IA64 #if _M_AMD64
sprops.os_arch = "ia64";
#elif _M_AMD64
sprops.os_arch = "amd64"; sprops.os_arch = "amd64";
#elif _X86_ #elif _X86_
sprops.os_arch = "x86"; sprops.os_arch = "x86";

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -332,7 +332,15 @@ AWT_ASSERT_APPKIT_THREAD;
#define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask) #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask)
- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { #if defined(MAC_OS_X_VERSION_10_12) && \
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 && \
__LP64__
// 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds.
- (NSEvent *)nextEventMatchingMask:(NSEventMask)mask
#else
- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask
#endif
untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
if (mask == DRAGMASK && [((NSString *)kCFRunLoopDefaultMode) isEqual:mode]) { if (mask == DRAGMASK && [((NSString *)kCFRunLoopDefaultMode) isEqual:mode]) {
postEventDuringEventSynthesis = YES; postEventDuringEventSynthesis = YES;
} }
@ -449,4 +457,3 @@ AWT_ASSERT_APPKIT_THREAD;
} }
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -394,8 +394,6 @@ SplashEventLoop(Splash * splash) {
void * void *
SplashScreenThread(void *param) { SplashScreenThread(void *param) {
objc_registerThreadWithCollector();
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Splash *splash = (Splash *) param; Splash *splash = (Splash *) param;

View File

@ -455,10 +455,15 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, { 0,
((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, (int)(((unsigned)(~0)<<1) + 1), (int)(((unsigned)(~0)<<2) + 1),
((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, (int)(((unsigned)(~0)<<3) + 1), (int)(((unsigned)(~0)<<4) + 1),
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; (int)(((unsigned)(~0)<<5) + 1), (int)(((unsigned)(~0)<<6) + 1),
(int)(((unsigned)(~0)<<7) + 1), (int)(((unsigned)(~0)<<8) + 1),
(int)(((unsigned)(~0)<<9) + 1), (int)(((unsigned)(~0)<<10) + 1),
(int)(((unsigned)(~0)<<11) + 1), (int)(((unsigned)(~0)<<12) + 1),
(int)(((unsigned)(~0)<<13) + 1), (int)(((unsigned)(~0)<<14) + 1),
(int)(((unsigned)(~0)<<15) + 1) };
#endif /* AVOID_TABLES */ #endif /* AVOID_TABLES */

View File

@ -215,10 +215,15 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, { 0,
((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, (int)(((unsigned)(~0)<<1) + 1), (int)(((unsigned)(~0)<<2) + 1),
((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, (int)(((unsigned)(~0)<<3) + 1), (int)(((unsigned)(~0)<<4) + 1),
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; (int)(((unsigned)(~0)<<5) + 1), (int)(((unsigned)(~0)<<6) + 1),
(int)(((unsigned)(~0)<<7) + 1), (int)(((unsigned)(~0)<<8) + 1),
(int)(((unsigned)(~0)<<9) + 1), (int)(((unsigned)(~0)<<10) + 1),
(int)(((unsigned)(~0)<<11) + 1), (int)(((unsigned)(~0)<<12) + 1),
(int)(((unsigned)(~0)<<13) + 1), (int)(((unsigned)(~0)<<14) + 1),
(int)(((unsigned)(~0)<<15) + 1) };
#endif /* AVOID_TABLES */ #endif /* AVOID_TABLES */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -483,15 +483,6 @@ Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
"available", "()I")); "available", "()I"));
} }
/*
* The Windows Itanium Aug 2002 SDK generates bad code
* for this routine. Disable optimization for now.
*/
#ifdef _M_IA64
#pragma optimize ("", off)
#endif
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env, Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env,
jobject this, jobject this,
@ -745,10 +736,6 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env,
RELEASE_ARRAYS(env, &jsrc); RELEASE_ARRAYS(env, &jsrc);
return; return;
} }
#ifdef _M_IA64
#pragma optimize ("", on)
#endif
/* /*
* SOME FINE POINTS: * SOME FINE POINTS:

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -125,15 +125,13 @@ debugLoop_run(void)
jboolean replyToSender = JNI_TRUE; jboolean replyToSender = JNI_TRUE;
/* /*
* For VirtualMachine commands we hold the vmDeathLock * For all commands we hold the vmDeathLock
* while executing and replying to the command. This ensures * while executing and replying to the command. This ensures
* that a VM command after VM_DEATH will be allowed to complete * that a command after VM_DEATH will be allowed to complete
* before the thread posting the VM_DEATH continues VM * before the thread posting the VM_DEATH continues VM
* termination. * termination.
*/ */
if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){ debugMonitorEnter(vmDeathLock);
debugMonitorEnter(vmDeathLock);
}
/* Initialize the input and output streams */ /* Initialize the input and output streams */
inStream_init(&in, p); inStream_init(&in, p);
@ -172,9 +170,7 @@ debugLoop_run(void)
/* /*
* Release the vmDeathLock as the reply has been posted. * Release the vmDeathLock as the reply has been posted.
*/ */
if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){ debugMonitorExit(vmDeathLock);
debugMonitorExit(vmDeathLock);
}
inStream_destroy(&in); inStream_destroy(&in);
outStream_destroy(&out); outStream_destroy(&out);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -240,10 +240,10 @@ dequeueCommand(void)
size = commandSize(command); size = commandSize(command);
/* /*
* Immediately close out any commands enqueued from a * Immediately close out any commands enqueued from
* previously attached debugger. * a dead VM or a previously attached debugger.
*/ */
if (command->sessionID != currentSessionID) { if (gdata->vmDead || command->sessionID != currentSessionID) {
log_debugee_location("dequeueCommand(): command session removal", NULL, NULL, 0); log_debugee_location("dequeueCommand(): command session removal", NULL, NULL, 0);
completeCommand(command); completeCommand(command);
command = NULL; command = NULL;

View File

@ -37,7 +37,7 @@
#include <thread.h> #include <thread.h>
#else #else
#include <pthread.h> #include <pthread.h>
#include <sys/poll.h> #include <poll.h>
#endif #endif
#include "socket_md.h" #include "socket_md.h"

View File

@ -153,6 +153,7 @@ java/io/pathNames/GeneralWin32.java 8180264 windows-
com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all
com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java 8030957 aix-all com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java 8030957 aix-all
sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java 8174734 generic-all sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java 8174734 generic-all
sun/management/jdp/JdpOffTest.java 8175542 generic-all
############################################################################ ############################################################################
@ -302,6 +303,14 @@ sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java 8057732 generic-
com/sun/tools/attach/StartManagementAgent.java 8179700 generic-all com/sun/tools/attach/StartManagementAgent.java 8179700 generic-all
sun/tools/jhsdb/AlternateHashingTest.java 8184042 macosx-all
sun/tools/jhsdb/BasicLauncherTest.java 8184042 macosx-all
sun/tools/jhsdb/HeapDumpTest.java 8184042 macosx-all
sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java 8184042 macosx-all
############################################################################ ############################################################################
# jdk_other # jdk_other

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@
# @test # @test
# @bug 4660158 # @bug 4660158
# @author Staffan Larsen # @author Staffan Larsen
# @requires os.family != "windows"
# @key intermittent # @key intermittent
# @run shell JdbExprTest.sh # @run shell JdbExprTest.sh

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,7 @@ public class TestJcmdDefaults {
private static final String TEST_SRC = System.getProperty("test.src").trim(); private static final String TEST_SRC = System.getProperty("test.src").trim();
private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" }; private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
private static final String JCMD_LIST_REGEX = "^\\d+\\s*.*"; private static final String JCMD_LIST_REGEX = "(?s)^\\d+\\s*.*";
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
testJcmdUsage("-h"); testJcmdUsage("-h");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -75,9 +75,9 @@ public class Settings extends TestHelper {
} }
static void runTestOptionDefault() throws IOException { static void runTestOptionDefault() throws IOException {
String stackSize = "256"; // in kb int stackSize = 256; // in kb
if (getArch().equals("ppc64") || getArch().equals("ppc64le")) { if (getArch().equals("ppc64") || getArch().equals("ppc64le")) {
stackSize = "800"; stackSize = 800;
} }
TestResult tr; TestResult tr;
tr = doExec(javaCmd, "-Xms64m", "-Xmx512m", tr = doExec(javaCmd, "-Xms64m", "-Xmx512m",
@ -88,7 +88,7 @@ public class Settings extends TestHelper {
throw new RuntimeException("test fails"); throw new RuntimeException("test fails");
} }
tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m", tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m",
"-Xss" + stackSize + "000", "-XshowSettings", "-jar", testJar.getAbsolutePath()); "-Xss" + (stackSize * 1024), "-XshowSettings", "-jar", testJar.getAbsolutePath());
containsAllOptions(tr); containsAllOptions(tr);
if (!tr.isOK()) { if (!tr.isOK()) {
System.out.println(tr); System.out.println(tr);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -155,15 +155,21 @@ public class TooSmallStackSize extends TestHelper {
checkStack("16k"); checkStack("16k");
/* /*
* Try with a 32k stack size, which is the size that the launcher will * Try with a 64k stack size, which is the size that the launcher will
* set to if you try setting to anything smaller. This should produce the same * set to if you try setting to anything smaller. This should produce the same
* result as setting to 16k if the fix for 6762191 is in place. * result as setting to 16k if the fix for 6762191 is in place.
*/ */
String min_stack_allowed = checkStack("32k"); String min_stack_allowed = checkStack("64k");
/* /*
* Try again with a the minimum stack size that was given in the error message * Try again with a the minimum stack size that was given in the error message
*/ */
checkMinStackAllowed(min_stack_allowed); checkMinStackAllowed(min_stack_allowed);
/*
* Try again with a size that is not OS page aligned. This is to help test that
* asserts added for 8176768 are not triggered.
*/
checkMinStackAllowed("513k");
} }
} }