This commit is contained in:
Erik Helin 2014-02-10 13:31:22 +01:00
commit 96a77ee8e6
966 changed files with 43108 additions and 10912 deletions

View File

@ -243,3 +243,4 @@ f5b521ade7a35cea18df78ee86322207729f5611 jdk8-b118
87b743b2263cc53955266411b7797b365a0fb050 jdk8-b119
a1ee9743f4ee165eae59389a020f2552f895dac8 jdk8-b120
13b877757b0b1c0d5813298df85364f41d7ba6fe jdk9-b00
f130ca87de6637acae7d99fcd7a8573eea1cbaed jdk9-b01

View File

@ -243,3 +243,4 @@ a4afb0a8d55ef75aef5b0d77b434070468fb89f8 jdk8-b117
9e90215673be68a3e77a9e444e4232076373734d jdk8-b119
cd3825b2983045784d6fc6d1729c799b08215752 jdk8-b120
1e1f86d5d4e22c15a9bf9f1581acddb8c59abae2 jdk9-b00
50669e45cec4491de0d921d3118a3fe2e767020a jdk9-b01

View File

@ -324,8 +324,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
fi
# When is adding -client something that speeds up the JVM?
# ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs,[$JAVA])
ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs,[$JAVA])
ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
# Disable special log output when a debug build is used as Boot JDK...
ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])

View File

@ -3865,7 +3865,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1389186094
DATE_WHEN_GENERATED=1389815815
###############################################################################
#
@ -11156,6 +11156,12 @@ fi
as_fn_error $? "Update version must have a value" "$LINENO" 5
elif test "x$with_update_version" != x; then
JDK_UPDATE_VERSION="$with_update_version"
# On macosx 10.7, it's not possible to set --with-update-version=0X due
# to a bug in expr (which reduces it to just X). To work around this, we
# always add a 0 to one digit update versions.
if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi
fi
@ -16068,36 +16074,6 @@ fi
# When is adding -client something that speeds up the JVM?
# ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
$ECHO "Check if jvm arg is ok: -XX:PermSize=32m" >&5
$ECHO "Command: $JAVA -XX:PermSize=32m -version" >&5
OUTPUT=`$JAVA -XX:PermSize=32m -version 2>&1`
FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:PermSize=32m"
JVM_ARG_OK=true
else
$ECHO "Arg failed:" >&5
$ECHO "$OUTPUT" >&5
JVM_ARG_OK=false
fi
$ECHO "Check if jvm arg is ok: -XX:MaxPermSize=160m" >&5
$ECHO "Command: $JAVA -XX:MaxPermSize=160m -version" >&5
OUTPUT=`$JAVA -XX:MaxPermSize=160m -version 2>&1`
FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:MaxPermSize=160m"
JVM_ARG_OK=true
else
$ECHO "Arg failed:" >&5
$ECHO "$OUTPUT" >&5
JVM_ARG_OK=false
fi
$ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5
$ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5
OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1`
@ -20011,9 +19987,9 @@ $as_echo "$PROPER_COMPILER_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CC" >&5
$as_echo "no, keeping CC" >&6; }
CC="$TEST_COMPILER"
fi
COMPILER=$CC
COMPILER_NAME=$COMPILER_NAME
@ -21590,9 +21566,9 @@ $as_echo "$PROPER_COMPILER_CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CXX" >&5
$as_echo "no, keeping CXX" >&6; }
CXX="$TEST_COMPILER"
fi
COMPILER=$CXX
COMPILER_NAME=$COMPILER_NAME

View File

@ -105,7 +105,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
fi
# Replace the commas with AND for use in the build directory name.
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
if test "x$COUNT_VARIANTS" != "x,1"; then
BUILDING_MULTIPLE_JVM_VARIANTS=yes
@ -423,6 +423,12 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
AC_MSG_ERROR([Update version must have a value])
elif test "x$with_update_version" != x; then
JDK_UPDATE_VERSION="$with_update_version"
# On macosx 10.7, it's not possible to set --with-update-version=0X due
# to a bug in expr (which reduces it to just X). To work around this, we
# always add a 0 to one digit update versions.
if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi
fi
AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],

View File

@ -166,8 +166,8 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
$1="$PROPER_COMPILER_$1"
else
AC_MSG_RESULT([no, keeping $1])
$1="$TEST_COMPILER"
fi
TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
])

View File

@ -243,3 +243,4 @@ d6820a414f182a011a53a29a52370c696cd58dab jdk8-b118
379fc7609beb7a3d85ebc0cc21a8a51c60d3c7d3 jdk8-b119
53fd772d28c8a9f0f43adfc06f75f6b3cfa93cb5 jdk8-b120
a7d3638deb2f4e33217b1ecf889479e90f9e5b50 jdk9-b00
79a8136b18c1c6848f500088f5a4b39f262f082d jdk9-b01

View File

@ -82,11 +82,18 @@ public class AnyImpl extends Any
super((ORB)orb);
}
public org.omg.CORBA.portable.InputStream create_input_stream()
{
return new AnyInputStream(
(com.sun.corba.se.impl.encoding.EncapsInputStream)
super.create_input_stream());
public org.omg.CORBA.portable.InputStream create_input_stream() {
final org.omg.CORBA.portable.InputStream is = super
.create_input_stream();
AnyInputStream aIS = AccessController
.doPrivileged(new PrivilegedAction<AnyInputStream>() {
@Override
public AnyInputStream run() {
return new AnyInputStream(
(com.sun.corba.se.impl.encoding.EncapsInputStream) is);
}
});
return aIS;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -36,11 +36,10 @@ import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
import com.sun.corba.se.spi.orb.ORB;
import com.sun.corba.se.spi.logging.CORBALogDomains;
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
import sun.corba.EncapsInputStreamFactory;
/**
* Encapsulations are supposed to explicitly define their
* code sets and GIOP version. The original resolution to issue 2784
@ -148,7 +147,7 @@ public class EncapsInputStream extends CDRInputStream
}
public CDRInputStream dup() {
return new EncapsInputStream(this);
return EncapsInputStreamFactory.newEncapsInputStream(this);
}
protected CodeSetConversion.BTCConverter createCharBTCConverter() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -39,6 +39,8 @@ import com.sun.corba.se.impl.encoding.BufferManagerFactory;
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
import com.sun.corba.se.impl.orbutil.ORBConstants;
import sun.corba.EncapsInputStreamFactory;
/**
* Encapsulations are supposed to explicitly define their
* code sets and GIOP version. The original resolution to issue 2784
@ -107,11 +109,11 @@ public class EncapsOutputStream extends CDROutputStream
public org.omg.CORBA.portable.InputStream create_input_stream() {
freeInternalCaches();
return new EncapsInputStream(orb(),
getByteBuffer(),
getSize(),
isLittleEndian(),
getGIOPVersion());
return EncapsInputStreamFactory.newEncapsInputStream(orb(),
getByteBuffer(),
getSize(),
isLittleEndian(),
getGIOPVersion());
}
protected CodeSetConversion.CTBConverter createCharCTBConverter() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -64,6 +64,8 @@ import com.sun.corba.se.impl.encoding.CDRInputStream;
import com.sun.corba.se.impl.encoding.CDROutputStream;
import com.sun.corba.se.impl.encoding.MarshalInputStream;
import sun.corba.EncapsInputStreamFactory;
public class TypeCodeInputStream extends EncapsInputStream implements TypeCodeReader
{
private Map typeMap = null;
@ -157,11 +159,13 @@ public class TypeCodeInputStream extends EncapsInputStream implements TypeCodeRe
// create an encapsulation using the marshal buffer
if (is instanceof CDRInputStream) {
encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length,
((CDRInputStream)is).isLittleEndian(),
((CDRInputStream)is).getGIOPVersion());
encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
encapBuffer, encapBuffer.length,
((CDRInputStream) is).isLittleEndian(),
((CDRInputStream) is).getGIOPVersion());
} else {
encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length);
encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
encapBuffer, encapBuffer.length);
}
encap.setEnclosingInputStream(is);
encap.makeEncapsulation();

View File

@ -61,6 +61,8 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import sun.corba.EncapsInputStreamFactory;
public final class TypeCodeOutputStream extends EncapsOutputStream
{
private OutputStream enclosure = null;
@ -77,9 +79,9 @@ public final class TypeCodeOutputStream extends EncapsOutputStream
public org.omg.CORBA.portable.InputStream create_input_stream()
{
//return new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian());
TypeCodeInputStream tcis
= new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian(), getGIOPVersion());
TypeCodeInputStream tcis = EncapsInputStreamFactory
.newTypeCodeInputStream((ORB) orb(), getByteBuffer(),
getIndex(), isLittleEndian(), getGIOPVersion());
//if (TypeCodeImpl.debug) {
//System.out.println("Created TypeCodeInputStream " + tcis + " with no parent");
//tcis.printBuffer();

View File

@ -33,6 +33,8 @@ import org.omg.CORBA.LocalObject;
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
import com.sun.corba.se.spi.logging.CORBALogDomains;
import sun.corba.EncapsInputStreamFactory;
import com.sun.corba.se.impl.corba.AnyImpl;
import com.sun.corba.se.impl.encoding.EncapsInputStream;
import com.sun.corba.se.impl.encoding.EncapsOutputStream;
@ -193,8 +195,9 @@ public final class CDREncapsCodec
// it is turned into a FormatMismatch exception.
try {
EncapsInputStream cdrIn = new EncapsInputStream( orb, data,
data.length, giopVersion );
EncapsInputStream cdrIn = EncapsInputStreamFactory.newEncapsInputStream( orb, data,
data.length, giopVersion );
cdrIn.consumeEndian();

View File

@ -370,7 +370,7 @@ public class IIOPInputStream
* @exception IOException Any of the usual Input/Output related exceptions.
* @since JDK1.1
*/
public final Object readObjectDelegate() throws IOException
public final synchronized Object readObjectDelegate() throws IOException
{
try {
@ -389,7 +389,7 @@ public class IIOPInputStream
}
}
final Object simpleReadObject(Class clz,
final synchronized Object simpleReadObject(Class clz,
String repositoryID,
com.sun.org.omg.SendingContext.CodeBase sender,
int offset)
@ -461,7 +461,7 @@ public class IIOPInputStream
return obj;
}
public final void simpleSkipObject(String repositoryID,
public final synchronized void simpleSkipObject(String repositoryID,
com.sun.org.omg.SendingContext.CodeBase sender)
/* throws OptionalDataException, ClassNotFoundException, IOException */
{
@ -559,7 +559,7 @@ public class IIOPInputStream
* objects.
* @since JDK1.1
*/
public final void defaultReadObjectDelegate()
final synchronized void defaultReadObjectDelegate()
/* throws IOException, ClassNotFoundException, NotActiveException */
{
try {
@ -988,7 +988,7 @@ public class IIOPInputStream
}
}
private Object inputObject(Class clz,
private synchronized Object inputObject(Class clz,
String repositoryID,
com.sun.org.omg.SendingContext.CodeBase sender,
int offset)
@ -1317,7 +1317,7 @@ public class IIOPInputStream
* a form of custom marshaling.
*
*/
private Object inputObjectUsingFVD(Class clz,
private synchronized Object inputObjectUsingFVD(Class clz,
String repositoryID,
com.sun.org.omg.SendingContext.CodeBase sender,
int offset)

View File

@ -201,7 +201,7 @@ public abstract class InputStreamHook extends ObjectInputStream
readObjectState.endDefaultReadObject(this);
}
public abstract void defaultReadObjectDelegate();
abstract void defaultReadObjectDelegate();
abstract void readFields(java.util.Map fieldToValueMap)
throws java.io.InvalidClassException, java.io.StreamCorruptedException,

View File

@ -47,6 +47,8 @@ import com.sun.corba.se.impl.encoding.CDROutputStream ;
import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
import com.sun.corba.se.impl.encoding.EncapsInputStream ;
import sun.corba.EncapsInputStreamFactory;
/**
* This static utility class contains various utility methods for reading and
* writing CDR encapsulations.
@ -108,8 +110,8 @@ public class EncapsulationUtility
static public InputStream getEncapsulationStream( InputStream is )
{
byte[] data = readOctets( is ) ;
EncapsInputStream result = new EncapsInputStream( is.orb(), data,
data.length ) ;
EncapsInputStream result = EncapsInputStreamFactory.newEncapsInputStream( is.orb(), data,
data.length ) ;
result.consumeEndian() ;
return result ;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -49,6 +49,8 @@ import com.sun.corba.se.impl.ior.ObjectKeyImpl ;
import com.sun.corba.se.impl.logging.IORSystemException ;
import com.sun.corba.se.impl.encoding.EncapsInputStream ;
import sun.corba.EncapsInputStreamFactory;
/** Based on the magic and scid, return the appropriate
* ObjectKeyTemplate. Expects to be called with a valid
@ -217,7 +219,7 @@ public class ObjectKeyFactoryImpl implements ObjectKeyFactory
public ObjectKey create( byte[] key )
{
OctetSeqHolder osh = new OctetSeqHolder() ;
EncapsInputStream is = new EncapsInputStream( orb, key, key.length ) ;
EncapsInputStream is = EncapsInputStreamFactory.newEncapsInputStream( orb, key, key.length );
ObjectKeyTemplate oktemp = create( is, fullKey, osh ) ;
if (oktemp == null)

View File

@ -70,6 +70,8 @@ import com.sun.corba.se.impl.ior.EncapsulationUtility ;
import com.sun.corba.se.impl.encoding.EncapsInputStream ;
import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
import sun.corba.EncapsInputStreamFactory;
import com.sun.corba.se.impl.util.JDKBridge;
import com.sun.corba.se.impl.logging.IORSystemException;
@ -170,8 +172,8 @@ public class IIOPProfileImpl extends IdentifiableBase implements IIOPProfile
throw wrapper.invalidTaggedProfile() ;
}
EncapsInputStream istr = new EncapsInputStream((ORB)orb, profile.profile_data,
profile.profile_data.length);
EncapsInputStream istr = EncapsInputStreamFactory.newEncapsInputStream((ORB)orb, profile.profile_data,
profile.profile_data.length);
istr.consumeEndian();
init( istr ) ;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -25,6 +25,7 @@
package com.sun.corba.se.impl.presentation.rmi ;
import java.io.SerializablePermission;
import java.lang.reflect.InvocationHandler ;
import java.lang.reflect.Proxy ;
@ -38,11 +39,18 @@ public abstract class StubFactoryDynamicBase extends StubFactoryBase
{
protected final ClassLoader loader ;
public StubFactoryDynamicBase( PresentationManager.ClassData classData,
ClassLoader loader )
{
super( classData ) ;
private static Void checkPermission() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new SerializablePermission(
"enableSubclassImplementation"));
}
return null;
}
private StubFactoryDynamicBase(Void unused,
PresentationManager.ClassData classData, ClassLoader loader) {
super(classData);
// this.loader must not be null, or the newProxyInstance call
// will fail.
if (loader == null) {
@ -55,5 +63,11 @@ public abstract class StubFactoryDynamicBase extends StubFactoryBase
}
}
public StubFactoryDynamicBase( PresentationManager.ClassData classData,
ClassLoader loader )
{
this (checkPermission(), classData, loader);
}
public abstract org.omg.CORBA.Object makeStub() ;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -25,14 +25,22 @@
package com.sun.corba.se.impl.presentation.rmi;
import java.security.AccessController;
import java.security.PrivilegedAction;
import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
public class StubFactoryFactoryProxyImpl extends StubFactoryFactoryDynamicBase
{
public PresentationManager.StubFactory makeDynamicStubFactory(
PresentationManager pm, PresentationManager.ClassData classData,
ClassLoader classLoader )
PresentationManager pm, final PresentationManager.ClassData classData,
final ClassLoader classLoader )
{
return new StubFactoryProxyImpl( classData, classLoader ) ;
return AccessController
.doPrivileged(new PrivilegedAction<StubFactoryProxyImpl>() {
@Override
public StubFactoryProxyImpl run() {
return new StubFactoryProxyImpl(classData, classLoader);
}
});
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -115,6 +115,7 @@ import com.sun.corba.se.impl.util.JDKBridge;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import sun.corba.EncapsInputStreamFactory;
/**
* ClientDelegate is the RMI client-side subcontract or representation
@ -847,8 +848,8 @@ public class CorbaClientRequestDispatcherImpl
}
byte[] data = ((UnknownServiceContext)sc).getData();
EncapsInputStream in =
new EncapsInputStream((ORB)messageMediator.getBroker(),
data, data.length);
EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(),
data, data.length);
in.consumeEndian();
String msg =

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -36,7 +36,8 @@ import java.io.IOException;
import java.util.Iterator;
import java.rmi.RemoteException;
import java.nio.ByteBuffer;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.rmi.CORBA.Util;
import javax.rmi.CORBA.Tie;
@ -111,6 +112,7 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr;
import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr;
import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr;
import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl;
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
import com.sun.corba.se.impl.util.JDKBridge;
/**
@ -156,10 +158,17 @@ public class SharedCDRClientRequestDispatcherImpl
ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo();
cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());
CDRInputObject cdrInputObject =
new CDRInputObject(orb, null, bbwi.byteBuffer,
cdrOutputObject.getMessageHeader());
final ORB inOrb = orb;
final ByteBuffer inBuffer = bbwi.byteBuffer;
final Message inMsg = cdrOutputObject.getMessageHeader();
CDRInputObject cdrInputObject = AccessController
.doPrivileged(new PrivilegedAction<CDRInputObject>() {
@Override
public CDRInputObject run() {
return new CDRInputObject(inOrb, null, inBuffer,
inMsg);
}
});
messageMediator.setInputObject(cdrInputObject);
cdrInputObject.setMessageMediator(messageMediator);
@ -192,9 +201,17 @@ public class SharedCDRClientRequestDispatcherImpl
cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject();
bbwi = cdrOutputObject.getByteBufferWithInfo();
cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());
cdrInputObject =
new CDRInputObject(orb, null, bbwi.byteBuffer,
cdrOutputObject.getMessageHeader());
final ORB inOrb2 = orb;
final ByteBuffer inBuffer2 = bbwi.byteBuffer;
final Message inMsg2 = cdrOutputObject.getMessageHeader();
cdrInputObject = AccessController
.doPrivileged(new PrivilegedAction<CDRInputObject>() {
@Override
public CDRInputObject run() {
return new CDRInputObject(inOrb2, null, inBuffer2,
inMsg2);
}
});
messageMediator.setInputObject(cdrInputObject);
cdrInputObject.setMessageMediator(messageMediator);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -36,6 +36,8 @@ import java.util.Collections ;
import org.omg.CosNaming.NamingContextExt ;
import org.omg.CosNaming.NamingContextExtHelper ;
import sun.corba.EncapsInputStreamFactory;
import com.sun.corba.se.spi.ior.IOR;
import com.sun.corba.se.spi.ior.IORTemplate;
import com.sun.corba.se.spi.ior.ObjectKey;
@ -114,8 +116,8 @@ public class INSURLOperationImpl implements Operation
buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0);
buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F);
}
EncapsInputStream s = new EncapsInputStream(orb, buf, buf.length,
orb.getORBData().getGIOPVersion());
EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length,
orb.getORBData().getGIOPVersion());
s.consumeEndian();
return s.read_Object() ;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -58,6 +58,9 @@ import com.sun.corba.se.impl.orbutil.ORBUtility ;
import com.sun.corba.se.impl.util.Utility ;
import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
import sun.corba.EncapsInputStreamFactory;
public class ServiceContexts {
private static boolean isDebugging( OutputStream os )
{
@ -198,11 +201,11 @@ public class ServiceContexts {
// Note: As of Jan 2001, no standard OMG or Sun service contexts
// ship wchar data or are defined as using anything but GIOP 1.0 CDR.
EncapsInputStream eis
= new EncapsInputStream(orb,
data,
data.length,
giopVersion,
codeBase);
= EncapsInputStreamFactory.newEncapsInputStream(orb,
data,
data.length,
giopVersion,
codeBase);
eis.consumeEndian();
// Now the input stream passed to a ServiceContext

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -31,6 +31,10 @@
package org.omg.CORBA_2_3.portable;
import java.io.SerializablePermission;
import java.security.AccessController;
import java.security.PrivilegedAction;
/**
* InputStream provides for the reading of all of the mapped IDL types
* from the stream. It extends org.omg.CORBA.portable.InputStream. This
@ -43,6 +47,43 @@ package org.omg.CORBA_2_3.portable;
public abstract class InputStream extends org.omg.CORBA.portable.InputStream {
private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowInputStreamSubclass";
private static final boolean allowSubclass = AccessController.doPrivileged(
new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
String prop = System.getProperty(ALLOW_SUBCLASS_PROP);
return prop == null ? false :
(prop.equalsIgnoreCase("false") ? false : true);
}
});
private static Void checkPermission() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
if (!allowSubclass)
sm.checkPermission(new
SerializablePermission("enableSubclassImplementation"));
}
return null;
}
private InputStream(Void ignore) { }
/**
* Create a new instance of this class.
*
* throw SecurityException if SecurityManager is installed and
* enableSubclassImplementation SerializablePermission
* is not granted or jdk.corba.allowOutputStreamSubclass system
* property is either not set or is set to 'false'
*/
public InputStream() {
this(checkPermission());
}
/**
* Unmarshalls a value type from the input stream.
* @return the value type unmarshalled from the input stream

View File

@ -0,0 +1,153 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.corba;
import java.nio.ByteBuffer;
import java.security.AccessController;
import java.security.PrivilegedAction;
import com.sun.corba.se.impl.encoding.EncapsInputStream;
import com.sun.corba.se.impl.encoding.TypeCodeInputStream;
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
import com.sun.corba.se.pept.protocol.MessageMediator;
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
import com.sun.corba.se.spi.orb.ORB;
import com.sun.org.omg.SendingContext.CodeBase;
public class EncapsInputStreamFactory {
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final byte[] buf, final int size,
final boolean littleEndian, final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, buf, size,
littleEndian, version);
}
});
}
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer,
final int size, final boolean littleEndian,
final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, byteBuffer, size,
littleEndian, version);
}
});
}
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final byte[] data, final int size) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, data, size);
}
});
}
public static EncapsInputStream newEncapsInputStream(
final EncapsInputStream eis) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(eis);
}
});
}
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final byte[] data, final int size,
final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, data, size, version);
}
});
}
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final byte[] data, final int size,
final GIOPVersion version, final CodeBase codeBase) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, data, size, version,
codeBase);
}
});
}
public static TypeCodeInputStream newTypeCodeInputStream(
final org.omg.CORBA.ORB orb, final byte[] buf, final int size,
final boolean littleEndian, final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
@Override
public TypeCodeInputStream run() {
return new TypeCodeInputStream(orb, buf, size,
littleEndian, version);
}
});
}
public static TypeCodeInputStream newTypeCodeInputStream(
final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer,
final int size, final boolean littleEndian,
final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
@Override
public TypeCodeInputStream run() {
return new TypeCodeInputStream(orb, byteBuffer, size,
littleEndian, version);
}
});
}
public static TypeCodeInputStream newTypeCodeInputStream(
final org.omg.CORBA.ORB orb, final byte[] data, final int size) {
return AccessController
.doPrivileged(new PrivilegedAction<TypeCodeInputStream>() {
@Override
public TypeCodeInputStream run() {
return new TypeCodeInputStream(orb, data, size);
}
});
}
}

View File

@ -403,3 +403,4 @@ ce42d815dd2130250acf6132b51b624001638f0d jdk8-b119
05fedd51e40da22c9460bf17c7185889e435db3d hs25-b62
fca262db9c4309f99d2f5542ab0780e45c2f1578 jdk8-b120
ce2d7e46f3c7e41241f3b407705a4071323a11ab jdk9-b00
050a626a88951140df874f7b163e304d07b6c296 jdk9-b01

View File

@ -103,11 +103,12 @@ public class ClassLoaderStats extends Tool {
}
SystemDictionary dict = VM.getVM().getSystemDictionary();
dict.classesDo(new SystemDictionary.ClassAndLoaderVisitor() {
public void visit(Klass k, Oop loader) {
dict.classesDo(new SystemDictionary.ClassVisitor() {
public void visit(Klass k) {
if (! (k instanceof InstanceKlass)) {
return;
}
Oop loader = ((InstanceKlass) k).getClassLoader();
LoaderData ld = (loader != null) ? (LoaderData)loaderMap.get(loader)
: bootstrapLoaderData;
if (ld != null) {

View File

@ -557,11 +557,11 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
# Testing the built JVM
RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma
RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -XXaltjvm=$(ALTJVM_DIR) -Dsun.java.launcher.is_altjvm=true
generic_test:
@$(ECHO) "Running with: $(ALTJVM_DIR)"
@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion
@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help
@$(RUN_JVM) -Xinternalversion
@$(RUN_JVM) -showversion -help
# C2 test targets
test_product test_optimized test_fastdebug test_debug:

View File

@ -53,6 +53,7 @@ JVMOFFS.o = $(JVMOFFS).o
GENOFFS = generate$(JVMOFFS)
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace
DTRACE = dtrace
DTRACE.o = $(DTRACE).o
@ -262,14 +263,14 @@ endif
$(DtraceOutDir):
mkdir $(DtraceOutDir)
$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h

View File

@ -49,7 +49,7 @@ then
GDB=gdb
fi
# This is the name of the gdb binary to use
# This is the name of the dbx binary to use
if [ ! "$DBX" ]
then
DBX=dbx
@ -68,9 +68,16 @@ EMACS=emacs
# End of user changeable parameters -----------------------------------------
#
OS=`uname -s`
# Make sure the paths are fully specified, i.e. they must begin with /.
REL_MYDIR=`dirname $0`
MYDIR=`cd $REL_MYDIR && pwd`
case "$OS" in
CYGWIN*)
MYDIR=`cygpath -m "$MYDIR"`
;;
esac
#
# Look whether the user wants to run inside gdb
@ -102,8 +109,17 @@ else
JDK=@@JDK_IMPORT_PATH@@
fi
if [ "${JDK}" = "" ]; then
echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty."
if [ "${JDK}" != "" ]; then
case "$OS" in
CYGWIN*)
JDK=`cygpath -m "$JDK"`
;;
esac
else
echo "Failed to find JDK." \
"Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty."
exit 1
fi
# We will set the LD_LIBRARY_PATH as follows:
@ -120,7 +136,6 @@ SBP=${MYDIR}:${JRE}/lib/${ARCH}
# Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH
OS=`uname -s`
if [ "${OS}" = "Darwin" ]
then
if [ -z "$DYLD_LIBRARY_PATH" ]
@ -141,7 +156,7 @@ else
export LD_LIBRARY_PATH
fi
JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS";
JPARMS="-XXaltjvm=$MYDIR -Dsun.java.launcher.is_altjvm=true $@ $JAVA_ARGS";
# Locate the java launcher
LAUNCHER=$JDK/bin/java
@ -152,6 +167,11 @@ fi
GDBSRCDIR=$MYDIR
BASEDIR=`cd $MYDIR/../../.. && pwd`
case "$OS" in
CYGWIN*)
BASEDIR=`cygpath -m "$BASEDIR"`
;;
esac
init_gdb() {
# Create a gdb script in case we should run inside gdb

View File

@ -124,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes.
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@ -361,6 +361,16 @@ sa.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
dtrace.make: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo; \
echo include flags.make; \
echo; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
FORCE:
.PHONY: all FORCE

View File

@ -42,18 +42,39 @@ ifneq ($(ALT_SDT_H),)
else
SDT_H_FILE = /usr/include/sys/sdt.h
endif
DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
REASON = "$(SDT_H_FILE) not found"
ifneq ($(DTRACE_ENABLED),)
CFLAGS += -DDTRACE_ENABLED
endif
endif # GCC version
endif # OPENJDK
endif
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace
DTRACE_PROG = dtrace
DtraceOutDir = $(GENERATED)/dtracefiles
$(DtraceOutDir):
mkdir $(DtraceOutDir)
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d
ifneq ($(DTRACE_ENABLED),)
CFLAGS += -DDTRACE_ENABLED
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
else
dtrace_gen_headers:
$(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
endif
# Phony target used in vm.make build target to check whether enabled.
.PHONY: dtraceCheck
ifeq ($(DTRACE_ENABLED),)
dtraceCheck:
$(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
@ -61,5 +82,7 @@ else
dtraceCheck:
endif
.PHONY: dtrace_gen_headers dtraceCheck
# It doesn't support HAVE_DTRACE_H though.

View File

@ -80,7 +80,7 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff dtrace_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
@ -102,6 +102,9 @@ trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
dtrace_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f dtrace.make dtrace_gen_headers $(MFLAGS-adjusted) GENERATED=$(GENERATED)
# and the VM: must use other makefile with dependencies included
# We have to go to great lengths to get control over the -jN argument

View File

@ -55,6 +55,7 @@ JVMOFFS.o = $(JVMOFFS).o
GENOFFS = generate$(JVMOFFS)
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace
DTRACE = dtrace
DTRACE.o = $(DTRACE).o
@ -253,8 +254,8 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
endif
endif
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
$(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
$(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \
$(DTRACE_COMMON_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
$(QUIETLY) cat $^ > $@
DTraced_Files = ciEnv.o \
@ -332,14 +333,14 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
$(DtraceOutDir):
mkdir $(DtraceOutDir)
$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h

View File

@ -1,40 +0,0 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
provider hs_private {
probe hashtable__new_entry(void*, uint32_t, uintptr_t, void*);
probe safepoint__begin();
probe safepoint__end();
probe cms__initmark__begin();
probe cms__initmark__end();
probe cms__remark__begin();
probe cms__remark__end();
};
#pragma D attributes Private/Private/Common provider hs_private provider
#pragma D attributes Private/Private/Unknown provider hs_private module
#pragma D attributes Private/Private/Unknown provider hs_private function
#pragma D attributes Private/Private/Common provider hs_private name
#pragma D attributes Private/Private/Common provider hs_private args

View File

@ -1788,12 +1788,14 @@ void os::jvm_path(char *buf, jint buflen) {
if (rp == NULL)
return;
if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// we're done. Otherwise, check for a JAVA_HOME environment variable and
// construct a path to the JVM being overridden.
if (Arguments::sun_java_launcher_is_altjvm()) {
// Support for the java launcher's '-XXaltjvm=<path>' option. Typical
// value for buf is "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so"
// or "<JAVA_HOME>/jre/lib/<vmtype>/libjvm.dylib". If "/jre/lib/"
// appears at the right place in the string, then assume we are
// installed in a JDK and we're done. Otherwise, check for a
// JAVA_HOME environment variable and construct a path to the JVM
// being overridden.
const char *p = buf + strlen(buf) - 1;
for (int count = 0; p > buf && count < 5; ++count) {

View File

@ -2371,13 +2371,14 @@ void os::jvm_path(char *buf, jint buflen) {
if (rp == NULL)
return;
if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// we're done. Otherwise, check for a JAVA_HOME environment variable and fix
// up the path so it looks like libjvm.so is installed there (append a
// fake suffix hotspot/libjvm.so).
if (Arguments::sun_java_launcher_is_altjvm()) {
// Support for the java launcher's '-XXaltjvm=<path>' option. Typical
// value for buf is "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so".
// If "/jre/lib/" appears at the right place in the string, then
// assume we are installed in a JDK and we're done. Otherwise, check
// for a JAVA_HOME environment variable and fix up the path so it
// looks like libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
const char *p = buf + strlen(buf) - 1;
for (int count = 0; p > buf && count < 5; ++count) {
for (--p; p > buf && *p != '/'; --p)

View File

@ -1,86 +0,0 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
provider hotspot {
probe class__loaded(char*, uintptr_t, void*, uintptr_t);
probe class__unloaded(char*, uintptr_t, void*, uintptr_t);
probe class__initialization__required(char*, uintptr_t, void*, intptr_t);
probe class__initialization__recursive(char*, uintptr_t, void*, intptr_t,int);
probe class__initialization__concurrent(char*, uintptr_t, void*, intptr_t,int);
probe class__initialization__erroneous(char*, uintptr_t, void*, intptr_t, int);
probe class__initialization__super__failed(char*, uintptr_t, void*, intptr_t,int);
probe class__initialization__clinit(char*, uintptr_t, void*, intptr_t,int);
probe class__initialization__error(char*, uintptr_t, void*, intptr_t,int);
probe class__initialization__end(char*, uintptr_t, void*, intptr_t,int);
probe vm__init__begin();
probe vm__init__end();
probe vm__shutdown();
probe vmops__request(char*, uintptr_t, int);
probe vmops__begin(char*, uintptr_t, int);
probe vmops__end(char*, uintptr_t, int);
probe gc__begin(uintptr_t);
probe gc__end();
probe mem__pool__gc__begin(
char*, uintptr_t, char*, uintptr_t,
uintptr_t, uintptr_t, uintptr_t, uintptr_t);
probe mem__pool__gc__end(
char*, uintptr_t, char*, uintptr_t,
uintptr_t, uintptr_t, uintptr_t, uintptr_t);
probe thread__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
probe thread__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
probe thread__sleep__begin(long long);
probe thread__sleep__end(int);
probe thread__yield();
probe thread__park__begin(uintptr_t, int, long long);
probe thread__park__end(uintptr_t);
probe thread__unpark(uintptr_t);
probe method__compile__begin(
char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, char*, uintptr_t);
probe method__compile__end(
char*, uintptr_t, char*, uintptr_t, char*, uintptr_t,
char*, uintptr_t, uintptr_t);
probe compiled__method__load(
char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, void*, uintptr_t);
probe compiled__method__unload(
char*, uintptr_t, char*, uintptr_t, char*, uintptr_t);
probe monitor__contended__enter(uintptr_t, uintptr_t, char*, uintptr_t);
probe monitor__contended__entered(uintptr_t, uintptr_t, char*, uintptr_t);
probe monitor__contended__exit(uintptr_t, uintptr_t, char*, uintptr_t);
probe monitor__wait(uintptr_t, uintptr_t, char*, uintptr_t, uintptr_t);
probe monitor__waited(uintptr_t, uintptr_t, char*, uintptr_t);
probe monitor__notify(uintptr_t, uintptr_t, char*, uintptr_t);
probe monitor__notifyAll(uintptr_t, uintptr_t, char*, uintptr_t);
probe object__alloc(int, char*, uintptr_t, uintptr_t);
probe method__entry(
int, char*, int, char*, int, char*, int);
probe method__return(
int, char*, int, char*, int, char*, int);
};
#pragma D attributes Evolving/Evolving/Common provider hotspot provider
#pragma D attributes Private/Private/Unknown provider hotspot module
#pragma D attributes Private/Private/Unknown provider hotspot function
#pragma D attributes Evolving/Evolving/Common provider hotspot name
#pragma D attributes Evolving/Evolving/Common provider hotspot args

View File

@ -1,506 +0,0 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
provider hotspot_jni {
probe AllocObject__entry(void*, void*);
probe AllocObject__return(void*);
probe AttachCurrentThreadAsDaemon__entry(void*, void**, void*);
probe AttachCurrentThreadAsDaemon__return(uint32_t);
probe AttachCurrentThread__entry(void*, void**, void*);
probe AttachCurrentThread__return(uint32_t);
probe CallBooleanMethodA__entry(void*, void*, uintptr_t);
probe CallBooleanMethodA__return(uintptr_t);
probe CallBooleanMethod__entry(void*, void*, uintptr_t);
probe CallBooleanMethod__return(uintptr_t);
probe CallBooleanMethodV__entry(void*, void*, uintptr_t);
probe CallBooleanMethodV__return(uintptr_t);
probe CallByteMethodA__entry(void*, void*, uintptr_t);
probe CallByteMethodA__return(char);
probe CallByteMethod__entry(void*, void*, uintptr_t);
probe CallByteMethod__return(char);
probe CallByteMethodV__entry(void*, void*, uintptr_t);
probe CallByteMethodV__return(char);
probe CallCharMethodA__entry(void*, void*, uintptr_t);
probe CallCharMethodA__return(uint16_t);
probe CallCharMethod__entry(void*, void*, uintptr_t);
probe CallCharMethod__return(uint16_t);
probe CallCharMethodV__entry(void*, void*, uintptr_t);
probe CallCharMethodV__return(uint16_t);
probe CallDoubleMethodA__entry(void*, void*, uintptr_t);
probe CallDoubleMethodA__return();
probe CallDoubleMethod__entry(void*, void*, uintptr_t);
probe CallDoubleMethod__return();
probe CallDoubleMethodV__entry(void*, void*, uintptr_t);
probe CallDoubleMethodV__return();
probe CallFloatMethodA__entry(void*, void*, uintptr_t);
probe CallFloatMethodA__return();
probe CallFloatMethod__entry(void*, void*, uintptr_t);
probe CallFloatMethod__return();
probe CallFloatMethodV__entry(void*, void*, uintptr_t);
probe CallFloatMethodV__return();
probe CallIntMethodA__entry(void*, void*, uintptr_t);
probe CallIntMethodA__return(uint32_t);
probe CallIntMethod__entry(void*, void*, uintptr_t);
probe CallIntMethod__return(uint32_t);
probe CallIntMethodV__entry(void*, void*, uintptr_t);
probe CallIntMethodV__return(uint32_t);
probe CallLongMethodA__entry(void*, void*, uintptr_t);
probe CallLongMethodA__return(uintptr_t);
probe CallLongMethod__entry(void*, void*, uintptr_t);
probe CallLongMethod__return(uintptr_t);
probe CallLongMethodV__entry(void*, void*, uintptr_t);
probe CallLongMethodV__return(uintptr_t);
probe CallNonvirtualBooleanMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualBooleanMethodA__return(uintptr_t);
probe CallNonvirtualBooleanMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualBooleanMethod__return(uintptr_t);
probe CallNonvirtualBooleanMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualBooleanMethodV__return(uintptr_t);
probe CallNonvirtualByteMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualByteMethodA__return(char);
probe CallNonvirtualByteMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualByteMethod__return(char);
probe CallNonvirtualByteMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualByteMethodV__return(char);
probe CallNonvirtualCharMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualCharMethodA__return(uint16_t);
probe CallNonvirtualCharMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualCharMethod__return(uint16_t);
probe CallNonvirtualCharMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualCharMethodV__return(uint16_t);
probe CallNonvirtualDoubleMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualDoubleMethodA__return();
probe CallNonvirtualDoubleMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualDoubleMethod__return();
probe CallNonvirtualDoubleMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualDoubleMethodV__return();
probe CallNonvirtualFloatMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualFloatMethodA__return();
probe CallNonvirtualFloatMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualFloatMethod__return();
probe CallNonvirtualFloatMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualFloatMethodV__return();
probe CallNonvirtualIntMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualIntMethodA__return(uint32_t);
probe CallNonvirtualIntMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualIntMethod__return(uint32_t);
probe CallNonvirtualIntMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualIntMethodV__return(uint32_t);
probe CallNonvirtualLongMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualLongMethodA__return(uintptr_t);
probe CallNonvirtualLongMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualLongMethod__return(uintptr_t);
probe CallNonvirtualLongMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualLongMethodV__return(uintptr_t);
probe CallNonvirtualObjectMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualObjectMethodA__return(void*);
probe CallNonvirtualObjectMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualObjectMethod__return(void*);
probe CallNonvirtualObjectMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualObjectMethodV__return(void*);
probe CallNonvirtualShortMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualShortMethodA__return(uint16_t);
probe CallNonvirtualShortMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualShortMethod__return(uint16_t);
probe CallNonvirtualShortMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualShortMethodV__return(uint16_t);
probe CallNonvirtualVoidMethodA__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualVoidMethodA__return();
probe CallNonvirtualVoidMethod__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualVoidMethod__return();
probe CallNonvirtualVoidMethodV__entry(void*, void*, void*, uintptr_t);
probe CallNonvirtualVoidMethodV__return();
probe CallObjectMethodA__entry(void*, void*, uintptr_t);
probe CallObjectMethodA__return(void*);
probe CallObjectMethod__entry(void*, void*, uintptr_t);
probe CallObjectMethod__return(void*);
probe CallObjectMethodV__entry(void*, void*, uintptr_t);
probe CallObjectMethodV__return(void*);
probe CallShortMethodA__entry(void*, void*, uintptr_t);
probe CallShortMethodA__return(uint16_t);
probe CallShortMethod__entry(void*, void*, uintptr_t);
probe CallShortMethod__return(uint16_t);
probe CallShortMethodV__entry(void*, void*, uintptr_t);
probe CallShortMethodV__return(uint16_t);
probe CallStaticBooleanMethodA__entry(void*, void*, uintptr_t);
probe CallStaticBooleanMethodA__return(uintptr_t);
probe CallStaticBooleanMethod__entry(void*, void*, uintptr_t);
probe CallStaticBooleanMethod__return(uintptr_t);
probe CallStaticBooleanMethodV__entry(void*, void*, uintptr_t);
probe CallStaticBooleanMethodV__return(uintptr_t);
probe CallStaticByteMethodA__entry(void*, void*, uintptr_t);
probe CallStaticByteMethodA__return(char);
probe CallStaticByteMethod__entry(void*, void*, uintptr_t);
probe CallStaticByteMethod__return(char);
probe CallStaticByteMethodV__entry(void*, void*, uintptr_t);
probe CallStaticByteMethodV__return(char);
probe CallStaticCharMethodA__entry(void*, void*, uintptr_t);
probe CallStaticCharMethodA__return(uint16_t);
probe CallStaticCharMethod__entry(void*, void*, uintptr_t);
probe CallStaticCharMethod__return(uint16_t);
probe CallStaticCharMethodV__entry(void*, void*, uintptr_t);
probe CallStaticCharMethodV__return(uint16_t);
probe CallStaticDoubleMethodA__entry(void*, void*, uintptr_t);
probe CallStaticDoubleMethodA__return();
probe CallStaticDoubleMethod__entry(void*, void*, uintptr_t);
probe CallStaticDoubleMethod__return();
probe CallStaticDoubleMethodV__entry(void*, void*, uintptr_t);
probe CallStaticDoubleMethodV__return();
probe CallStaticFloatMethodA__entry(void*, void*, uintptr_t);
probe CallStaticFloatMethodA__return();
probe CallStaticFloatMethod__entry(void*, void*, uintptr_t);
probe CallStaticFloatMethod__return();
probe CallStaticFloatMethodV__entry(void*, void*, uintptr_t);
probe CallStaticFloatMethodV__return();
probe CallStaticIntMethodA__entry(void*, void*, uintptr_t);
probe CallStaticIntMethodA__return(uint32_t);
probe CallStaticIntMethod__entry(void*, void*, uintptr_t);
probe CallStaticIntMethod__return(uint32_t);
probe CallStaticIntMethodV__entry(void*, void*, uintptr_t);
probe CallStaticIntMethodV__return(uint32_t);
probe CallStaticLongMethodA__entry(void*, void*, uintptr_t);
probe CallStaticLongMethodA__return(uintptr_t);
probe CallStaticLongMethod__entry(void*, void*, uintptr_t);
probe CallStaticLongMethod__return(uintptr_t);
probe CallStaticLongMethodV__entry(void*, void*, uintptr_t);
probe CallStaticLongMethodV__return(uintptr_t);
probe CallStaticObjectMethodA__entry(void*, void*, uintptr_t);
probe CallStaticObjectMethodA__return(void*);
probe CallStaticObjectMethod__entry(void*, void*, uintptr_t);
probe CallStaticObjectMethod__return(void*);
probe CallStaticObjectMethodV__entry(void*, void*, uintptr_t);
probe CallStaticObjectMethodV__return(void*);
probe CallStaticShortMethodA__entry(void*, void*, uintptr_t);
probe CallStaticShortMethodA__return(uint16_t);
probe CallStaticShortMethod__entry(void*, void*, uintptr_t);
probe CallStaticShortMethod__return(uint16_t);
probe CallStaticShortMethodV__entry(void*, void*, uintptr_t);
probe CallStaticShortMethodV__return(uint16_t);
probe CallStaticVoidMethodA__entry(void*, void*, uintptr_t);
probe CallStaticVoidMethodA__return();
probe CallStaticVoidMethod__entry(void*, void*, uintptr_t);
probe CallStaticVoidMethod__return();
probe CallStaticVoidMethodV__entry(void*, void*, uintptr_t);
probe CallStaticVoidMethodV__return();
probe CallVoidMethodA__entry(void*, void*, uintptr_t);
probe CallVoidMethodA__return();
probe CallVoidMethod__entry(void*, void*, uintptr_t);
probe CallVoidMethod__return();
probe CallVoidMethodV__entry(void*, void*, uintptr_t);
probe CallVoidMethodV__return();
probe CreateJavaVM__entry(void**, void**, void*);
probe CreateJavaVM__return(uint32_t);
probe DefineClass__entry(void*, const char*, void*, char*, uintptr_t);
probe DefineClass__return(void*);
probe DeleteGlobalRef__entry(void*, void*);
probe DeleteGlobalRef__return();
probe DeleteLocalRef__entry(void*, void*);
probe DeleteLocalRef__return();
probe DeleteWeakGlobalRef__entry(void*, void*);
probe DeleteWeakGlobalRef__return();
probe DestroyJavaVM__entry(void*);
probe DestroyJavaVM__return(uint32_t);
probe DetachCurrentThread__entry(void*);
probe DetachCurrentThread__return(uint32_t);
probe EnsureLocalCapacity__entry(void*, uint32_t);
probe EnsureLocalCapacity__return(uint32_t);
probe ExceptionCheck__entry(void*);
probe ExceptionCheck__return(uintptr_t);
probe ExceptionClear__entry(void*);
probe ExceptionClear__return();
probe ExceptionDescribe__entry(void*);
probe ExceptionDescribe__return();
probe ExceptionOccurred__entry(void*);
probe ExceptionOccurred__return(void*);
probe FatalError__entry(void* env, const char*);
probe FindClass__entry(void*, const char*);
probe FindClass__return(void*);
probe FromReflectedField__entry(void*, void*);
probe FromReflectedField__return(uintptr_t);
probe FromReflectedMethod__entry(void*, void*);
probe FromReflectedMethod__return(uintptr_t);
probe GetArrayLength__entry(void*, void*);
probe GetArrayLength__return(uintptr_t);
probe GetBooleanArrayElements__entry(void*, void*, uintptr_t*);
probe GetBooleanArrayElements__return(uintptr_t*);
probe GetBooleanArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uintptr_t*);
probe GetBooleanArrayRegion__return();
probe GetBooleanField__entry(void*, void*, uintptr_t);
probe GetBooleanField__return(uintptr_t);
probe GetByteArrayElements__entry(void*, void*, uintptr_t*);
probe GetByteArrayElements__return(char*);
probe GetByteArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, char*);
probe GetByteArrayRegion__return();
probe GetByteField__entry(void*, void*, uintptr_t);
probe GetByteField__return(char);
probe GetCharArrayElements__entry(void*, void*, uintptr_t*);
probe GetCharArrayElements__return(uint16_t*);
probe GetCharArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*);
probe GetCharArrayRegion__return();
probe GetCharField__entry(void*, void*, uintptr_t);
probe GetCharField__return(uint16_t);
probe GetCreatedJavaVMs__entry(void**, uintptr_t, uintptr_t*);
probe GetCreatedJavaVMs__return(uintptr_t);
probe GetDefaultJavaVMInitArgs__entry(void*);
probe GetDefaultJavaVMInitArgs__return(uint32_t);
probe GetDirectBufferAddress__entry(void*, void*);
probe GetDirectBufferAddress__return(void*);
probe GetDirectBufferCapacity__entry(void*, void*);
probe GetDirectBufferCapacity__return(uintptr_t);
probe GetDoubleArrayElements__entry(void*, void*, uintptr_t*);
probe GetDoubleArrayElements__return(double*);
probe GetDoubleArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, double*);
probe GetDoubleArrayRegion__return();
probe GetDoubleField__entry(void*, void*, uintptr_t);
probe GetDoubleField__return();
probe GetEnv__entry(void*, void*, uint32_t);
probe GetEnv__return(uint32_t);
probe GetFieldID__entry(void*, void*, const char*, const char*);
probe GetFieldID__return(uintptr_t);
probe GetFloatArrayElements__entry(void*, void*, uintptr_t*);
probe GetFloatArrayElements__return(float*);
probe GetFloatArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, float*);
probe GetFloatArrayRegion__return();
probe GetFloatField__entry(void*, void*, uintptr_t);
probe GetFloatField__return();
probe GetIntArrayElements__entry(void*, void*, uintptr_t*);
probe GetIntArrayElements__return(uint32_t*);
probe GetIntArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint32_t*);
probe GetIntArrayRegion__return();
probe GetIntField__entry(void*, void*, uintptr_t);
probe GetIntField__return(uint32_t);
probe GetJavaVM__entry(void*, void**);
probe GetJavaVM__return(uint32_t);
probe GetLongArrayElements__entry(void*, void*, uintptr_t*);
probe GetLongArrayElements__return(uintptr_t*);
probe GetLongArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uintptr_t*);
probe GetLongArrayRegion__return();
probe GetLongField__entry(void*, void*, uintptr_t);
probe GetLongField__return(uintptr_t);
probe GetMethodID__entry(void*, void*, const char*, const char*);
probe GetMethodID__return(uintptr_t);
probe GetObjectArrayElement__entry(void*, void*, uintptr_t);
probe GetObjectArrayElement__return(void*);
probe GetObjectClass__entry(void*, void*);
probe GetObjectClass__return(void*);
probe GetObjectField__entry(void*, void*, uintptr_t);
probe GetObjectField__return(void*);
probe GetObjectRefType__entry(void*, void*);
probe GetObjectRefType__return(void*);
probe GetPrimitiveArrayCritical__entry(void*, void*, uintptr_t*);
probe GetPrimitiveArrayCritical__return(void*);
probe GetShortArrayElements__entry(void*, void*, uintptr_t*);
probe GetShortArrayElements__return(uint16_t*);
probe GetShortArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*);
probe GetShortArrayRegion__return();
probe GetShortField__entry(void*, void*, uintptr_t);
probe GetShortField__return(uint16_t);
probe GetStaticBooleanField__entry(void*, void*, uintptr_t);
probe GetStaticBooleanField__return(uintptr_t);
probe GetStaticByteField__entry(void*, void*, uintptr_t);
probe GetStaticByteField__return(char);
probe GetStaticCharField__entry(void*, void*, uintptr_t);
probe GetStaticCharField__return(uint16_t);
probe GetStaticDoubleField__entry(void*, void*, uintptr_t);
probe GetStaticDoubleField__return();
probe GetStaticFieldID__entry(void*, void*, const char*, const char*);
probe GetStaticFieldID__return(uintptr_t);
probe GetStaticFloatField__entry(void*, void*, uintptr_t);
probe GetStaticFloatField__return();
probe GetStaticIntField__entry(void*, void*, uintptr_t);
probe GetStaticIntField__return(uint32_t);
probe GetStaticLongField__entry(void*, void*, uintptr_t);
probe GetStaticLongField__return(uintptr_t);
probe GetStaticMethodID__entry(void*, void*, const char*, const char*);
probe GetStaticMethodID__return(uintptr_t);
probe GetStaticObjectField__entry(void*, void*, uintptr_t);
probe GetStaticObjectField__return(void*);
probe GetStaticShortField__entry(void*, void*, uintptr_t);
probe GetStaticShortField__return(uint16_t);
probe GetStringChars__entry(void*, void*, uintptr_t*);
probe GetStringChars__return(const uint16_t*);
probe GetStringCritical__entry(void*, void*, uintptr_t*);
probe GetStringCritical__return(const uint16_t*);
probe GetStringLength__entry(void*, void*);
probe GetStringLength__return(uintptr_t);
probe GetStringRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*);
probe GetStringRegion__return();
probe GetStringUTFChars__entry(void*, void*, uintptr_t*);
probe GetStringUTFChars__return(const char*);
probe GetStringUTFLength__entry(void*, void*);
probe GetStringUTFLength__return(uintptr_t);
probe GetStringUTFRegion__entry(void*, void*, uintptr_t, uintptr_t, char*);
probe GetStringUTFRegion__return();
probe GetSuperclass__entry(void*, void*);
probe GetSuperclass__return(void*);
probe GetVersion__entry(void*);
probe GetVersion__return(uint32_t);
probe IsAssignableFrom__entry(void*, void*, void*);
probe IsAssignableFrom__return(uintptr_t);
probe IsInstanceOf__entry(void*, void*, void*);
probe IsInstanceOf__return(uintptr_t);
probe IsSameObject__entry(void*, void*, void*);
probe IsSameObject__return(uintptr_t);
probe MonitorEnter__entry(void*, void*);
probe MonitorEnter__return(uint32_t);
probe MonitorExit__entry(void*, void*);
probe MonitorExit__return(uint32_t);
probe NewBooleanArray__entry(void*, uintptr_t);
probe NewBooleanArray__return(void*);
probe NewByteArray__entry(void*, uintptr_t);
probe NewByteArray__return(void*);
probe NewCharArray__entry(void*, uintptr_t);
probe NewCharArray__return(void*);
probe NewDirectByteBuffer__entry(void*, void*, uintptr_t);
probe NewDirectByteBuffer__return(void*);
probe NewDoubleArray__entry(void*, uintptr_t);
probe NewDoubleArray__return(void*);
probe NewFloatArray__entry(void*, uintptr_t);
probe NewFloatArray__return(void*);
probe NewGlobalRef__entry(void*, void*);
probe NewGlobalRef__return(void*);
probe NewIntArray__entry(void*, uintptr_t);
probe NewIntArray__return(void*);
probe NewLocalRef__entry(void*, void*);
probe NewLocalRef__return(void*);
probe NewLongArray__entry(void*, uintptr_t);
probe NewLongArray__return(void*);
probe NewObjectA__entry(void*, void*, uintptr_t);
probe NewObjectA__return(void*);
probe NewObjectArray__entry(void*, uintptr_t, void*, void*);
probe NewObjectArray__return(void*);
probe NewObject__entry(void*, void*, uintptr_t);
probe NewObject__return(void*);
probe NewObjectV__entry(void*, void*, uintptr_t);
probe NewObjectV__return(void*);
probe NewShortArray__entry(void*, uintptr_t);
probe NewShortArray__return(void*);
probe NewString__entry(void*, const uint16_t*, uintptr_t);
probe NewString__return(void*);
probe NewStringUTF__entry(void*, const char*);
probe NewStringUTF__return(void*);
probe NewWeakGlobalRef__entry(void*, void*);
probe NewWeakGlobalRef__return(void*);
probe PopLocalFrame__entry(void*, void*);
probe PopLocalFrame__return(void*);
probe PushLocalFrame__entry(void*, uint32_t);
probe PushLocalFrame__return(uint32_t);
probe RegisterNatives__entry(void*, void*, const void*, uint32_t);
probe RegisterNatives__return(uint32_t);
probe ReleaseBooleanArrayElements__entry(void*, void*, uintptr_t*, uint32_t);
probe ReleaseBooleanArrayElements__return();
probe ReleaseByteArrayElements__entry(void*, void*, char*, uint32_t);
probe ReleaseByteArrayElements__return();
probe ReleaseCharArrayElements__entry(void*, void*, uint16_t*, uint32_t);
probe ReleaseCharArrayElements__return();
probe ReleaseDoubleArrayElements__entry(void*, void*, double*, uint32_t);
probe ReleaseDoubleArrayElements__return();
probe ReleaseFloatArrayElements__entry(void*, void*, float*, uint32_t);
probe ReleaseFloatArrayElements__return();
probe ReleaseIntArrayElements__entry(void*, void*, uint32_t*, uint32_t);
probe ReleaseIntArrayElements__return();
probe ReleaseLongArrayElements__entry(void*, void*, uintptr_t*, uint32_t);
probe ReleaseLongArrayElements__return();
probe ReleasePrimitiveArrayCritical__entry(void*, void*, void*, uint32_t);
probe ReleasePrimitiveArrayCritical__return();
probe ReleaseShortArrayElements__entry(void*, void*, uint16_t*, uint32_t);
probe ReleaseShortArrayElements__return();
probe ReleaseStringChars__entry(void*, void*, const uint16_t*);
probe ReleaseStringChars__return();
probe ReleaseStringCritical__entry(void*, void*, const uint16_t*);
probe ReleaseStringCritical__return();
probe ReleaseStringUTFChars__entry(void*, void*, const char*);
probe ReleaseStringUTFChars__return();
probe SetBooleanArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uintptr_t*);
probe SetBooleanArrayRegion__return();
probe SetBooleanField__entry(void*, void*, uintptr_t, uintptr_t);
probe SetBooleanField__return();
probe SetByteArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const char*);
probe SetByteArrayRegion__return();
probe SetByteField__entry(void*, void*, uintptr_t, char);
probe SetByteField__return();
probe SetCharArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint16_t*);
probe SetCharArrayRegion__return();
probe SetCharField__entry(void*, void*, uintptr_t, uint16_t);
probe SetCharField__return();
probe SetDoubleArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const double*);
probe SetDoubleArrayRegion__return();
probe SetDoubleField__entry(void*, void*, uintptr_t);
probe SetDoubleField__return();
probe SetFloatArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const float*);
probe SetFloatArrayRegion__return();
probe SetFloatField__entry(void*, void*, uintptr_t);
probe SetFloatField__return();
probe SetIntArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint32_t*);
probe SetIntArrayRegion__return();
probe SetIntField__entry(void*, void*, uintptr_t, uint32_t);
probe SetIntField__return();
probe SetLongArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uintptr_t*);
probe SetLongArrayRegion__return();
probe SetLongField__entry(void*, void*, uintptr_t, uintptr_t);
probe SetLongField__return();
probe SetObjectArrayElement__entry(void*, void*, uintptr_t, void*);
probe SetObjectArrayElement__return();
probe SetObjectField__entry(void*, void*, uintptr_t, void*);
probe SetObjectField__return();
probe SetShortArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint16_t*);
probe SetShortArrayRegion__return();
probe SetShortField__entry(void*, void*, uintptr_t, uint16_t);
probe SetShortField__return();
probe SetStaticBooleanField__entry(void*, void*, uintptr_t, uintptr_t);
probe SetStaticBooleanField__return();
probe SetStaticByteField__entry(void*, void*, uintptr_t, char);
probe SetStaticByteField__return();
probe SetStaticCharField__entry(void*, void*, uintptr_t, uint16_t);
probe SetStaticCharField__return();
probe SetStaticDoubleField__entry(void*, void*, uintptr_t);
probe SetStaticDoubleField__return();
probe SetStaticFloatField__entry(void*, void*, uintptr_t);
probe SetStaticFloatField__return();
probe SetStaticIntField__entry(void*, void*, uintptr_t, uint32_t);
probe SetStaticIntField__return();
probe SetStaticLongField__entry(void*, void*, uintptr_t, uintptr_t);
probe SetStaticLongField__return();
probe SetStaticObjectField__entry(void*, void*, uintptr_t, void*);
probe SetStaticObjectField__return();
probe SetStaticShortField__entry(void*, void*, uintptr_t, uint16_t);
probe SetStaticShortField__return();
probe Throw__entry(void*, void*);
probe Throw__return(intptr_t);
probe ThrowNew__entry(void*, void*, const char*);
probe ThrowNew__return(intptr_t);
probe ToReflectedField__entry(void*, void*, uintptr_t, uintptr_t);
probe ToReflectedField__return(void*);
probe ToReflectedMethod__entry(void*, void*, uintptr_t, uintptr_t);
probe ToReflectedMethod__return(void*);
probe UnregisterNatives__entry(void*, void*);
probe UnregisterNatives__return(uint32_t);
};
#pragma D attributes Standard/Standard/Common provider hotspot_jni provider
#pragma D attributes Private/Private/Unknown provider hotspot_jni module
#pragma D attributes Private/Private/Unknown provider hotspot_jni function
#pragma D attributes Standard/Standard/Common provider hotspot_jni name
#pragma D attributes Evolving/Evolving/Common provider hotspot_jni args

View File

@ -2441,13 +2441,14 @@ void os::jvm_path(char *buf, jint buflen) {
return;
}
if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// we're done. Otherwise, check for a JAVA_HOME environment variable and fix
// up the path so it looks like libjvm.so is installed there (append a
// fake suffix hotspot/libjvm.so).
if (Arguments::sun_java_launcher_is_altjvm()) {
// Support for the java launcher's '-XXaltjvm=<path>' option. Typical
// value for buf is "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so".
// If "/jre/lib/" appears at the right place in the string, then
// assume we are installed in a JDK and we're done. Otherwise, check
// for a JAVA_HOME environment variable and fix up the path so it
// looks like libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
const char *p = buf + strlen(buf) - 1;
for (int count = 0; p > buf && count < 5; ++count) {
for (--p; p > buf && *p != '/'; --p)

View File

@ -1810,32 +1810,30 @@ void os::jvm_path(char *buf, jint buflen) {
}
buf[0] = '\0';
if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Check for an
// JAVA_HOME environment variable
// and fix up the path so it looks like
// libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
char* java_home_var = ::getenv("JAVA_HOME");
if (java_home_var != NULL && java_home_var[0] != 0) {
if (Arguments::sun_java_launcher_is_altjvm()) {
// Support for the java launcher's '-XXaltjvm=<path>' option. Check
// for a JAVA_HOME environment variable and fix up the path so it
// looks like jvm.dll is installed there (append a fake suffix
// hotspot/jvm.dll).
char* java_home_var = ::getenv("JAVA_HOME");
if (java_home_var != NULL && java_home_var[0] != 0) {
strncpy(buf, java_home_var, buflen);
strncpy(buf, java_home_var, buflen);
// determine if this is a legacy image or modules image
// modules image doesn't have "jre" subdirectory
size_t len = strlen(buf);
char* jrebin_p = buf + len;
jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
if (0 != _access(buf, 0)) {
jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
}
len = strlen(buf);
jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
}
// determine if this is a legacy image or modules image
// modules image doesn't have "jre" subdirectory
size_t len = strlen(buf);
char* jrebin_p = buf + len;
jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
if (0 != _access(buf, 0)) {
jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
}
len = strlen(buf);
jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
}
}
if(buf[0] == '\0') {
GetModuleFileName(vm_lib_handle, buf, buflen);
if (buf[0] == '\0') {
GetModuleFileName(vm_lib_handle, buf, buflen);
}
strcpy(saved_jvm_path, buf);
}

View File

@ -161,7 +161,18 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup");
tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe");
tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) -Dsun.java.launcher=gamma");
// The JVM loads some libraries using a path relative to
// itself because it expects to be in a JRE or a JDK. The java
// launcher's '-XXaltjvm=' option allows the JVM to be outside
// the JRE or JDK so '-Dsun.java.launcher.is_altjvm=true'
// forces a fake JAVA_HOME relative path to be used to
// find the other libraries. The '-XX:+PauseAtExit' option
// causes the VM to wait for key press before exiting; this
// allows any stdout or stderr messages to be seen before
// the cmdtool exits.
tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) "
+ "-Dsun.java.launcher.is_altjvm=true "
+ "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit");
tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot"));
endTag();
}

View File

@ -564,16 +564,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
}
}
// 5. check if method is concrete
if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) {
ResourceMark rm(THREAD);
THROW_MSG(vmSymbols::java_lang_AbstractMethodError(),
Method::name_and_sig_as_C_string(resolved_klass(),
method_name,
method_signature));
}
// 6. access checks, access checking may be turned off when calling from within the VM.
// 5. access checks, access checking may be turned off when calling from within the VM.
if (check_access) {
assert(current_klass.not_null() , "current_klass should not be null");

View File

@ -1320,9 +1320,13 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
// interface call
KlassHandle h_holder(THREAD, holder);
int itbl_index = m->itable_index();
Klass* k = h_recv->klass();
selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK);
if (call_type == JNI_VIRTUAL) {
int itbl_index = m->itable_index();
Klass* k = h_recv->klass();
selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK);
} else {
selected_method = m;
}
}
}

View File

@ -1360,8 +1360,10 @@ JvmtiEnv::GetFrameCount(JavaThread* java_thread, jint* count_ptr) {
if (state == NULL) {
return JVMTI_ERROR_THREAD_NOT_ALIVE;
}
uint32_t debug_bits = 0;
if (is_thread_fully_suspended(java_thread, true, &debug_bits)) {
// It is only safe to perform the direct operation on the current
// thread. All other usage needs to use a vm-safepoint-op for safety.
if (java_thread == JavaThread::current()) {
err = get_frame_count(state, count_ptr);
} else {
// get java stack frame count at safepoint.
@ -1476,9 +1478,10 @@ JvmtiEnv::PopFrame(JavaThread* java_thread) {
jvmtiError
JvmtiEnv::GetFrameLocation(JavaThread* java_thread, jint depth, jmethodID* method_ptr, jlocation* location_ptr) {
jvmtiError err = JVMTI_ERROR_NONE;
uint32_t debug_bits = 0;
if (is_thread_fully_suspended(java_thread, true, &debug_bits)) {
// It is only safe to perform the direct operation on the current
// thread. All other usage needs to use a vm-safepoint-op for safety.
if (java_thread == JavaThread::current()) {
err = get_frame_location(java_thread, depth, method_ptr, location_ptr);
} else {
// JVMTI get java stack frame location at safepoint.

View File

@ -533,7 +533,11 @@ public:
VMOp_Type type() const { return VMOp_GetFrameCount; }
jvmtiError result() { return _result; }
void doit() {
_result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr);
_result = JVMTI_ERROR_THREAD_NOT_ALIVE;
JavaThread* jt = _state->get_thread();
if (Threads::includes(jt) && !jt->is_exiting() && jt->threadObj() != NULL) {
_result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr);
}
}
};
@ -559,8 +563,12 @@ public:
VMOp_Type type() const { return VMOp_GetFrameLocation; }
jvmtiError result() { return _result; }
void doit() {
_result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth,
_method_ptr, _location_ptr);
_result = JVMTI_ERROR_THREAD_NOT_ALIVE;
if (Threads::includes(_java_thread) && !_java_thread->is_exiting() &&
_java_thread->threadObj() != NULL) {
_result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth,
_method_ptr, _location_ptr);
}
}
};

View File

@ -101,7 +101,7 @@ bool Arguments::_xdebug_mode = false;
const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
int Arguments::_sun_java_launcher_pid = -1;
bool Arguments::_created_by_gamma_launcher = false;
bool Arguments::_sun_java_launcher_is_altjvm = false;
// These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
@ -151,7 +151,8 @@ static void logOption(const char* opt) {
// Process java launcher properties.
void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
// See if sun.java.launcher or sun.java.launcher.pid is defined.
// See if sun.java.launcher, sun.java.launcher.is_altjvm or
// sun.java.launcher.pid is defined.
// Must do this before setting up other system properties,
// as some of them may depend on launcher type.
for (int index = 0; index < args->nOptions; index++) {
@ -162,6 +163,12 @@ void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
process_java_launcher_argument(tail, option->extraInfo);
continue;
}
if (match_option(option, "-Dsun.java.launcher.is_altjvm=", &tail)) {
if (strcmp(tail, "true") == 0) {
_sun_java_launcher_is_altjvm = true;
}
continue;
}
if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {
_sun_java_launcher_pid = atoi(tail);
continue;
@ -1013,9 +1020,10 @@ bool Arguments::add_property(const char* prop) {
_java_command = value;
// Record value in Arguments, but let it get passed to Java.
} else if (strcmp(key, "sun.java.launcher.pid") == 0) {
// launcher.pid property is private and is processed
// in process_sun_java_launcher_properties();
} else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0 ||
strcmp(key, "sun.java.launcher.pid") == 0) {
// sun.java.launcher.is_altjvm and sun.java.launcher.pid property are
// private and are processed in process_sun_java_launcher_properties();
// the sun.java.launcher property is passed on to the java application
FreeHeap(key);
if (eq != NULL) {
@ -1810,9 +1818,6 @@ void Arguments::process_java_compiler_argument(char* arg) {
void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
_sun_java_launcher = strdup(launcher);
if (strcmp("gamma", _sun_java_launcher) == 0) {
_created_by_gamma_launcher = true;
}
}
bool Arguments::created_by_java_launcher() {
@ -1820,8 +1825,8 @@ bool Arguments::created_by_java_launcher() {
return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
}
bool Arguments::created_by_gamma_launcher() {
return _created_by_gamma_launcher;
bool Arguments::sun_java_launcher_is_altjvm() {
return _sun_java_launcher_is_altjvm;
}
//===========================================================================================================
@ -3809,16 +3814,6 @@ jint Arguments::apply_ergo() {
}
}
// set PauseAtExit if the gamma launcher was used and a debugger is attached
// but only if not already set on the commandline
if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) {
bool set = false;
CommandLineFlags::wasSetOnCmdline("PauseAtExit", &set);
if (!set) {
FLAG_SET_DEFAULT(PauseAtExit, true);
}
}
return JNI_OK;
}

View File

@ -269,14 +269,14 @@ class Arguments : AllStatic {
static const char* _java_vendor_url_bug;
// sun.java.launcher, private property to provide information about
// java/gamma launcher
// java launcher
static const char* _sun_java_launcher;
// sun.java.launcher.pid, private property
static int _sun_java_launcher_pid;
// was this VM created by the gamma launcher
static bool _created_by_gamma_launcher;
// was this VM created via the -XXaltjvm=<path> option
static bool _sun_java_launcher_is_altjvm;
// Option flags
static bool _has_profile;
@ -498,8 +498,8 @@ class Arguments : AllStatic {
static const char* sun_java_launcher() { return _sun_java_launcher; }
// Was VM created by a Java launcher?
static bool created_by_java_launcher();
// Was VM created by the gamma Java launcher?
static bool created_by_gamma_launcher();
// -Dsun.java.launcher.is_altjvm
static bool sun_java_launcher_is_altjvm();
// -Dsun.java.launcher.pid
static int sun_java_launcher_pid() { return _sun_java_launcher_pid; }

View File

@ -38,24 +38,20 @@
#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
#define USDT2 1
#include "dtracefiles/hotspot.h"
#include "dtracefiles/hotspot_jni.h"
#include "dtracefiles/hs_private.h"
#elif defined(LINUX)
#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
#define USDT1 1
#elif defined(__APPLE__)
#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
#define USDT2 1
#include <sys/types.h>
#include "dtracefiles/hotspot.h"
#include "dtracefiles/hotspot_jni.h"
#include "dtracefiles/hs_private.h"
#else
#error "dtrace enabled for unknown os"
#endif /* defined(SOLARIS) */
#define USDT2 1
#include "dtracefiles/hotspot.h"
#include "dtracefiles/hotspot_jni.h"
#include "dtracefiles/hs_private.h"
#else /* defined(DTRACE_ENABLED) */
#define DTRACE_ONLY(x)

View File

@ -0,0 +1,181 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* @test
* @bug 8032010
* @summary method lookup on an abstract method in a concrete class should be successful
* @run main TestConcreteClassWithAbstractMethod
*/
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
/*
* class T1 { public int m() {} }
* class T2 { public abstract int m(); }
* class T3 { public int m() {} }
*
* Call site: T3.test() { invokevirtual T2.m() }
* T3.m() should be invoked
*/
public class TestConcreteClassWithAbstractMethod {
static final String classT1 = "p1.T1";
static final String classT2 = "p1.T2";
static final String classT3 = "p1.T3";
static final String callerName = classT3;
public static void main(String[] args) throws Exception {
ClassLoader cl = new ClassLoader() {
public Class<?> loadClass(String name) throws ClassNotFoundException {
if (findLoadedClass(name) != null) {
return findLoadedClass(name);
}
if (classT1.equals(name)) {
byte[] classFile = dumpT1();
return defineClass(classT1, classFile, 0, classFile.length);
}
if (classT2.equals(name)) {
byte[] classFile = dumpT2();
return defineClass(classT2, classFile, 0, classFile.length);
}
if (classT3.equals(name)) {
byte[] classFile = dumpT3();
return defineClass(classT3, classFile, 0, classFile.length);
}
return super.loadClass(name);
}
};
cl.loadClass(classT1);
cl.loadClass(classT2);
cl.loadClass(classT3);
//cl.loadClass(callerName).getDeclaredMethod("m");
cl.loadClass(callerName).newInstance();
int result = (Integer)cl.loadClass(callerName).getDeclaredMethod("test").invoke(null);
System.out.println(""+result);
}
public static byte[] dumpT1() {
ClassWriter cw = new ClassWriter(0);
MethodVisitor mv;
cw.visit(52, ACC_PUBLIC | ACC_SUPER, "p1/T1", null, "java/lang/Object", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
mv.visitCode();
mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
mv.visitLdcInsn("p1/T1.m()");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "print", "(Ljava/lang/String;)V", false);
mv.visitIntInsn(BIPUSH, 3);
mv.visitInsn(IRETURN);
mv.visitMaxs(2, 1);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
public static byte[] dumpT2() {
ClassWriter cw = new ClassWriter(0);
MethodVisitor mv;
cw.visit(52, ACC_PUBLIC | ACC_SUPER, "p1/T2", null, "p1/T1", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "p1/T1", "<init>", "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "m", "()I", null, null);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
public static byte[] dumpT3() {
ClassWriter cw = new ClassWriter(0);
MethodVisitor mv;
cw.visit(52, ACC_PUBLIC + ACC_SUPER, "p1/T3", null, "p1/T2", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "p1/T2", "<init>", "()V", false);
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
mv.visitCode();
mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
mv.visitLdcInsn("p1/T3.m()");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "print", "(Ljava/lang/String;)V", false);
mv.visitIntInsn(BIPUSH, 2);
mv.visitInsn(IRETURN);
mv.visitMaxs(2, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "()I", null, null);
mv.visitCode();
mv.visitTypeInsn(NEW, "p1/T3");
mv.visitInsn(DUP);
mv.visitMethodInsn(INVOKESPECIAL, "p1/T3", "<init>", "()V", false);
mv.visitMethodInsn(INVOKEVIRTUAL, "p1/T2", "m", "()I", false);
mv.visitInsn(IRETURN);
mv.visitMaxs(3, 2);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
}

View File

@ -243,3 +243,4 @@ e4e5069250e717defcb556e2f6be291460988c51 jdk8-b118
69a930376c70beb9877970128bad0f04cb0c6eb1 jdk8-b119
64d8b228a72cf9082b1a9a881c81188ccffde234 jdk8-b120
4045edd35e8ba73bfdc23ce8961b9640d4145fe5 jdk9-b00
e5256f530a9b5f2d677ca245de44a617ffb58f52 jdk9-b01

View File

@ -79,7 +79,7 @@ public final class XalanConstants {
/**
* JDK maximum general entity size limit
*/
public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT =
public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
/**
* JDK maximum parameter entity size limit
@ -129,7 +129,7 @@ public final class XalanConstants {
/**
* JDK maximum general entity size limit
*/
public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
/**
* JDK maximum parameter entity size limit
*/

View File

@ -52,6 +52,8 @@ import org.w3c.dom.Text;
*/
public class ExsltStrings extends ExsltBase
{
static final String JDK_DEFAULT_DOM = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
/**
* The str:align function aligns a string within another string.
* <p>
@ -225,7 +227,7 @@ public class ExsltStrings extends ExsltBase
token = str.substring(fromIndex);
}
Document doc = DocumentHolder.m_doc;
Document doc = getDocument();
synchronized (doc)
{
Element element = doc.createElement("token");
@ -289,7 +291,7 @@ public class ExsltStrings extends ExsltBase
{
StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);
Document doc = DocumentHolder.m_doc;
Document doc = getDocument();
synchronized (doc)
{
while (lTokenizer.hasMoreTokens())
@ -305,7 +307,7 @@ public class ExsltStrings extends ExsltBase
else
{
Document doc = DocumentHolder.m_doc;
Document doc = getDocument();
synchronized (doc)
{
for (int i = 0; i < toTokenize.length(); i++)
@ -327,31 +329,23 @@ public class ExsltStrings extends ExsltBase
{
return tokenize(toTokenize, " \t\n\r");
}
/**
* This class is not loaded until first referenced (see Java Language
* Specification by Gosling/Joy/Steele, section 12.4.1)
*
* The static members are created when this class is first referenced, as a
* lazy initialization not needing checking against null or any
* synchronization.
*
* @return an instance of DOM Document
*/
private static class DocumentHolder
{
// Reuse the Document object to reduce memory usage.
private static final Document m_doc;
static {
try
{
m_doc =DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
private static Document getDocument()
{
try
{
if (System.getSecurityManager() == null) {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
} else {
return DocumentBuilderFactory.newInstance(JDK_DEFAULT_DOM, null).newDocumentBuilder().newDocument();
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
}
}

View File

@ -56,6 +56,7 @@ import org.xml.sax.SAXNotSupportedException;
*/
public class Extensions
{
static final String JDK_DEFAULT_DOM = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
/**
* Constructor Extensions
*
@ -114,23 +115,14 @@ public class Extensions
// This no longer will work right since the DTM.
// Document myDoc = myProcessor.getContextNode().getOwnerDocument();
try
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document myDoc = db.newDocument();
Document myDoc = getDocument();
Text textNode = myDoc.createTextNode(textNodeValue);
DocumentFragment docFrag = myDoc.createDocumentFragment();
docFrag.appendChild(textNode);
return new NodeSet(docFrag);
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
return new NodeSet(docFrag);
}
}
@ -249,8 +241,7 @@ public class Extensions
public static NodeList tokenize(String toTokenize, String delims)
{
Document doc = DocumentHolder.m_doc;
Document doc = getDocument();
StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);
NodeSet resultSet = new NodeSet();
@ -308,17 +299,7 @@ public class Extensions
public static Node checkEnvironment(ExpressionContext myContext)
{
Document factoryDocument;
try
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
factoryDocument = db.newDocument();
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
Document factoryDocument = getDocument();
Node resultNode = null;
try
@ -391,30 +372,21 @@ public class Extensions
}
/**
* This class is not loaded until first referenced (see Java Language
* Specification by Gosling/Joy/Steele, section 12.4.1)
*
* The static members are created when this class is first referenced, as a
* lazy initialization not needing checking against null or any
* synchronization.
*
* @return an instance of DOM Document
*/
private static class DocumentHolder
{
// Reuse the Document object to reduce memory usage.
private static final Document m_doc;
static
private static Document getDocument()
{
try
{
try
{
m_doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
if (System.getSecurityManager() == null) {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
} else {
return DocumentBuilderFactory.newInstance(JDK_DEFAULT_DOM, null).newDocumentBuilder().newDocument();
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
}
catch(ParserConfigurationException pce)
{
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
}
}
}

View File

@ -73,8 +73,8 @@ public final class XMLSecurityManager {
XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000),
TOTAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT,
XalanConstants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000),
GENEAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_GENEAL_ENTITY_SIZE_LIMIT,
XalanConstants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0),
GENERAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_GENERAL_ENTITY_SIZE_LIMIT,
XalanConstants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0),
PARAMETER_ENTITY_SIZE_LIMIT(XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT,
XalanConstants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000);

View File

@ -240,7 +240,7 @@ public final class Constants {
/**
* JDK maximum general entity size limit
*/
public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT =
public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
/**
* JDK maximum parameter entity size limit
@ -287,7 +287,7 @@ public final class Constants {
/**
* JDK maximum general entity size limit
*/
public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
/**
* JDK maximum parameter entity size limit
*/

View File

@ -44,6 +44,7 @@ import com.sun.org.apache.xerces.internal.xni.Augmentations;
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
import com.sun.org.apache.xerces.internal.impl.Constants;
import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
import com.sun.xml.internal.stream.Entity;
@ -262,6 +263,11 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
fEntityManager.startDTDEntity(inputSource);
} // setInputSource(XMLInputSource)
public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer) {
fLimitAnalyzer = limitAnalyzer;
}
/**
* Scans the external subset of the document.
*
@ -1625,10 +1631,10 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
XMLString literal = fString;
XMLString literal2 = fString;
int countChar = 0;
if (fLimitAnalyzer == null && fSecurityManager != null) {
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
fLimitAnalyzer.startEntity(entityName);
}
if (fLimitAnalyzer == null ) {
fLimitAnalyzer = new XMLLimitAnalyzer();
}
fLimitAnalyzer.startEntity(entityName);
if (fEntityScanner.scanLiteral(quote, fString) != quote) {
fStringBuffer.clear();
@ -2145,6 +2151,8 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
// set starting state
setScannerState(SCANNER_STATE_TEXT_DECL);
//new SymbolTable());
fLimitAnalyzer = new XMLLimitAnalyzer();
}
/**
@ -2164,18 +2172,18 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
*/
private void checkLimit(String entityName, int len) {
if (fLimitAnalyzer == null) {
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
fLimitAnalyzer = new XMLLimitAnalyzer();
}
fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName, len);
if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)) {
fSecurityManager.debugPrint();
if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
reportFatalError("MaxEntitySizeLimit", new Object[]{entityName,
fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT),
fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)});
}
if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)) {
fSecurityManager.debugPrint();
if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
reportFatalError("TotalEntitySizeLimit",
new Object[]{fLimitAnalyzer.getTotalValue(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT),

View File

@ -659,12 +659,12 @@ public class XMLDocumentFragmentScannerImpl
dtdGrammarUtil = null;
if (fSecurityManager != null) {
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT);
} else {
fLimitAnalyzer = null;
fElementAttributeLimit = 0;
}
fLimitAnalyzer = new XMLLimitAnalyzer();
fEntityManager.setLimitAnalyzer(fLimitAnalyzer);
}
/**
@ -3154,16 +3154,16 @@ public class XMLDocumentFragmentScannerImpl
*/
protected void checkLimit(XMLStringBuffer buffer) {
if (fLimitAnalyzer.isTracking(fCurrentEntityName)) {
fLimitAnalyzer.addValue(Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntityName, buffer.length);
if (fSecurityManager.isOverLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT)) {
fSecurityManager.debugPrint();
fLimitAnalyzer.addValue(Limit.GENERAL_ENTITY_SIZE_LIMIT, fCurrentEntityName, buffer.length);
if (fSecurityManager.isOverLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
reportFatalError("MaxEntitySizeLimit", new Object[]{fCurrentEntityName,
fLimitAnalyzer.getValue(Limit.GENEAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getStateLiteral(Limit.GENEAL_ENTITY_SIZE_LIMIT)});
fLimitAnalyzer.getValue(Limit.GENERAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getStateLiteral(Limit.GENERAL_ENTITY_SIZE_LIMIT)});
}
if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT)) {
fSecurityManager.debugPrint();
if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
reportFatalError("TotalEntitySizeLimit",
new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT),

View File

@ -1090,6 +1090,8 @@ public class XMLDocumentScannerImpl
((XMLDTDScannerImpl)fDTDScanner).reset(fPropertyManager);
}
fDTDScanner.setLimitAnalyzer(fLimitAnalyzer);
do {
again = false;
switch (fScannerState) {

View File

@ -1300,8 +1300,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
if(fLimitAnalyzer != null) {
fLimitAnalyzer.addValue(entityExpansionIndex, name, 1);
}
if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex)){
fSecurityManager.debugPrint();
if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex, fLimitAnalyzer)){
fSecurityManager.debugPrint(fLimitAnalyzer);
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimitExceeded",
new Object[]{fSecurityManager.getLimitValueByIndex(entityExpansionIndex)},
XMLErrorReporter.SEVERITY_FATAL_ERROR );
@ -1368,9 +1368,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
//close the reader
try{
if (fLimitAnalyzer != null) {
fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntity.name);
fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, fCurrentEntity.name);
if (fCurrentEntity.name.equals("[xml]")) {
fSecurityManager.debugPrint();
fSecurityManager.debugPrint(fLimitAnalyzer);
}
}
fCurrentEntity.close();
@ -1439,7 +1439,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
// initialize state
//fStandalone = false;
@ -1501,7 +1500,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
fStaxEntityResolver = (StaxEntityResolverWrapper)componentManager.getProperty(STAX_ENTITY_RESOLVER, null);
fValidationManager = (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER, null);
fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER, null);
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
entityExpansionIndex = fSecurityManager.getIndex(Constants.JDK_ENTITY_EXPANSION_LIMIT);
// JAXP 1.5 feature
@ -1659,7 +1657,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() &&
propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) {
fSecurityManager = (XMLSecurityManager)value;
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
}
}
@ -1668,8 +1665,13 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
{
XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value;
fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
}
}
}
public void setLimitAnalyzer(XMLLimitAnalyzer fLimitAnalyzer) {
this.fLimitAnalyzer = fLimitAnalyzer;
}
/**
* Returns a list of property identifiers that are recognized by
* this component. This method may return null if no properties

View File

@ -77,7 +77,6 @@ public final class XMLLimitAnalyzer {
}
}
private XMLSecurityManager securityManager;
/**
* Max value accumulated for each property
*/
@ -101,8 +100,7 @@ public final class XMLLimitAnalyzer {
* Default constructor. Establishes default values for known security
* vulnerabilities.
*/
public XMLLimitAnalyzer(XMLSecurityManager securityManager) {
this.securityManager = securityManager;
public XMLLimitAnalyzer() {
values = new int[Limit.values().length];
totalValue = new int[Limit.values().length];
names = new String[Limit.values().length];
@ -157,7 +155,7 @@ public final class XMLLimitAnalyzer {
}
if (index == Limit.GENEAL_ENTITY_SIZE_LIMIT.ordinal() ||
if (index == Limit.GENERAL_ENTITY_SIZE_LIMIT.ordinal() ||
index == Limit.PARAMETER_ENTITY_SIZE_LIMIT.ordinal()) {
totalValue[Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()] += value;
}
@ -221,7 +219,7 @@ public final class XMLLimitAnalyzer {
}
}
public void debugPrint() {
public void debugPrint(XMLSecurityManager securityManager) {
Formatter formatter = new Formatter();
System.out.println(formatter.format("%30s %15s %15s %15s %30s",
"Property","Limit","Total size","Size","Entity Name"));

View File

@ -65,7 +65,7 @@ public final class XMLSecurityManager {
MAX_OCCUR_NODE_LIMIT(Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000),
ELEMENT_ATTRIBUTE_LIMIT(Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000),
TOTAL_ENTITY_SIZE_LIMIT(Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000),
GENEAL_ENTITY_SIZE_LIMIT(Constants.JDK_GENEAL_ENTITY_SIZE_LIMIT, Constants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0),
GENERAL_ENTITY_SIZE_LIMIT(Constants.JDK_GENERAL_ENTITY_SIZE_LIMIT, Constants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0),
PARAMETER_ENTITY_SIZE_LIMIT(Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000);
final String apiProperty;
@ -148,7 +148,6 @@ public final class XMLSecurityManager {
private boolean[] isSet;
private XMLLimitAnalyzer limitAnalyzer;
/**
* Index of the special entityCountInfo property
*/
@ -169,7 +168,6 @@ public final class XMLSecurityManager {
* @param secureProcessing
*/
public XMLSecurityManager(boolean secureProcessing) {
limitAnalyzer = new XMLLimitAnalyzer(this);
values = new int[Limit.values().length];
states = new State[Limit.values().length];
isSet = new boolean[Limit.values().length];
@ -249,13 +247,15 @@ public final class XMLSecurityManager {
if (index == indexEntityCountInfo) {
printEntityCountInfo = (String)value;
} else {
int temp = 0;
try {
int temp;
if (Integer.class.isAssignableFrom(value.getClass())) {
temp = ((Integer)value).intValue();
} else {
temp = Integer.parseInt((String) value);
if (temp < 0) {
temp = 0;
}
} catch (NumberFormatException e) {}
}
setLimit(index, state, temp);
}
}
@ -387,8 +387,9 @@ public final class XMLSecurityManager {
* @param size the size (count or length) of the entity
* @return true if the size is over the limit, false otherwise
*/
public boolean isOverLimit(Limit limit, String entityName, int size) {
return isOverLimit(limit.ordinal(), entityName, size);
public boolean isOverLimit(Limit limit, String entityName, int size,
XMLLimitAnalyzer limitAnalyzer) {
return isOverLimit(limit.ordinal(), entityName, size, limitAnalyzer);
}
/**
@ -400,7 +401,8 @@ public final class XMLSecurityManager {
* @param size the size (count or length) of the entity
* @return true if the size is over the limit, false otherwise
*/
public boolean isOverLimit(int index, String entityName, int size) {
public boolean isOverLimit(int index, String entityName, int size,
XMLLimitAnalyzer limitAnalyzer) {
if (values[index] == NO_LIMIT) {
return false;
}
@ -418,11 +420,11 @@ public final class XMLSecurityManager {
* @param size the size (count or length) of the entity
* @return true if the size is over the limit, false otherwise
*/
public boolean isOverLimit(Limit limit) {
return isOverLimit(limit.ordinal());
public boolean isOverLimit(Limit limit, XMLLimitAnalyzer limitAnalyzer) {
return isOverLimit(limit.ordinal(), limitAnalyzer);
}
public boolean isOverLimit(int index) {
public boolean isOverLimit(int index, XMLLimitAnalyzer limitAnalyzer) {
if (values[index] == NO_LIMIT) {
return false;
}
@ -436,29 +438,12 @@ public final class XMLSecurityManager {
}
}
public void debugPrint() {
public void debugPrint(XMLLimitAnalyzer limitAnalyzer) {
if (printEntityCountInfo.equals(Constants.JDK_YES)) {
limitAnalyzer.debugPrint();
limitAnalyzer.debugPrint(this);
}
}
/**
* Return the limit analyzer
*
* @return the limit analyzer
*/
public XMLLimitAnalyzer getLimitAnalyzer() {
return limitAnalyzer;
}
/**
* Set limit analyzer
*
* @param analyzer a limit analyzer
*/
public void setLimitAnalyzer(XMLLimitAnalyzer analyzer) {
limitAnalyzer = analyzer;
}
/**
* Indicate if a property is set explicitly

View File

@ -20,6 +20,7 @@
package com.sun.org.apache.xerces.internal.xni.parser;
import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
import java.io.IOException;
import com.sun.org.apache.xerces.internal.xni.XNIException;
@ -95,4 +96,5 @@ public interface XMLDTDScanner
public boolean scanDTDExternalSubset(boolean complete)
throws IOException, XNIException;
public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer);
} // interface XMLDTDScanner

View File

@ -24,20 +24,17 @@
package com.sun.org.apache.xml.internal.resolver;
import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
import com.sun.org.apache.xml.internal.resolver.helpers.BootstrapResolver;
import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
import java.io.InputStream;
import java.net.URL;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.Vector;
import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
import com.sun.org.apache.xml.internal.resolver.helpers.BootstrapResolver;
import com.sun.org.apache.xml.internal.resolver.Catalog;
import sun.reflect.misc.ReflectUtil;
/**
* CatalogManager provides an interface to the catalog properties.
@ -687,7 +684,7 @@ public class CatalogManager {
catalog = new Catalog();
} else {
try {
catalog = (Catalog) Class.forName(catalogClassName).newInstance();
catalog = (Catalog) ReflectUtil.forName(catalogClassName).newInstance();
} catch (ClassNotFoundException cnfe) {
debug.message(1,"Catalog class named '"
+ catalogClassName

View File

@ -23,24 +23,21 @@
package com.sun.org.apache.xml.internal.resolver.readers;
import java.util.Hashtable;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.MalformedURLException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import com.sun.org.apache.xml.internal.resolver.Catalog;
import com.sun.org.apache.xml.internal.resolver.CatalogException;
import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader;
import com.sun.org.apache.xml.internal.resolver.helpers.Namespaces;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Hashtable;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import sun.reflect.misc.ReflectUtil;
/**
* A DOM-based CatalogReader.
@ -199,7 +196,7 @@ public class DOMCatalogReader implements CatalogReader {
DOMCatalogParser domParser = null;
try {
domParser = (DOMCatalogParser) Class.forName(domParserClass).newInstance();
domParser = (DOMCatalogParser) ReflectUtil.forName(domParserClass).newInstance();
} catch (ClassNotFoundException cnfe) {
catalog.getCatalogManager().debug.message(1, "Cannot load XML Catalog Parser class", domParserClass);
throw new CatalogException(CatalogException.UNPARSEABLE);

View File

@ -23,19 +23,21 @@
package com.sun.org.apache.xml.internal.resolver.readers;
import java.util.Hashtable;
import java.io.IOException;
import com.sun.org.apache.xml.internal.resolver.Catalog;
import com.sun.org.apache.xml.internal.resolver.CatalogException;
import com.sun.org.apache.xml.internal.resolver.CatalogManager;
import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.MalformedURLException;
import java.net.UnknownHostException;
import java.util.Hashtable;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.AttributeList;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
@ -45,12 +47,7 @@ import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.Parser;
import org.xml.sax.SAXException;
import com.sun.org.apache.xml.internal.resolver.Catalog;
import com.sun.org.apache.xml.internal.resolver.CatalogManager;
import com.sun.org.apache.xml.internal.resolver.CatalogException;
import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader;
import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
import sun.reflect.misc.ReflectUtil;
/**
* A SAX-based CatalogReader.
@ -246,7 +243,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document
}
parser.parse(new InputSource(is), spHandler);
} else {
Parser parser = (Parser) Class.forName(parserClass).newInstance();
Parser parser = (Parser) ReflectUtil.forName(parserClass).newInstance();
parser.setDocumentHandler(this);
if (bResolver != null) {
parser.setEntityResolver(bResolver);
@ -352,7 +349,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document
try {
saxParser = (SAXCatalogParser)
Class.forName(saxParserClass).newInstance();
ReflectUtil.forName(saxParserClass).newInstance();
saxParser.setCatalog(catalog);
saxParser.startDocument();
@ -413,7 +410,7 @@ public class SAXCatalogReader implements CatalogReader, ContentHandler, Document
try {
saxParser = (SAXCatalogParser)
Class.forName(saxParserClass).newInstance();
ReflectUtil.forName(saxParserClass).newInstance();
saxParser.setCatalog(catalog);
saxParser.startDocument();

View File

@ -242,4 +242,8 @@ fe56ba456fd32758c72db629938d69067468d89c jdk8-b117
76a598cf50c4e1dc1fc8adc08b451943aa1a3179 jdk8-b118
172b8e056ff259044ca48c5425d643dc8e2e05c8 jdk8-b119
6c152deb600d8a11bc46149ace317b1c9fce1482 jdk8-b120
32050ab53c8a8e4cb09f04b88db78258a480fb61 jdk8-b121
bc622ba563f9316f981c11c3a260f4c3fdc5ef07 jdk8-b122
91f5c542ccad330efc0d281362dd6f33f2039746 jdk8-b123
32050ab53c8a8e4cb09f04b88db78258a480fb61 jdk9-b00
9c9fabbcd3d526d7ca29165169155f49a107533a jdk9-b01

View File

@ -65,7 +65,7 @@ import java.util.Map;
*
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
public class ApNavigator implements Navigator<TypeMirror, TypeElement, VariableElement, ExecutableElement> {
public final class ApNavigator implements Navigator<TypeMirror, TypeElement, VariableElement, ExecutableElement> {
private final ProcessingEnvironment env;
@ -236,7 +236,7 @@ public class ApNavigator implements Navigator<TypeMirror, TypeElement, VariableE
}
public boolean isFinal(TypeElement clazz) {
return hasModifier(clazz,Modifier.FINAL);
return hasModifier(clazz, Modifier.FINAL);
}
public VariableElement[] getEnumConstants(TypeElement clazz) {
@ -258,8 +258,9 @@ public class ApNavigator implements Navigator<TypeMirror, TypeElement, VariableE
return env.getElementUtils().getPackageOf(clazz).getQualifiedName().toString();
}
public TypeElement findClass(String className, TypeElement referencePoint) {
return env.getElementUtils().getTypeElement(className);
@Override
public TypeElement loadObjectFactory(TypeElement referencePoint, String packageName) {
return env.getElementUtils().getTypeElement(packageName + ".ObjectFactory");
}
public boolean isBridgeMethod(ExecutableElement method) {

View File

@ -30,7 +30,6 @@ import java.lang.reflect.Type;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
/**
* @author Kohsuke Kawaguchi
@ -69,6 +68,6 @@ class EagerNType implements NType {
}
public String fullName() {
return Navigator.REFLECTION.getTypeName(t);
return Utils.REFLECTION_NAVIGATOR.getTypeName(t);
}
}

View File

@ -56,7 +56,7 @@ public final class NavigatorImpl implements Navigator<NType,NClass,Void,Void> {
EagerNType ent = (EagerNType) nt;
if (base instanceof EagerNClass) {
EagerNClass enc = (EagerNClass) base;
return create(REFLECTION.getBaseClass(ent.t, enc.c));
return create(Utils.REFLECTION_NAVIGATOR.getBaseClass(ent.t, enc.c));
}
// lazy class can never be a base type of an eager type
return null;
@ -176,7 +176,7 @@ public final class NavigatorImpl implements Navigator<NType,NClass,Void,Void> {
public NType getTypeArgument(NType nt, int i) {
if (nt instanceof EagerNType) {
EagerNType ent = (EagerNType) nt;
return create(REFLECTION.getTypeArgument(ent.t,i));
return create(Utils.REFLECTION_NAVIGATOR.getTypeArgument(ent.t,i));
}
if (nt instanceof NClassByJClass) {
NClassByJClass nnt = (NClassByJClass) nt;
@ -189,7 +189,7 @@ public final class NavigatorImpl implements Navigator<NType,NClass,Void,Void> {
public boolean isParameterizedType(NType nt) {
if (nt instanceof EagerNType) {
EagerNType ent = (EagerNType) nt;
return REFLECTION.isParameterizedType(ent.t);
return Utils.REFLECTION_NAVIGATOR.isParameterizedType(ent.t);
}
if (nt instanceof NClassByJClass) {
NClassByJClass nnt = (NClassByJClass) nt;
@ -304,8 +304,8 @@ public final class NavigatorImpl implements Navigator<NType,NClass,Void,Void> {
throw new UnsupportedOperationException();
}
public NClass findClass(String className, NClass referencePoint) {
// TODO: implement this method later
@Override
public NClass loadObjectFactory(NClass referencePoint, String pkg) {
throw new UnsupportedOperationException();
}

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.xjc.model.nav;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -45,7 +45,6 @@ import com.sun.istack.internal.Nullable;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import com.sun.xml.internal.bind.v2.ContextFactory;
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet;
import java.util.HashMap;
@ -417,7 +416,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @since 2.0 FCS
*/
public static @Nullable Type getBaseType(@NotNull Type type, @NotNull Class baseType) {
return Navigator.REFLECTION.getBaseClass(type,baseType);
return Utils.REFLECTION_NAVIGATOR.getBaseClass(type, baseType);
}
/**

View File

@ -32,8 +32,6 @@ import java.util.Collection;
import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
/**
* A reference to a JAXB-bound type.
*
@ -105,12 +103,11 @@ public final class TypeReference {
// if we are to reinstitute this check, check JAXB annotations only
// assert annotations.length==0; // not designed to work with adapters.
Type base = Navigator.REFLECTION.getBaseClass(type, Collection.class);
Type base = Utils.REFLECTION_NAVIGATOR.getBaseClass(type, Collection.class);
if(base==null)
return this; // not a collection
return new TypeReference(tagName,
Navigator.REFLECTION.getTypeArgument(base,0));
return new TypeReference(tagName, Utils.REFLECTION_NAVIGATOR.getTypeArgument(base,0));
}
@Override

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.bind.api;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -289,23 +289,12 @@ public class ModelBuilder<T,C,F,M> implements ModelBuilderI<T,C,F,M> {
String pkg = nav.getPackageName(clazz);
if (!registries.containsKey(pkg)) {
// insert the package's object factory
C c = loadObjectFactory(clazz, pkg);
C c = nav.loadObjectFactory(clazz, pkg);
if (c != null)
addRegistry(c, p);
}
}
private C loadObjectFactory(C clazz, String pkg) {
C c;
try {
c = nav.findClass(pkg + ".ObjectFactory", clazz);
} catch (SecurityException ignored) {
// treat SecurityException in same way as ClassNotFoundException in this case
c = null;
}
return c;
}
/**
* Getting parametrized classes of {@code JAXBElement<...>} property
* @param p property which parametrized types we will try to get

View File

@ -36,7 +36,7 @@ import com.sun.xml.internal.bind.v2.runtime.Transducer;
*/
final class RuntimeAnyTypeImpl extends AnyTypeImpl<Type,Class> implements RuntimeNonElement {
private RuntimeAnyTypeImpl() {
super(Navigator.REFLECTION);
super(Utils.REFLECTION_NAVIGATOR);
}
public <V> Transducer<V> getTransducer() {

View File

@ -91,9 +91,6 @@ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
import com.sun.xml.internal.bind.v2.util.ByteArrayOutputStreamEx;
import com.sun.xml.internal.bind.v2.util.DataSourceSource;
import java.util.logging.Logger;
import com.sun.xml.internal.bind.Util;
import java.util.logging.Level;
import org.xml.sax.SAXException;
@ -108,8 +105,6 @@ import org.xml.sax.SAXException;
public abstract class RuntimeBuiltinLeafInfoImpl<T> extends BuiltinLeafInfoImpl<Type,Class>
implements RuntimeBuiltinLeafInfo, Transducer<T> {
private static final Logger logger = Util.getClassLogger();
private RuntimeBuiltinLeafInfoImpl(Class type, QName... typeNames) {
super(type, typeNames);
LEAVES.put(type,this);
@ -201,7 +196,6 @@ public abstract class RuntimeBuiltinLeafInfoImpl<T> extends BuiltinLeafInfoImpl<
public static final List<RuntimeBuiltinLeafInfoImpl<?>> builtinBeanInfos;
public static final String MAP_ANYURI_TO_URI = "mapAnyUriToUri";
public static final String USE_OLD_GMONTH_MAPPING = "jaxb.ri.useOldGmonthMapping";
static {
@ -966,14 +960,7 @@ public abstract class RuntimeBuiltinLeafInfoImpl<T> extends BuiltinLeafInfoImpl<
m.put(DatatypeConstants.DATETIME, "%Y-%M-%DT%h:%m:%s"+ "%z");
m.put(DatatypeConstants.DATE, "%Y-%M-%D" +"%z");
m.put(DatatypeConstants.TIME, "%h:%m:%s"+ "%z");
if (System.getProperty(USE_OLD_GMONTH_MAPPING) == null) {
m.put(DatatypeConstants.GMONTH, "--%M%z"); // E2-12 Error. http://www.w3.org/2001/05/xmlschema-errata#e2-12
} else { // backw. compatibility
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "Old GMonth mapping used.");
}
m.put(DatatypeConstants.GMONTH, "--%M--%z");
}
m.put(DatatypeConstants.GMONTH, "--%M--%z");
m.put(DatatypeConstants.GDAY, "---%D" + "%z");
m.put(DatatypeConstants.GYEAR, "%Y" + "%z");
m.put(DatatypeConstants.GYEARMONTH, "%Y-%M" + "%z");

View File

@ -42,7 +42,6 @@ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementPropertyInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeRef;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
import com.sun.xml.internal.bind.v2.runtime.Transducer;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
@ -122,7 +121,8 @@ final class RuntimeElementInfoImpl extends ElementInfoImpl<Type,Class,Field,Meth
}
public Class<? extends JAXBElement> getType() {
return Navigator.REFLECTION.erasure(super.getType());
//noinspection unchecked
return (Class<? extends JAXBElement>) Utils.REFLECTION_NAVIGATOR.erasure(super.getType());
}
public RuntimeClassInfo getScope() {

View File

@ -38,7 +38,6 @@ import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
import com.sun.xml.internal.bind.v2.model.core.ID;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElementRef;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
@ -75,7 +74,7 @@ public class RuntimeModelBuilder extends ModelBuilder<Type,Class,Field,Method> {
public final @Nullable JAXBContextImpl context;
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
super(annotationReader, Navigator.REFLECTION, subclassReplacements, defaultNamespaceRemap);
super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap);
this.context = context;
}
@ -109,10 +108,6 @@ public class RuntimeModelBuilder extends ModelBuilder<Type,Class,Field,Method> {
return new RuntimeArrayInfoImpl(this, upstream, (Class)arrayType);
}
public ReflectionNavigator getNavigator() {
return (ReflectionNavigator)nav;
}
@Override
protected RuntimeTypeInfoSetImpl createTypeInfoSet() {
return new RuntimeTypeInfoSetImpl(reader);

View File

@ -35,7 +35,6 @@ import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet;
@ -46,7 +45,7 @@ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet;
*/
final class RuntimeTypeInfoSetImpl extends TypeInfoSetImpl<Type,Class,Field,Method> implements RuntimeTypeInfoSet {
public RuntimeTypeInfoSetImpl(AnnotationReader<Type,Class,Field,Method> reader) {
super(Navigator.REFLECTION,reader,RuntimeBuiltinLeafInfoImpl.LEAVES);
super(Utils.REFLECTION_NAVIGATOR,reader,RuntimeBuiltinLeafInfoImpl.LEAVES);
}
@Override
@ -54,10 +53,6 @@ final class RuntimeTypeInfoSetImpl extends TypeInfoSetImpl<Type,Class,Field,Meth
return RuntimeAnyTypeImpl.theInstance;
}
public ReflectionNavigator getNavigator() {
return (ReflectionNavigator)super.getNavigator();
}
public RuntimeNonElement getTypeInfo( Type type ) {
return (RuntimeNonElement)super.getTypeInfo(type);
}

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.bind.v2.model.impl;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -25,6 +25,10 @@
package com.sun.xml.internal.bind.v2.model.nav;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.util.Collection;
import com.sun.xml.internal.bind.v2.runtime.Location;
@ -240,10 +244,6 @@ public interface Navigator<T,C,F,M> {
*/
T getComponentType(T t);
/** The singleton instance. */
public static final ReflectionNavigator REFLECTION = new ReflectionNavigator();
/**
* Gets the i-th type argument from a parameterized type.
*
@ -357,14 +357,14 @@ public interface Navigator<T,C,F,M> {
String getPackageName(C clazz);
/**
* Finds the class/interface/enum/annotation of the given name.
* Finds ObjectFactory for the given referencePoint.
*
* @param referencePoint
* The class that refers to the specified class.
* @return
* null if not found.
*/
C findClass(String className, C referencePoint);
C loadObjectFactory(C referencePoint, String packageName);
/**
* Returns true if this method is a bridge method as defined in JLS.

View File

@ -44,16 +44,19 @@ import com.sun.xml.internal.bind.v2.runtime.Location;
* {@link Navigator} implementation for {@code java.lang.reflect}.
*
*/
public final class ReflectionNavigator implements Navigator<Type, Class, Field, Method> {
/*package*/final class ReflectionNavigator implements Navigator<Type, Class, Field, Method> {
/**
* Singleton.
*
* Use {@link Navigator#REFLECTION}
*/
ReflectionNavigator() {
// ---------- Singleton -----------------
private static final ReflectionNavigator INSTANCE = new ReflectionNavigator();
/*package*/static ReflectionNavigator getInstance() {
return INSTANCE;
}
private ReflectionNavigator() {
}
// ---------------------------------------
public Class getSuperClass(Class clazz) {
if (clazz == Object.class) {
return null;
@ -64,6 +67,7 @@ public final class ReflectionNavigator implements Navigator<Type, Class, Field,
}
return sc;
}
private static final TypeVisitor<Type, Class> baseClassFinder = new TypeVisitor<Type, Class>() {
public Type onClass(Class c, Class sup) {
@ -496,7 +500,7 @@ public final class ReflectionNavigator implements Navigator<Type, Class, Field,
c.getDeclaredConstructor();
return true;
} catch (NoSuchMethodException e) {
return false;
return false; // todo: do this WITHOUT exception throw
}
}
@ -544,13 +548,14 @@ public final class ReflectionNavigator implements Navigator<Type, Class, Field,
}
}
public Class findClass(String className, Class referencePoint) {
@Override
public Class loadObjectFactory(Class referencePoint, String pkg) {
ClassLoader cl= SecureLoader.getClassClassLoader(referencePoint);
if (cl == null)
cl = SecureLoader.getSystemClassLoader();
try {
ClassLoader cl = SecureLoader.getClassClassLoader(referencePoint);
if (cl == null) {
cl = SecureLoader.getSystemClassLoader();
}
return cl.loadClass(className);
return cl.loadClass(pkg + ".ObjectFactory");
} catch (ClassNotFoundException e) {
return null;
}

View File

@ -33,7 +33,6 @@ import java.util.Map;
import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
/**
* {@link TypeInfoSet} refined for runtime.
@ -51,5 +50,4 @@ public interface RuntimeTypeInfoSet extends TypeInfoSet<Type,Class,Field,Method>
RuntimeElementInfo getElementInfo( Class scope, QName name );
Map<QName,? extends RuntimeElementInfo> getElementMappings( Class scope );
Iterable<? extends RuntimeElementInfo> getAllElements();
ReflectionNavigator getNavigator();
}

View File

@ -48,7 +48,6 @@ import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.ClassFactory;
import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.core.ID;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeClassInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty;
@ -347,7 +346,7 @@ public final class ClassBeanInfoImpl<BeanT> extends JaxBeanInfo<BeanT> implement
} else if (isThereAnOverridingProperty) {
// need to double check the override - it should be safe to do after the model has been created because it's targeted to override properties only
Class beanClass = bean.getClass();
if (Navigator.REFLECTION.getDeclaredField(beanClass, p.getFieldName()) == null) {
if (Utils.REFLECTION_NAVIGATOR.getDeclaredField(beanClass, p.getFieldName()) == null) {
p.serializeBody(bean, target, null);
}
}

View File

@ -36,7 +36,6 @@ import javax.xml.stream.XMLStreamException;
import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.property.Property;
@ -81,10 +80,10 @@ public final class ElementBeanInfoImpl extends JaxBeanInfo<JAXBElement> {
this.property = PropertyFactory.create(grammar,rei.getProperty());
tagName = rei.getElementName();
expectedType = Navigator.REFLECTION.erasure(rei.getContentInMemoryType());
expectedType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(rei.getContentInMemoryType());
scope = rei.getScope()==null ? JAXBElement.GlobalScope.class : rei.getScope().getClazz();
Class type = Navigator.REFLECTION.erasure(rei.getType());
Class type = (Class) Utils.REFLECTION_NAVIGATOR.erasure(rei.getType());
if(type==JAXBElement.class)
constructor = null;
else {

View File

@ -65,7 +65,6 @@ import javax.xml.transform.Result;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
@ -90,7 +89,6 @@ import com.sun.xml.internal.bind.v2.model.core.Ref;
import com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl;
import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeArrayInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeBuiltinLeafInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeClassInfo;
@ -118,7 +116,6 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
* This class provides the implementation of JAXBContext.
@ -363,7 +360,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
beanInfoMap.put( e.getKey(), beanInfoMap.get(e.getValue()) );
// build bridges
ReflectionNavigator nav = typeSet.getNavigator();
Navigator<Type, Class, Field, Method> nav = typeSet.getNavigator();
for (TypeReference tr : typeRefs) {
XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class);
@ -371,7 +368,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
XmlList xl = tr.get(XmlList.class);
// eventually compute the in-memory type
Class erasedType = nav.erasure(tr.type);
Class erasedType = (Class) nav.erasure(tr.type);
if(xjta!=null) {
a = new Adapter<Type,Class>(xjta.value(),nav);
@ -382,7 +379,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
}
if(a!=null) {
erasedType = nav.erasure(a.defaultType);
erasedType = (Class) nav.erasure(a.defaultType);
}
Name name = nameBuilder.createElementName(tr.tagName);
@ -877,7 +874,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
// this is a special class we introduced for JAX-WS that we *don't* want in the schema
} else {
NonElement<Type,Class> typeInfo = getXmlType(tis,tr);
xsdgen.add(tr.tagName, !Navigator.REFLECTION.isPrimitive(tr.type),typeInfo);
xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo);
}
}
return xsdgen;

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.bind.v2.runtime;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -27,7 +27,6 @@ package com.sun.xml.internal.bind.v2.runtime.property;
import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
@ -49,7 +48,7 @@ abstract class ArrayProperty<BeanT,ListT,ItemT> extends PropertyImpl<BeanT> {
assert prop.isCollection();
lister = Lister.create(
Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
assert lister!=null;
acc = prop.getAccessor().optimize(context);
assert acc!=null;

View File

@ -42,7 +42,6 @@ import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.ClassFactory;
import com.sun.xml.internal.bind.v2.util.QNameMap;
import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeMapPropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
@ -98,7 +97,8 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
this.valueBeanInfo = context.getOrCreate(prop.getValueType());
// infer the implementation class
Class<ValueT> sig = ReflectionNavigator.REFLECTION.erasure(prop.getRawType());
//noinspection unchecked
Class<ValueT> sig = (Class<ValueT>) Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType());
mapImplClass = ClassFactory.inferImplClass(sig,knownImplClasses);
// TODO: error check for mapImplClass==null
// what is the error reporting path for this part of the code?
@ -140,23 +140,22 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
*/
private final Loader itemsLoader = new Loader(false) {
private ThreadLocal<Stack<BeanT>> target = new ThreadLocal<Stack<BeanT>>();
private ThreadLocal<Stack<ValueT>> map = new ThreadLocal<Stack<ValueT>>();
private ThreadLocal<BeanT> target = new ThreadLocal<BeanT>();
private ThreadLocal<ValueT> map = new ThreadLocal<ValueT>();
private int depthCounter = 0; // needed to clean ThreadLocals
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
// create or obtain the Map object
try {
BeanT target = (BeanT) state.prev.target;
ValueT mapValue = acc.get(target);
if(mapValue == null)
mapValue = ClassFactory.create(mapImplClass);
else
mapValue.clear();
Stack.push(this.target, target);
Stack.push(map, mapValue);
state.target = mapValue;
target.set((BeanT)state.prev.target);
map.set(acc.get(target.get()));
depthCounter++;
if(map.get() == null) {
map.set(ClassFactory.create(mapImplClass));
}
map.get().clear();
state.target = map.get();
} catch (AccessorException e) {
// recover from error by setting a dummy Map that receives and discards the values
handleGenericException(e,true);
@ -168,7 +167,11 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
public void leaveElement(State state, TagName ea) throws SAXException {
super.leaveElement(state, ea);
try {
acc.set(Stack.pop(target), Stack.pop(map));
acc.set(target.get(), map.get());
if (--depthCounter == 0) {
target.remove();
map.remove();
}
} catch (AccessorException ex) {
handleGenericException(ex,true);
}
@ -286,36 +289,4 @@ final class SingleMapNodeProperty<BeanT,ValueT extends Map> extends PropertyImpl
return acc;
return null;
}
private static final class Stack<T> {
private Stack<T> parent;
private T value;
private Stack(Stack<T> parent, T value) {
this.parent = parent;
this.value = value;
}
private Stack(T value) {
this.value = value;
}
private static <T> void push(ThreadLocal<Stack<T>> holder, T value) {
Stack<T> parent = holder.get();
if (parent == null)
holder.set(new Stack<T>(value));
else
holder.set(new Stack<T>(parent, value));
}
private static <T> T pop(ThreadLocal<Stack<T>> holder) {
Stack<T> current = holder.get();
if (current.parent == null)
holder.remove();
else
holder.set(current.parent);
return current.value;
}
}
}

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.bind.v2.runtime.property;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -46,7 +46,6 @@ import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.api.JAXBRIContext;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
@ -198,7 +197,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
public final <T> Accessor<BeanT, T> adapt(Adapter<Type, Class> adapter) {
return new AdaptedAccessor<BeanT, ValueT, T>(
(Class<T>) Navigator.REFLECTION.erasure(adapter.defaultType),
(Class<T>) Utils.REFLECTION_NAVIGATOR.erasure(adapter.defaultType),
this,
adapter.adapterType);
}

View File

@ -51,7 +51,6 @@ import com.sun.xml.internal.bind.v2.ClassFactory;
import com.sun.xml.internal.bind.v2.TODO;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
import com.sun.xml.internal.bind.v2.model.core.ID;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Patcher;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
@ -116,7 +115,7 @@ public abstract class Lister<BeanT,PropT,ItemT,PackT> {
public static <BeanT,PropT,ItemT,PackT>
Lister<BeanT,PropT,ItemT,PackT> create(Type fieldType,ID idness, Adapter<Type,Class> adapter) {
Class rawType = Navigator.REFLECTION.erasure(fieldType);
Class rawType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(fieldType);
Class itemType;
Lister l;
@ -125,9 +124,9 @@ public abstract class Lister<BeanT,PropT,ItemT,PackT> {
l = getArrayLister(itemType);
} else
if( Collection.class.isAssignableFrom(rawType) ) {
Type bt = Navigator.REFLECTION.getBaseClass(fieldType,Collection.class);
Type bt = Utils.REFLECTION_NAVIGATOR.getBaseClass(fieldType,Collection.class);
if(bt instanceof ParameterizedType)
itemType = Navigator.REFLECTION.erasure(((ParameterizedType)bt).getActualTypeArguments()[0]);
itemType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)bt).getActualTypeArguments()[0]);
else
itemType = Object.class;
l = new CollectionLister(getImplClass(rawType));

View File

@ -39,7 +39,6 @@ import com.sun.xml.internal.bind.WhiteSpaceProcessor;
import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.model.core.ID;
import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElementRef;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.Name;
@ -144,8 +143,7 @@ public abstract class TransducedAccessor<BeanT> {
if(prop.isCollection()) {
return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),
prop.getAdapter()));
Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
}
if(prop.id()==ID.IDREF)

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.xml.internal.bind.v2.runtime.reflect;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Utils class.
* Has *package private* access to avoid inappropriate usage.
*/
/* package */ final class Utils {
private static final Logger LOGGER = Logger.getLogger(Utils.class.getName());
/**
* static ReflectionNavigator field to avoid usage of reflection every time we use it.
*/
/* package */ static final Navigator<Type, Class, Field, Method> REFLECTION_NAVIGATOR;
static { // we statically initializing REFLECTION_NAVIGATOR property
Class refNav = null;
try {
refNav = Class.forName("com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator");
//noinspection unchecked
Method getInstance = refNav.getDeclaredMethod("getInstance");
getInstance.setAccessible(true);
//noinspection unchecked
REFLECTION_NAVIGATOR = (Navigator<Type, Class, Field, Method>) getInstance.invoke(null);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalStateException("Can't find ReflectionNavigator class");
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance throws the exception");
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance can't be found");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new IllegalStateException("ReflectionNavigator.getInstance method is inaccessible");
} catch (SecurityException e) {
LOGGER.log(Level.FINE, "Unable to access ReflectionNavigator.getInstance", e);
throw e;
}
}
/**
* private constructor to avoid util class instantiating
*/
private Utils() {
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, 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
@ -58,6 +58,12 @@ import javax.xml.ws.soap.SOAPFaultException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.ReflectPermission;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.Permissions;
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
@ -556,11 +562,40 @@ public abstract class SOAPFaultBuilder {
// ignore
}
captureStackTrace = tmpVal;
JAXB_CONTEXT = createJAXBContext();
}
try {
JAXB_CONTEXT = JAXBContext.newInstance(SOAP11Fault.class, SOAP12Fault.class);
} catch (JAXBException e) {
throw new Error(e); // this must be a bug in our code
private static JAXBContext createJAXBContext() {
// in jdk runtime doPrivileged is necessary since JAX-WS internal classes are in restricted packages
if (isJDKRuntime()) {
Permissions permissions = new Permissions();
permissions.add(new RuntimePermission("accessClassInPackage.com.sun." + "xml.internal.ws.fault"));
permissions.add(new ReflectPermission("suppressAccessChecks"));
return AccessController.doPrivileged(
new PrivilegedAction<JAXBContext>() {
@Override
public JAXBContext run() {
try {
return JAXBContext.newInstance(SOAP11Fault.class, SOAP12Fault.class);
} catch (JAXBException e) {
throw new Error(e);
}
}
},
new AccessControlContext(new ProtectionDomain[]{new ProtectionDomain(null, permissions)})
);
} else {
try {
return JAXBContext.newInstance(SOAP11Fault.class, SOAP12Fault.class);
} catch (JAXBException e) {
throw new Error(e);
}
}
}
private static boolean isJDKRuntime() {
return SOAPFaultBuilder.class.getName().contains("internal");
}
}

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