Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -26,10 +26,10 @@ using System.Reflection;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jeroen Frijters")]
[assembly: AssemblyProduct("IKVM.NET")]
[assembly: AssemblyCopyright("Copyright (C) 2002-2013 Jeroen Frijters")]
[assembly: AssemblyCopyright("Copyright (C) 2002-2015 Jeroen Frijters")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("7.3.@BUILD@.0")]
[assembly: AssemblyVersion("8.0.@BUILD@.0")]
#if SIGNCODE
#pragma warning disable 1699

View File

@@ -2242,7 +2242,7 @@ namespace ikvm.awt
public override java.awt.GraphicsConfiguration getDefaultConfiguration()
{
return new NetGraphicsConfiguration(Screen.PrimaryScreen);
return new NetGraphicsConfiguration(screen);
}
public override string getIDstring()

View File

@@ -1 +1 @@
474cfafc92a8fad74e36e71fb612ebd44209bce8
a963d4472d2d9b541b71be3d73cec57c17f4cbb3

View File

@@ -269,7 +269,9 @@ public static class Starter
}
else if (arg.StartsWith("-Xms")
|| arg.StartsWith("-Xmx")
|| arg.StartsWith("-Xmn")
|| arg.StartsWith("-Xss")
|| arg.StartsWith("-XX:")
|| arg == "-Xmixed"
|| arg == "-Xint"
|| arg == "-Xincgc"

View File

@@ -829,9 +829,7 @@ namespace IKVM.Internal.MapXml
internal override void Generate(CodeGenContext context, CodeEmitter ilgen)
{
FieldWrapper fw = StaticCompiler.GetClassForMapXml(context.ClassLoader, Class).GetFieldWrapper(Name, Sig);
fw.Link();
ilgen.Emit(OpCodes.Ldflda, fw.GetField());
ilgen.Emit(OpCodes.Ldflda, StaticCompiler.GetFieldForMapXml(context.ClassLoader, Class, Name, Sig).GetField());
}
}
@@ -847,10 +845,8 @@ namespace IKVM.Internal.MapXml
internal override void Generate(CodeGenContext context, CodeEmitter ilgen)
{
FieldWrapper fw = StaticCompiler.GetClassForMapXml(context.ClassLoader, Class).GetFieldWrapper(Name, Sig);
fw.Link();
// we don't use fw.EmitGet because we don't want automatic unboxing and whatever
ilgen.Emit(OpCodes.Ldfld, fw.GetField());
ilgen.Emit(OpCodes.Ldfld, StaticCompiler.GetFieldForMapXml(context.ClassLoader, Class, Name, Sig).GetField());
}
}
@@ -874,10 +870,8 @@ namespace IKVM.Internal.MapXml
}
else
{
FieldWrapper fw = StaticCompiler.GetClassForMapXml(context.ClassLoader, Class).GetFieldWrapper(Name, Sig);
fw.Link();
// we don't use fw.EmitGet because we don't want automatic unboxing and whatever
ilgen.Emit(OpCodes.Ldsfld, fw.GetField());
ilgen.Emit(OpCodes.Ldsfld, StaticCompiler.GetFieldForMapXml(context.ClassLoader, Class, Name, Sig).GetField());
}
}
}
@@ -894,10 +888,8 @@ namespace IKVM.Internal.MapXml
internal override void Generate(CodeGenContext context, CodeEmitter ilgen)
{
FieldWrapper fw = StaticCompiler.GetClassForMapXml(context.ClassLoader, Class).GetFieldWrapper(Name, Sig);
fw.Link();
// we don't use fw.EmitSet because we don't want automatic unboxing and whatever
ilgen.Emit(OpCodes.Stfld, fw.GetField());
ilgen.Emit(OpCodes.Stfld, StaticCompiler.GetFieldForMapXml(context.ClassLoader, Class, Name, Sig).GetField());
}
}
@@ -913,10 +905,8 @@ namespace IKVM.Internal.MapXml
internal override void Generate(CodeGenContext context, CodeEmitter ilgen)
{
FieldWrapper fw = StaticCompiler.GetClassForMapXml(context.ClassLoader, Class).GetFieldWrapper(Name, Sig);
fw.Link();
// we don't use fw.EmitSet because we don't want automatic unboxing and whatever
ilgen.Emit(OpCodes.Stsfld, fw.GetField());
ilgen.Emit(OpCodes.Stsfld, StaticCompiler.GetFieldForMapXml(context.ClassLoader, Class, Name, Sig).GetField());
}
}
@@ -1061,6 +1051,24 @@ namespace IKVM.Internal.MapXml
}
}
[XmlType("div_un")]
public sealed class Div_Un : Simple
{
public Div_Un()
: base(OpCodes.Div_Un)
{
}
}
[XmlType("rem_un")]
public sealed class Rem_Un : Simple
{
public Rem_Un()
: base(OpCodes.Rem_Un)
{
}
}
[XmlType("and")]
public sealed class And : Simple
{
@@ -1459,6 +1467,8 @@ namespace IKVM.Internal.MapXml
[XmlElement(typeof(Add))]
[XmlElement(typeof(Sub))]
[XmlElement(typeof(Mul))]
[XmlElement(typeof(Div_Un))]
[XmlElement(typeof(Rem_Un))]
[XmlElement(typeof(And))]
[XmlElement(typeof(Or))]
[XmlElement(typeof(Xor))]

View File

@@ -28,7 +28,9 @@
#include <malloc.h>
#define ALLOCA _alloca
#else
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <stdlib.h>
#else
#include <alloca.h>
#endif
#define ALLOCA alloca

View File

@@ -53,6 +53,7 @@ jdk/src/share/classes/java/util/concurrent/atomic/AtomicLong.java=../classpath/j
jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java=../classpath/java/util/concurrent/atomic/AtomicLongArray.java
jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java=../classpath/java/util/concurrent/atomic/AtomicReference.java
jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java=../classpath/java/util/concurrent/atomic/AtomicReferenceArray.java
jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java=java/util/concurrent/ForkJoinPool.java
jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java=java/util/concurrent/locks/AbstractQueuedSynchronizer.java
jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java=java/util/concurrent/locks/LockSupport.java
jdk/src/share/classes/sun/awt/EmbeddedFrame.java=sun/awt/EmbeddedFrame.java

View File

@@ -1 +1 @@
4911d54d998b7a044246f97683fb62901e9dc052
2bf838b489c7b542eedfe3e782dea1b8492ca32d

View File

@@ -108,7 +108,6 @@ public class JPEGImageWriter extends ImageWriter {
}
BufferedImage img = (BufferedImage)image.getRenderedImage();
cli.System.Drawing.Bitmap bitmap = img.getBitmap();
ImageOutputStream imgOutput = (ImageOutputStream)getOutput();
@@ -151,7 +150,10 @@ public class JPEGImageWriter extends ImageWriter {
try {
params.get_Param()[0] = new EncoderParameter(Encoder.LuminanceTable, qTableToShortArray(qTables[0]));
params.get_Param()[1] = new EncoderParameter(Encoder.ChrominanceTable, qTableToShortArray(qTables[1]));
bitmap.Save(stream, codec, params);
cli.System.Drawing.Bitmap bitmap = img.getBitmap();
synchronized( bitmap ) {
bitmap.Save(stream, codec, params);
}
}
finally {
params.Dispose();

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
7c24f365ec21e126847990e92c470fe0626a9124
d99c6757c1279a68769ff93c4d866d320e041cdc

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -449,12 +449,12 @@ public class BufferedImage extends java.awt.Image
* the raster has been premultiplied with alpha.
* @param properties <code>Hashtable</code> of
* <code>String</code>/<code>Object</code> pairs.
* @exception <code>RasterFormatException</code> if the number and
* @exception RasterFormatException if the number and
* types of bands in the <code>SampleModel</code> of the
* <code>Raster</code> do not match the number and types required by
* the <code>ColorModel</code> to represent its color and alpha
* components.
* @exception <code>IllegalArgumentException</code> if
* @exception IllegalArgumentException if
* <code>raster</code> is incompatible with <code>cm</code>
* @see ColorModel
* @see Raster
@@ -709,25 +709,30 @@ public class BufferedImage extends java.awt.Image
int width = getWidth();
int height = getHeight();
// First map the pixel from Java type to .NET type
switch (getType()){
case TYPE_INT_ARGB:
copyToBitmap(width, height, ((DataBufferInt)raster.getDataBuffer()).getData());
break;
default:{
bitmap = createBitmap(width, height);
for( int y = 0; y<height; y++){
for(int x = 0; x<width; x++){
int rgb = colorModel.getRGB(raster.getDataElements(x, y, null));
bitmap.SetPixel(x, y, cli.System.Drawing.Color.FromArgb(rgb));
bitmap = createBitmap(width, height);
synchronized( bitmap ) {
// First map the pixel from Java type to .NET type
switch (getType()){
case TYPE_INT_ARGB:
copyToBitmap(width, height, ((DataBufferInt)raster.getDataBuffer()).getData());
break;
default:{
for( int y = 0; y<height; y++){
for(int x = 0; x<width; x++){
int rgb = colorModel.getRGB(raster.getDataElements(x, y, null));
bitmap.SetPixel(x, y, cli.System.Drawing.Color.FromArgb(rgb));
}
}
}
}
}
}
this.currentBuffer = BUFFER_BOTH;
}
this.currentBuffer = BUFFER_BOTH;
return;
}
/**
* Caller must synchronized the bitmap object
*/
@cli.System.Security.SecuritySafeCriticalAttribute.Annotation
private void copyToBitmap(int width, int height, int[] pixelData)
{
@@ -736,14 +741,11 @@ public class BufferedImage extends java.awt.Image
{
throw new IllegalArgumentException();
}
bitmap = createBitmap(width, height);
synchronized( bitmap ) {
cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height);
cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.WriteOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb));
cli.System.IntPtr pixelPtr = data.get_Scan0();
cli.System.Runtime.InteropServices.Marshal.Copy(pixelData, 0, pixelPtr, (int)size);
bitmap.UnlockBits(data);
}
cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height);
cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.WriteOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb));
cli.System.IntPtr pixelPtr = data.get_Scan0();
cli.System.Runtime.InteropServices.Marshal.Copy(pixelData, 0, pixelPtr, (int)size);
bitmap.UnlockBits(data);
}
/**
@@ -1040,7 +1042,6 @@ public class BufferedImage extends java.awt.Image
* each color component in the returned data when
* using this method. With a specified coordinate (x,&nbsp;y) in the
* image, the ARGB pixel can be accessed in this way:
* </p>
*
* <pre>
* pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)]; </pre>
@@ -1284,7 +1285,7 @@ public class BufferedImage extends java.awt.Image
* @return an {@link Object} that is the property referred to by the
* specified <code>name</code> or <code>null</code> if the
* properties of this image are not yet known.
* @throws <code>NullPointerException</code> if the property name is null.
* @throws NullPointerException if the property name is null.
* @see ImageObserver
* @see java.awt.Image#UndefinedProperty
*/
@@ -1297,7 +1298,7 @@ public class BufferedImage extends java.awt.Image
* @param name the property name
* @return an <code>Object</code> that is the property referred to by
* the specified <code>name</code>.
* @throws <code>NullPointerException</code> if the property name is null.
* @throws NullPointerException if the property name is null.
*/
public Object getProperty(String name) {
if (name == null) {
@@ -1349,7 +1350,7 @@ public class BufferedImage extends java.awt.Image
* @param h the height of the specified rectangular region
* @return a <code>BufferedImage</code> that is the subimage of this
* <code>BufferedImage</code>.
* @exception <code>RasterFormatException</code> if the specified
* @exception RasterFormatException if the specified
* area is not contained within this <code>BufferedImage</code>.
*/
public BufferedImage getSubimage (int x, int y, int w, int h) {
@@ -1439,8 +1440,7 @@ public class BufferedImage extends java.awt.Image
* <code>BufferedImage</code>.
*/
public int getMinX() {
bitmap2Raster();
return raster.getMinX();
return 0;
}
/**
@@ -1450,8 +1450,7 @@ public class BufferedImage extends java.awt.Image
* <code>BufferedImage</code>.
*/
public int getMinY() {
bitmap2Raster();
return raster.getMinY();
return 0;
}
/**
@@ -1495,7 +1494,7 @@ public class BufferedImage extends java.awt.Image
/**
* Returns the minimum tile index in the y direction.
* This is always zero.
* @return the mininum tile index in the y direction.
* @return the minimum tile index in the y direction.
*/
public int getMinTileY() {
return 0;
@@ -1549,7 +1548,7 @@ public class BufferedImage extends java.awt.Image
* @param tileY the y index of the requested tile in the tile array
* @return a <code>Raster</code> that is the tile defined by the
* arguments <code>tileX</code> and <code>tileY</code>.
* @exception <code>ArrayIndexOutOfBoundsException</code> if both
* @exception ArrayIndexOutOfBoundsException if both
* <code>tileX</code> and <code>tileY</code> are not
* equal to 0
*/
@@ -1726,7 +1725,7 @@ public class BufferedImage extends java.awt.Image
* @return <code>true</code> if the tile specified by the specified
* indices is checked out for writing; <code>false</code>
* otherwise.
* @exception <code>ArrayIndexOutOfBoundsException</code> if both
* @exception ArrayIndexOutOfBoundsException if both
* <code>tileX</code> and <code>tileY</code> are not equal
* to 0
*/

View File

@@ -1 +1 @@
7ab53c76bb97c702c39866643a2547962ef3ead6
0ed6057830f61276302f31aec193002ca38ab39a

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,7 @@ static final int java_net_SocketOptions_IP_MULTICAST_IF2 = SocketOptions.IP_MULT
#include "java_net_SocketOptions.h"
#include "java_net_NetworkInterface.h"
#include "NetworkInterface.h"
#include "jvm.h"
#include "jni_util.h"
#include "net_util.h"
@@ -183,7 +184,7 @@ static cli.System.Net.Sockets.Socket getFD1(JNIEnv env, TwoStacksPlainDatagramSo
/*
* This function returns JNI_TRUE if the datagram size exceeds the underlying
* provider's ability to send to the target address. The following OS
* oddies have been observed :-
* oddities have been observed :-
*
* 1. On Windows 95/98 if we try to send a datagram > 12k to an application
* on the same machine then the send will fail silently.
@@ -257,7 +258,7 @@ jboolean exceedSizeLimit(JNIEnv *env, jint fd, jint addr, jint size)
/*
* Step 3: On Windows 95/98 then enumerate the IP addresses on
* this machine. This is necesary because we need to check if the
* this machine. This is neccesary because we need to check if the
* datagram is being sent to an application on the same machine.
*-/
if (is95or98) {
@@ -592,8 +593,8 @@ static void connect0(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this, InetAdd
if (xp_or_later) {
/* SIO_UDP_CONNRESET fixes a bug introduced in Windows 2000, which
* returns connection reset errors un connected UDP sockets (as well
* as connected sockets. The solution is to only enable this feature
* returns connection reset errors on connected UDP sockets (as well
* as connected sockets). The solution is to only enable this feature
* when the socket is connected
*/
WSAIoctl(fdc, SIO_UDP_CONNRESET, true);
@@ -703,6 +704,12 @@ static void send(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this, DatagramPac
fd = fdObj.getSocket();
packetBufferLen = packet.length;
/* Note: the buffer needn't be greater than 65,536 (0xFFFF)...
* the maximum size of an IP packet. Anything bigger is truncated anyway.
*/
if (packetBufferLen > MAX_PACKET_LEN) {
packetBufferLen = MAX_PACKET_LEN;
}
if (connected) {
rmtaddr = null;
@@ -741,7 +748,7 @@ static void send(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this, DatagramPac
}
/* When JNI-ifying the JDK's IO routines, we turned
* read's and write's of byte arrays of size greater
* reads and writes of byte arrays of size greater
* than 2048 bytes into several operations of size 2048.
* This saves a malloc()/memcpy()/free() for big
* buffers. This is OK for file IO and TCP, but that
@@ -909,8 +916,8 @@ static int peek(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this, InetAddress
JNU_ThrowByName(env, JNU_JAVAIOPKG+"InterruptedIOException", null);
return 0;
}
addressObj.address = ntohl(remote_addr.sin_addr.s_addr);
addressObj.family = IPv4;
addressObj.holder().address = ntohl(remote_addr.sin_addr.s_addr);
addressObj.holder().family = IPv4;
/* return port */
return ntohs(remote_addr.sin_port);
@@ -1587,6 +1594,22 @@ private static InetAddress[] getNetworkInterfaceAddresses(final NetworkInterface
});
}
static int isAdapterIpv6Enabled(JNIEnv env, int index) {
return java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Integer>() {
public Integer run() {
try {
for (java.util.Enumeration<InetAddress> e = NetworkInterface.getByIndex(index).getInetAddresses(); e.hasMoreElements(); ) {
if (e.nextElement() instanceof Inet6Address) {
return 1;
}
}
} catch (SocketException x) {
}
return 0;
}
}).intValue();
}
private static NetworkInterface Java_java_net_NetworkInterface_getByIndex(JNIEnv env, int ni_class, int index)
{
try {
@@ -1682,17 +1705,19 @@ private static void setMulticastInterface(JNIEnv env, TwoStacksPlainDatagramSock
index = ((NetworkInterface)value).getIndex();
if (setsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
if ( isAdapterIpv6Enabled(env, index) != 0 ) {
if (setsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
index) < 0) {
if (WSAGetLastError() == WSAEINVAL && index > 0) {
JNU_ThrowByName(env, JNU_JAVANETPKG+"SocketException",
"IPV6_MULTICAST_IF failed (interface has IPv4 "
+"address only?)");
} else {
NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG+"SocketException",
if (WSAGetLastError() == WSAEINVAL && index > 0) {
JNU_ThrowByName(env, JNU_JAVANETPKG+"SocketException",
"IPV6_MULTICAST_IF failed (interface has IPv4 "
+"address only?)");
} else {
NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG+"SocketException",
"Error setting socket option");
}
return;
}
return;
}
/* If there are any IPv4 addresses on this interface then
@@ -1821,6 +1846,98 @@ static void socketNativeSetOption(JNIEnv env, TwoStacksPlainDatagramSocketImpl _
}
}
/*
*
* called by getMulticastInterface to retrieve a NetworkInterface
* configured for IPv4.
* The ipv4Mode parameter, is a closet boolean, which allows for a NULL return,
* or forces the creation of a NetworkInterface object with null data.
* It relates to its calling context in getMulticastInterface.
* ipv4Mode == 1, the context is IPV4 processing only.
* ipv4Mode == 0, the context is IPV6 processing
*
*-/
static jobject getIPv4NetworkInterface (JNIEnv *env, jobject this, int fd, jint opt, int ipv4Mode) {
static jclass inet4_class;
static jmethodID inet4_ctrID;
static jclass ni_class; static jmethodID ni_ctrID;
static jfieldID ni_indexID;
static jfieldID ni_addrsID;
jobjectArray addrArray;
jobject addr;
jobject ni;
struct in_addr in;
struct in_addr *inP = &in;
int len = sizeof(struct in_addr);
if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
(char *)inP, &len) < 0) {
NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
"Error getting socket option");
return NULL;
}
/*
* Construct and populate an Inet4Address
*-/
if (inet4_class == NULL) {
jclass c = (*env)->FindClass(env, "java/net/Inet4Address");
CHECK_NULL_RETURN(c, NULL);
inet4_ctrID = (*env)->GetMethodID(env, c, "<init>", "()V");
CHECK_NULL_RETURN(inet4_ctrID, NULL);
inet4_class = (*env)->NewGlobalRef(env, c);
CHECK_NULL_RETURN(inet4_class, NULL);
}
addr = (*env)->NewObject(env, inet4_class, inet4_ctrID, 0);
CHECK_NULL_RETURN(addr, NULL);
setInetAddress_addr(env, addr, ntohl(in.s_addr));
/*
* For IP_MULTICAST_IF return InetAddress
*-/
if (opt == java_net_SocketOptions_IP_MULTICAST_IF) {
return addr;
}
/*
* For IP_MULTICAST_IF2 we get the NetworkInterface for
* this address and return it
*-/
if (ni_class == NULL) {
jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
CHECK_NULL_RETURN(c, NULL);
ni_ctrID = (*env)->GetMethodID(env, c, "<init>", "()V");
CHECK_NULL_RETURN(ni_ctrID, NULL);
ni_indexID = (*env)->GetFieldID(env, c, "index", "I");
CHECK_NULL_RETURN(ni_indexID, NULL);
ni_addrsID = (*env)->GetFieldID(env, c, "addrs",
"[Ljava/net/InetAddress;");
CHECK_NULL_RETURN(ni_addrsID, NULL);
ni_class = (*env)->NewGlobalRef(env, c);
CHECK_NULL_RETURN(ni_class, NULL);
}
ni = Java_java_net_NetworkInterface_getByInetAddress0(env, ni_class, addr);
if (ni) {
return ni;
}
if (ipv4Mode) {
ni = (*env)->NewObject(env, ni_class, ni_ctrID, 0);
CHECK_NULL_RETURN(ni, NULL);
(*env)->SetIntField(env, ni, ni_indexID, -1);
addrArray = (*env)->NewObjectArray(env, 1, inet4_class, NULL);
CHECK_NULL_RETURN(addrArray, NULL);
(*env)->SetObjectArrayElement(env, addrArray, 0, addr);
(*env)->SetObjectField(env, ni, ni_addrsID, addrArray);
} else {
ni = NULL;
}
return ni;
}
/*
* Return the multicast interface:
*
@@ -1868,7 +1985,7 @@ private static Object getMulticastInterface(JNIEnv env, TwoStacksPlainDatagramSo
* Construct and populate an Inet4Address
*/
addr = new Inet4Address();
addr.address = ntohl(in.s_addr);
addr.holder().address = ntohl(in.s_addr);
/*
* For IP_MULTICAST_IF return InetAddress
@@ -1998,26 +2115,6 @@ static Object socketGetOption(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this
return getMulticastInterface(env, _this, fd, fd1, opt);
}
if (opt == java_net_SocketOptions_SO_BINDADDR) {
/* find out local IP address */
SOCKETADDRESS him;
him = new SOCKETADDRESS();
InetAddress iaObj;
if (fd == null) {
fd = fd1; /* must be IPv6 only */
}
if (getsockname(fd, him) == -1) {
NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG+"SocketException",
"Error getting socket name");
return NULL;
}
iaObj = NET_SockaddrToInetAddress(him, new int[1]);
return iaObj;
}
/*
* Map the Java level socket option to the platform specific
* level and option name.
@@ -2063,6 +2160,56 @@ static Object socketGetOption(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this
}
}
/*
* Returns local address of the socket.
*
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: socketLocalAddress
* Signature: (I)Ljava/lang/Object;
*/
static Object socketLocalAddress(JNIEnv env, TwoStacksPlainDatagramSocketImpl _this,
int family) {
cli.System.Net.Sockets.Socket fd = null;
cli.System.Net.Sockets.Socket fd1 = null;
SOCKETADDRESS him;
him = new SOCKETADDRESS();
Object iaObj;
boolean ipv6_supported = ipv6_available();
fd = getFD(env, _this);
if (ipv6_supported) {
fd1 = getFD1(env, _this);
}
if (fd == null && fd1 == null) {
JNU_ThrowByName(env, JNU_JAVANETPKG+"SocketException",
"Socket closed");
return NULL;
}
/* find out local IP address */
/* family==-1 when socket is not connected */
if ((family == IPv6) || (family == -1 && fd == null)) {
fd = fd1; /* must be IPv6 only */
}
if (fd == null) {
JNU_ThrowByName(env, JNU_JAVANETPKG+"SocketException",
"Socket closed");
return NULL;
}
if (getsockname(fd, him) == -1) {
NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG+"SocketException",
"Error getting socket name");
return NULL;
}
iaObj = NET_SockaddrToInetAddress(him, new int[1]);
return iaObj;
}
/*
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: setTimeToLive

View File

@@ -0,0 +1 @@
4b1579622418fcea5533553de4bd441a4303f8e7

View File

@@ -34,8 +34,6 @@
*/
package java.util.concurrent.locks;
import java.util.concurrent.*;
/**
* Basic thread blocking primitives for creating locks and other
@@ -68,16 +66,19 @@ import java.util.concurrent.*;
* {@code blocker} object parameter. This object is recorded while
* the thread is blocked to permit monitoring and diagnostic tools to
* identify the reasons that threads are blocked. (Such tools may
* access blockers using method {@link #getBlocker}.) The use of these
* forms rather than the original forms without this parameter is
* strongly encouraged. The normal argument to supply as a
* {@code blocker} within a lock implementation is {@code this}.
* access blockers using method {@link #getBlocker(Thread)}.)
* The use of these forms rather than the original forms without this
* parameter is strongly encouraged. The normal argument to supply as
* a {@code blocker} within a lock implementation is {@code this}.
*
* <p>These methods are designed to be used as tools for creating
* higher-level synchronization utilities, and are not in themselves
* useful for most concurrency control applications. The {@code park}
* method is designed for use only in constructions of the form:
* <pre>while (!canProceed()) { ... LockSupport.park(this); }</pre>
*
* <pre> {@code
* while (!canProceed()) { ... LockSupport.park(this); }}</pre>
*
* where neither {@code canProceed} nor any other actions prior to the
* call to {@code park} entail locking or blocking. Because only one
* permit is associated with each thread, any intermediary uses of
@@ -85,7 +86,7 @@ import java.util.concurrent.*;
*
* <p><b>Sample Usage.</b> Here is a sketch of a first-in-first-out
* non-reentrant lock class:
* <pre>{@code
* <pre> {@code
* class FIFOMutex {
* private final AtomicBoolean locked = new AtomicBoolean(false);
* private final Queue<Thread> waiters
@@ -99,14 +100,14 @@ import java.util.concurrent.*;
* // Block while not first in queue or cannot acquire lock
* while (waiters.peek() != current ||
* !locked.compareAndSet(false, true)) {
* LockSupport.park(this);
* if (Thread.interrupted()) // ignore interrupts while waiting
* wasInterrupted = true;
* LockSupport.park(this);
* if (Thread.interrupted()) // ignore interrupts while waiting
* wasInterrupted = true;
* }
*
* waiters.remove();
* if (wasInterrupted) // reassert interrupt status on exit
* current.interrupt();
* current.interrupt();
* }
*
* public void unlock() {
@@ -115,16 +116,18 @@ import java.util.concurrent.*;
* }
* }}</pre>
*/
public class LockSupport {
private LockSupport() {} // Cannot be instantiated.
private static void setBlocker(Thread t, Object arg) {
t.parkBlocker = arg;
}
private static final int PARK_STATE_RUNNING = 0;
private static final int PARK_STATE_PERMIT = 1;
private static final int PARK_STATE_PARKED = 2;
// these native methods are all implemented in map.xml
private static native void setBlocker(Thread t, Object obj);
private static native int cmpxchgParkState(Thread t, int newValue, int comparand);
private static native Object getParkLock(Thread t);
private static native void setParkLock(Thread t, Object obj);
@@ -313,7 +316,7 @@ public class LockSupport {
public static void parkUntil(Object blocker, long deadline) {
Thread t = Thread.currentThread();
setBlocker(t, blocker);
parkImpl(t, true, deadline);
parkImpl(t, true, deadline * 1000000);
setBlocker(t, null);
}
@@ -329,7 +332,11 @@ public class LockSupport {
* @throws NullPointerException if argument is null
* @since 1.6
*/
public static native Object getBlocker(Thread t); // implemented in map.xml
public static Object getBlocker(Thread t) {
if (t == null)
throw new NullPointerException();
return t.parkBlocker;
}
/**
* Disables the current thread for thread scheduling purposes unless the
@@ -425,6 +432,25 @@ public class LockSupport {
* to wait until
*/
public static void parkUntil(long deadline) {
parkImpl(Thread.currentThread(), true, deadline);
parkImpl(Thread.currentThread(), true, deadline * 1000000);
}
/**
* Returns the pseudo-randomly initialized or updated secondary seed.
* Copied from ThreadLocalRandom due to package access restrictions.
*/
static final int nextSecondarySeed() {
int r;
Thread t = Thread.currentThread();
if ((r = t.threadLocalRandomSecondarySeed) != 0) {
r ^= r << 13; // xorshift
r ^= r >>> 17;
r ^= r << 5;
}
else if ((r = java.util.concurrent.ThreadLocalRandom.current().nextInt()) == 0)
r = 1; // avoid zero
t.threadLocalRandomSecondarySeed = r;
return r;
}
}

View File

@@ -1 +1 @@
df6a641f2325337bd9354a4d23537dc48a60d0ee
61cf80c434091dcb9ff173cae27898942f3a8861

View File

@@ -188,10 +188,13 @@
</exec>
</target>
<target name="rmi">
<target name="classpath">
<property name="CLASSPATH" value="mscorlib.jar${pathsep}System.Xml.jar${pathsep}${OpenJDK.dir}/jdk/src/share/classes/${pathsep}${OpenJDK.dir}/corba/src/share/classes" />
</target>
<target name="rmi" depends="classpath">
<mkdir dir="rmistubs" />
<property name="VMARGS" value="-J-client -J-Xmx896m -J-Xms128m" />
<property name="CLASSPATH" value="mscorlib.jar${pathsep}System.Xml.jar${pathsep}${OpenJDK.dir}/jdk/src/share/classes/${pathsep}${OpenJDK.dir}/corba/src/share/classes" />
<property name="OUTPUT" value="rmistubs" />
<property name="ARGS" value="${VMARGS} -nowarn -bootclasspath ${CLASSPATH} -d ${OUTPUT}" />
<exec program="rmic" commandline="${ARGS} -v1.1 sun.rmi.registry.RegistryImpl" />
@@ -211,15 +214,15 @@
<exec program="rmic" commandline="${ARGS} -iiop -standardPackage javax.management.remote.rmi.RMIServer" />
</target>
<target name="run-nasgen">
<target name="run-nasgen" depends="classpath">
<!-- nasgen doesn't understand the MethodParameters attribute, so we have to recompile the classes it processes without parameters -->
<exec program="javac" useruntimeengine="false">
<arg value="-XDignore.symbol.file" />
<arg value="-g" />
<arg value="-nowarn" />
<arg value="-implicit:none" />
<arg value="-cp" />
<arg path="mscorlib.jar;../runtime/IKVM.Runtime.jar" />
<arg value="-bootclasspath" />
<arg path="${CLASSPATH};${OpenJDK.dir}/nashorn/src;../runtime/IKVM.Runtime.jar" />
<arg value="${OpenJDK.dir}/nashorn/src/jdk/nashorn/internal/objects/*.java" />
</exec>
<exec program="java" useruntimeengine="false">

View File

@@ -1 +1 @@
0371c2e17040377153909ef9f19d553f527c5078
409d55c92d6f811ce77f595beba1d76dc74392f2

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More