mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
Merge
This commit is contained in:
commit
2bd7efd60e
438 changed files with 10176 additions and 2121 deletions
1
.hgtags
1
.hgtags
|
@ -287,3 +287,4 @@ b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37
|
|||
3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42
|
||||
6494b13f88a867026ee316b444d9a4fa589dd6bd jdk9-b43
|
||||
abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44
|
||||
bfc24ae2b900187585079bb11e66e459d1e525fe jdk9-b45
|
||||
|
|
|
@ -287,3 +287,4 @@ cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
|
|||
f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42
|
||||
02ee8c65622e8bd97496d584e22fc7dcf0edc4ae jdk9-b43
|
||||
8994f5d87b3bb5e8d317d4e8ccb326da1a73684a jdk9-b44
|
||||
3dd628fde2086218d548841022ee8436b6b88185 jdk9-b45
|
||||
|
|
7
Makefile
7
Makefile
|
@ -54,8 +54,11 @@ ifneq ($(findstring qp,$(MAKEFLAGS)),)
|
|||
# Duplication of global targets, needed before ParseConfAndSpec in case we have
|
||||
# no configurations.
|
||||
help:
|
||||
# If CONF is not set, look for all available configurations
|
||||
CONF?=
|
||||
# If both CONF and SPEC are unset, look for all available configurations by
|
||||
# setting CONF to the empty string.
|
||||
ifeq ($(SPEC), )
|
||||
CONF?=
|
||||
endif
|
||||
endif
|
||||
|
||||
# ... and then we can include our helper functions
|
||||
|
|
|
@ -4329,7 +4329,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
|||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1418395009
|
||||
DATE_WHEN_GENERATED=1420811523
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
@ -27408,8 +27408,8 @@ $as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;}
|
|||
# The trailing space for everyone except PATH is no typo, but is needed due
|
||||
# to trailing \ in the Windows paths. These will be stripped later.
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
|
|
|
@ -690,10 +690,15 @@ OS_VERSION_MICRO:=@OS_VERSION_MICRO@
|
|||
# Images directory definitions
|
||||
JDK_IMAGE_SUBDIR:=jdk
|
||||
JRE_IMAGE_SUBDIR:=jre
|
||||
|
||||
# Colon left out to be able to override output dir for bootcycle-images
|
||||
JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
|
||||
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
|
||||
|
||||
# Test image, as above
|
||||
TEST_IMAGE_SUBDIR:=test
|
||||
TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
|
||||
|
||||
# Macosx bundles directory definitions
|
||||
JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
|
||||
JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
|
||||
|
|
|
@ -173,8 +173,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
|||
# The trailing space for everyone except PATH is no typo, but is needed due
|
||||
# to trailing \ in the Windows paths. These will be stripped later.
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
|
|
|
@ -26,10 +26,8 @@ corba/src/java.corba/share/classes/com/sun/org/omg : corba/src/share/classes/com
|
|||
corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl : corba/src/share/classes/com/sun/tools/corba/se/idl
|
||||
corba/src/java.corba/share/classes/javax/activity : corba/src/share/classes/javax/activity
|
||||
corba/src/java.corba/share/classes/javax/rmi : corba/src/share/classes/javax/rmi
|
||||
corba/src/java.corba/share/classes/javax/transaction : corba/src/share/classes/javax/transaction
|
||||
corba/src/java.corba/share/classes/org/omg : corba/src/share/classes/org/omg
|
||||
corba/src/java.corba/share/classes/sun/corba : corba/src/share/classes/sun/corba
|
||||
corba/src/java.sql/share/classes/javax/transaction/xa : corba/src/share/classes/javax/transaction/xa
|
||||
corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop : corba/src/share/classes/sun/rmi/rmic/iiop
|
||||
jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime : jaxp/src/com/sun/java_cup/internal/runtime
|
||||
jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal : jaxp/src/com/sun/org/apache/bcel/internal
|
||||
|
@ -66,8 +64,8 @@ jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/fastinfoset : jaxws/s
|
|||
jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org : jaxws/src/share/jaxws_classes/com/sun/xml/internal/org
|
||||
jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/txw2 : jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2
|
||||
jaxws/src/java.xml.bind/share/classes/javax/xml/bind : jaxws/src/share/jaxws_classes/javax/xml/bind
|
||||
jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging : jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging
|
||||
jaxws/src/java.xml.soap/share/classes/javax/xml/soap : jaxws/src/share/jaxws_classes/javax/xml/soap
|
||||
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging : jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging
|
||||
jaxws/src/java.xml.ws/share/classes/javax/xml/soap : jaxws/src/share/jaxws_classes/javax/xml/soap
|
||||
jaxws/src/java.xml.ws/share/classes/com/oracle/webservices/internal : jaxws/src/share/jaxws_classes/com/oracle/webservices/internal
|
||||
jaxws/src/java.xml.ws/share/classes/com/oracle/xmlns/internal : jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal
|
||||
jaxws/src/java.xml.ws/share/classes/com/sun/org/glassfish : jaxws/src/share/jaxws_classes/com/sun/org/glassfish
|
||||
|
@ -1245,6 +1243,8 @@ jdk/src/java.sql.rowset/share/classes/com/sun/rowset : jdk/src/share/classes/com
|
|||
jdk/src/java.sql.rowset/share/classes/javax/sql/rowset : jdk/src/share/classes/javax/sql/rowset
|
||||
jdk/src/java.sql/share/classes/java/sql : jdk/src/share/classes/java/sql
|
||||
jdk/src/java.sql/share/classes/javax/sql : jdk/src/share/classes/javax/sql
|
||||
jdk/src/java.sql/share/classes/javax/transaction/xa : corba/src/share/classes/javax/transaction/xa
|
||||
jdk/src/java.transaction/share/classes/javax/transaction : corba/src/share/classes/javax/transaction
|
||||
jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security : jdk/src/share/classes/com/sun/org/apache/xml/internal/security
|
||||
jdk/src/java.xml.crypto/share/classes/javax/xml/crypto : jdk/src/share/classes/javax/xml/crypto
|
||||
jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal : jdk/src/share/classes/org/jcp/xml/dsig/internal
|
||||
|
|
|
@ -287,3 +287,4 @@ e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
|
|||
078bb11af876fe528d4b516f33ad4dd9bb60549e jdk9-b42
|
||||
9645e35616b60c5c07b4fdf11a132afc8081dfa8 jdk9-b43
|
||||
1f57bd728c9e6865ccb9d43ccd80a1c11230a32f jdk9-b44
|
||||
9e3f2bed80c0e5a84a256ce41f1d10c5ade48466 jdk9-b45
|
||||
|
|
|
@ -1,314 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2001, 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 javax.transaction.xa;
|
||||
|
||||
/** <p>The XAResource interface is a Java mapping of the industry standard
|
||||
* XA interface based on the X/Open CAE Specification (Distributed
|
||||
* Transaction Processing: The XA Specification).
|
||||
*
|
||||
* <p>The XA interface defines the contract between a Resource Manager
|
||||
* and a Transaction Manager in a distributed transaction processing
|
||||
* (DTP) environment. A JDBC driver or a JMS provider implements
|
||||
* this interface to support the association between a global transaction
|
||||
* and a database or message service connection.
|
||||
*
|
||||
* <p>The XAResource interface can be supported by any transactional
|
||||
* resource that is intended to be used by application programs in an
|
||||
* environment where transactions are controlled by an external
|
||||
* transaction manager. An example of such a resource is a database
|
||||
* management system. An application may access data through multiple
|
||||
* database connections. Each database connection is enlisted with
|
||||
* the transaction manager as a transactional resource. The transaction
|
||||
* manager obtains an XAResource for each connection participating
|
||||
* in a global transaction. The transaction manager uses the
|
||||
* <code>start</code> method
|
||||
* to associate the global transaction with the resource, and it uses the
|
||||
* <code>end</code> method to disassociate the transaction from
|
||||
* the resource. The resource
|
||||
* manager is responsible for associating the global transaction to all
|
||||
* work performed on its data between the start and end method invocations.
|
||||
*
|
||||
* <p>At transaction commit time, the resource managers are informed by
|
||||
* the transaction manager to prepare, commit, or rollback a transaction
|
||||
* according to the two-phase commit protocol.</p>
|
||||
*
|
||||
*/
|
||||
|
||||
public interface XAResource
|
||||
{
|
||||
/** Commits the global transaction specified by xid.
|
||||
*
|
||||
* @param xid A global transaction identifier
|
||||
*
|
||||
* @param onePhase If true, the resource manager should use a one-phase
|
||||
* commit protocol to commit the work done on behalf of xid.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible XAExceptions
|
||||
* are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR,
|
||||
* XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
|
||||
*
|
||||
* <P>If the resource manager did not commit the transaction and the
|
||||
* paramether onePhase is set to true, the resource manager may throw
|
||||
* one of the XA_RB* exceptions. Upon return, the resource manager has
|
||||
* rolled back the branch's work and has released all held resources.
|
||||
*/
|
||||
|
||||
void commit(Xid xid, boolean onePhase) throws XAException;
|
||||
|
||||
|
||||
/** Ends the work performed on behalf of a transaction branch.
|
||||
* The resource manager disassociates the XA resource from the
|
||||
* transaction branch specified and lets the transaction
|
||||
* complete.
|
||||
*
|
||||
* <p>If TMSUSPEND is specified in the flags, the transaction branch
|
||||
* is temporarily suspended in an incomplete state. The transaction
|
||||
* context is in a suspended state and must be resumed via the
|
||||
* <code>start</code> method with TMRESUME specified.</p>
|
||||
*
|
||||
* <p>If TMFAIL is specified, the portion of work has failed.
|
||||
* The resource manager may mark the transaction as rollback-only</p>
|
||||
*
|
||||
* <p>If TMSUCCESS is specified, the portion of work has completed
|
||||
* successfully.</p>
|
||||
*
|
||||
* @param xid A global transaction identifier that is the same as
|
||||
* the identifier used previously in the <code>start</code> method.
|
||||
*
|
||||
* @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible XAException
|
||||
* values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL,
|
||||
* XAER_PROTO, or XA_RB*.
|
||||
*/
|
||||
|
||||
void end(Xid xid, int flags) throws XAException;
|
||||
|
||||
|
||||
/** Tells the resource manager to forget about a heuristically
|
||||
* completed transaction branch.
|
||||
*
|
||||
* @param xid A global transaction identifier.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exception
|
||||
* values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
|
||||
* XAER_PROTO.
|
||||
*/
|
||||
|
||||
void forget(Xid xid) throws XAException;
|
||||
|
||||
/** Obtains the current transaction timeout value set for this
|
||||
* XAResource instance. If <CODE>XAResource.setTransactionTimeout</CODE>
|
||||
* was not used prior to invoking this method, the return value
|
||||
* is the default timeout set for the resource manager; otherwise,
|
||||
* the value used in the previous <CODE>setTransactionTimeout</CODE>
|
||||
* call is returned.
|
||||
*
|
||||
* @return the transaction timeout value in seconds.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exception
|
||||
* values are XAER_RMERR and XAER_RMFAIL.
|
||||
*/
|
||||
int getTransactionTimeout() throws XAException;
|
||||
|
||||
/** This method is called to determine if the resource manager
|
||||
* instance represented by the target object is the same as the
|
||||
* resouce manager instance represented by the parameter <i>xares</i>.
|
||||
*
|
||||
* @param xares An XAResource object whose resource manager instance
|
||||
* is to be compared with the resource manager instance of the
|
||||
* target object.
|
||||
*
|
||||
* @return <i>true</i> if it's the same RM instance; otherwise
|
||||
* <i>false</i>.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exception
|
||||
* values are XAER_RMERR and XAER_RMFAIL.
|
||||
*
|
||||
*/
|
||||
boolean isSameRM(XAResource xares) throws XAException;
|
||||
|
||||
/** Ask the resource manager to prepare for a transaction commit
|
||||
* of the transaction specified in xid.
|
||||
*
|
||||
* @param xid A global transaction identifier.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exception
|
||||
* values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
|
||||
* or XAER_PROTO.
|
||||
*
|
||||
* @return A value indicating the resource manager's vote on the
|
||||
* outcome of the transaction. The possible values are: XA_RDONLY
|
||||
* or XA_OK. If the resource manager wants to roll back the
|
||||
* transaction, it should do so by raising an appropriate XAException
|
||||
* in the prepare method.
|
||||
*/
|
||||
|
||||
int prepare(Xid xid) throws XAException;
|
||||
|
||||
|
||||
/** Obtains a list of prepared transaction branches from a resource
|
||||
* manager. The transaction manager calls this method during recovery
|
||||
* to obtain the list of transaction branches that are currently in
|
||||
* prepared or heuristically completed states.
|
||||
*
|
||||
* @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
|
||||
* must be used when no other flags are set in the parameter.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible values are
|
||||
* XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
|
||||
*
|
||||
* @return The resource manager returns zero or more XIDs of the
|
||||
* transaction branches that are currently in a prepared or
|
||||
* heuristically completed state. If an error occurs during the
|
||||
* operation, the resource manager should throw the appropriate
|
||||
* XAException.
|
||||
*
|
||||
*/
|
||||
|
||||
Xid[] recover(int flag) throws XAException;
|
||||
|
||||
|
||||
/** Informs the resource manager to roll back work done on behalf
|
||||
* of a transaction branch.
|
||||
*
|
||||
* @param xid A global transaction identifier.
|
||||
*
|
||||
* @exception XAException An error has occurred.
|
||||
*/
|
||||
|
||||
void rollback(Xid xid) throws XAException;
|
||||
|
||||
|
||||
/** <P>Sets the current transaction timeout value for this <CODE>XAResource</CODE>
|
||||
* instance. Once set, this timeout value is effective until
|
||||
* <code>setTransactionTimeout</code> is invoked again with a different
|
||||
* value. To reset the timeout value to the default value used by the resource
|
||||
* manager, set the value to zero.
|
||||
*
|
||||
* If the timeout operation is performed successfully, the method returns
|
||||
* <i>true</i>; otherwise <i>false</i>. If a resource manager does not
|
||||
* support explicitly setting the transaction timeout value, this method
|
||||
* returns <i>false</i>.
|
||||
*
|
||||
* @param seconds The transaction timeout value in seconds.
|
||||
*
|
||||
* @return <i>true</i> if the transaction timeout value is set successfully;
|
||||
* otherwise <i>false</i>.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exception values
|
||||
* are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
|
||||
*/
|
||||
boolean setTransactionTimeout(int seconds) throws XAException;
|
||||
|
||||
|
||||
/** Starts work on behalf of a transaction branch specified in
|
||||
* <code>xid</code>.
|
||||
*
|
||||
* If TMJOIN is specified, the start applies to joining a transaction
|
||||
* previously seen by the resource manager. If TMRESUME is specified,
|
||||
* the start applies to resuming a suspended transaction specified in the
|
||||
* parameter <code>xid</code>.
|
||||
*
|
||||
* If neither TMJOIN nor TMRESUME is specified and the transaction
|
||||
* specified by <code>xid</code> has previously been seen by the resource
|
||||
* manager, the resource manager throws the XAException exception with
|
||||
* XAER_DUPID error code.
|
||||
*
|
||||
* @param xid A global transaction identifier to be associated
|
||||
* with the resource.
|
||||
*
|
||||
* @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME.
|
||||
*
|
||||
* @exception XAException An error has occurred. Possible exceptions
|
||||
* are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE,
|
||||
* XAER_NOTA, XAER_INVAL, or XAER_PROTO.
|
||||
*
|
||||
*/
|
||||
void start(Xid xid, int flags) throws XAException;
|
||||
|
||||
|
||||
/**
|
||||
* Ends a recovery scan.
|
||||
*/
|
||||
public final static int TMENDRSCAN = 0x00800000;
|
||||
|
||||
/**
|
||||
* Disassociates the caller and marks the transaction branch
|
||||
* rollback-only.
|
||||
*/
|
||||
public final static int TMFAIL = 0x20000000;
|
||||
|
||||
/**
|
||||
* Caller is joining existing transaction branch.
|
||||
*/
|
||||
public final static int TMJOIN = 0x00200000;
|
||||
|
||||
/**
|
||||
* Use TMNOFLAGS to indicate no flags value is selected.
|
||||
*/
|
||||
public final static int TMNOFLAGS = 0x00000000;
|
||||
|
||||
/**
|
||||
* Caller is using one-phase optimization.
|
||||
*/
|
||||
public final static int TMONEPHASE = 0x40000000;
|
||||
|
||||
/**
|
||||
* Caller is resuming association with a suspended
|
||||
* transaction branch.
|
||||
*/
|
||||
public final static int TMRESUME = 0x08000000;
|
||||
|
||||
/**
|
||||
* Starts a recovery scan.
|
||||
*/
|
||||
public final static int TMSTARTRSCAN = 0x01000000;
|
||||
|
||||
|
||||
/**
|
||||
* Disassociates caller from a transaction branch.
|
||||
*/
|
||||
public final static int TMSUCCESS = 0x04000000;
|
||||
|
||||
|
||||
/**
|
||||
* Caller is suspending (not ending) its association with
|
||||
* a transaction branch.
|
||||
*/
|
||||
public final static int TMSUSPEND = 0x02000000;
|
||||
|
||||
/**
|
||||
* The transaction branch has been read-only and has been committed.
|
||||
*/
|
||||
public final static int XA_RDONLY = 0x00000003;
|
||||
|
||||
/**
|
||||
* The transaction work has been prepared normally.
|
||||
*/
|
||||
public final static int XA_OK = 0;
|
||||
|
||||
}
|
|
@ -447,3 +447,4 @@ c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
|
|||
38cb4fbd47e3472bd1b5ebac83bda96fe4869c4f jdk9-b42
|
||||
65a9747147b8090037541040ba67156ec914db6a jdk9-b43
|
||||
43a44b56dca61a4d766a20f0528fdd8b5ceff873 jdk9-b44
|
||||
5dc8184af1e2bb30b0103113d1f1a58a21a80c37 jdk9-b45
|
||||
|
|
|
@ -264,11 +264,11 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
|
|||
__ cmpdi(CCR0, Rmdo, 0);
|
||||
__ beq(CCR0, no_mdo);
|
||||
|
||||
// Increment backedge counter in the MDO.
|
||||
const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
|
||||
__ lwz(Rscratch2, mdo_bc_offs, Rmdo);
|
||||
// Increment invocation counter in the MDO.
|
||||
const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
|
||||
__ lwz(Rscratch2, mdo_ic_offs, Rmdo);
|
||||
__ addi(Rscratch2, Rscratch2, increment);
|
||||
__ stw(Rscratch2, mdo_bc_offs, Rmdo);
|
||||
__ stw(Rscratch2, mdo_ic_offs, Rmdo);
|
||||
__ load_const_optimized(Rscratch1, mask, R0);
|
||||
__ and_(Rscratch1, Rscratch2, Rscratch1);
|
||||
__ bne(CCR0, done);
|
||||
|
@ -276,12 +276,12 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
|
|||
}
|
||||
|
||||
// Increment counter in MethodCounters*.
|
||||
const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
|
||||
const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
|
||||
__ bind(no_mdo);
|
||||
__ get_method_counters(R19_method, R3_counters, done);
|
||||
__ lwz(Rscratch2, mo_bc_offs, R3_counters);
|
||||
__ lwz(Rscratch2, mo_ic_offs, R3_counters);
|
||||
__ addi(Rscratch2, Rscratch2, increment);
|
||||
__ stw(Rscratch2, mo_bc_offs, R3_counters);
|
||||
__ stw(Rscratch2, mo_ic_offs, R3_counters);
|
||||
__ load_const_optimized(Rscratch1, mask, R0);
|
||||
__ and_(Rscratch1, Rscratch2, Rscratch1);
|
||||
__ beq(CCR0, *overflow);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2011 Red Hat, Inc.
|
||||
* Copyright 2007, 2008, 2011, 2015, Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -237,7 +237,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
|
|||
// operation. Note that some platforms only support this with the
|
||||
// limitation that the only valid value to store is the immediate
|
||||
// constant 1. There is a test for this in JNI_CreateJavaVM().
|
||||
return __sync_lock_test_and_set (dest, exchange_value);
|
||||
jint result = __sync_lock_test_and_set (dest, exchange_value);
|
||||
// All atomic operations are expected to be full memory barriers
|
||||
// (see atomic.hpp). However, __sync_lock_test_and_set is not
|
||||
// a full memory barrier, but an acquire barrier. Hence, this added
|
||||
// barrier.
|
||||
__sync_synchronize();
|
||||
return result;
|
||||
#endif // M68K
|
||||
#endif // ARM
|
||||
}
|
||||
|
@ -250,7 +256,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
|
|||
#ifdef M68K
|
||||
return m68k_lock_test_and_set(dest, exchange_value);
|
||||
#else
|
||||
return __sync_lock_test_and_set (dest, exchange_value);
|
||||
intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
|
||||
__sync_synchronize();
|
||||
return result;
|
||||
#endif // M68K
|
||||
#endif // ARM
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2011 Red Hat, Inc.
|
||||
* Copyright 2007, 2008, 2011, 2015, Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -231,7 +231,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
|
|||
// operation. Note that some platforms only support this with the
|
||||
// limitation that the only valid value to store is the immediate
|
||||
// constant 1. There is a test for this in JNI_CreateJavaVM().
|
||||
return __sync_lock_test_and_set (dest, exchange_value);
|
||||
jint result = __sync_lock_test_and_set (dest, exchange_value);
|
||||
// All atomic operations are expected to be full memory barriers
|
||||
// (see atomic.hpp). However, __sync_lock_test_and_set is not
|
||||
// a full memory barrier, but an acquire barrier. Hence, this added
|
||||
// barrier.
|
||||
__sync_synchronize();
|
||||
return result;
|
||||
#endif // M68K
|
||||
#endif // ARM
|
||||
}
|
||||
|
@ -244,7 +250,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
|
|||
#ifdef M68K
|
||||
return m68k_lock_test_and_set(dest, exchange_value);
|
||||
#else
|
||||
return __sync_lock_test_and_set (dest, exchange_value);
|
||||
intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
|
||||
__sync_synchronize();
|
||||
return result;
|
||||
#endif // M68K
|
||||
#endif // ARM
|
||||
}
|
||||
|
|
|
@ -1910,7 +1910,6 @@ public:
|
|||
}
|
||||
|
||||
void work(uint worker_id) {
|
||||
double start = os::elapsedTime();
|
||||
FreeRegionList local_cleanup_list("Local Cleanup List");
|
||||
HRRSCleanupTask hrrs_cleanup_task;
|
||||
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
|
||||
|
|
|
@ -1229,7 +1229,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
|||
TraceCollectorStats tcs(g1mm()->full_collection_counters());
|
||||
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
|
||||
|
||||
double start = os::elapsedTime();
|
||||
g1_policy()->record_full_collection_start();
|
||||
|
||||
// Note: When we have a more flexible GC logging framework that
|
||||
|
@ -1436,7 +1435,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
|||
|
||||
_allocator->init_mutator_alloc_region();
|
||||
|
||||
double end = os::elapsedTime();
|
||||
g1_policy()->record_full_collection_end();
|
||||
|
||||
if (G1Log::fine()) {
|
||||
|
|
|
@ -56,7 +56,6 @@ class HRRSCleanupTask;
|
|||
class GenerationSpec;
|
||||
class OopsInHeapRegionClosure;
|
||||
class G1KlassScanClosure;
|
||||
class G1ScanHeapEvacClosure;
|
||||
class ObjectClosure;
|
||||
class SpaceClosure;
|
||||
class CompactibleSpaceClosure;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2015, 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
|
||||
|
@ -153,14 +153,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
|||
_inc_cset_predicted_elapsed_time_ms(0.0),
|
||||
_inc_cset_predicted_elapsed_time_ms_diffs(0.0),
|
||||
|
||||
#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
|
||||
#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
|
||||
#endif // _MSC_VER
|
||||
|
||||
_short_lived_surv_rate_group(new SurvRateGroup(this, "Short Lived",
|
||||
G1YoungSurvRateNumRegionsSummary)),
|
||||
_survivor_surv_rate_group(new SurvRateGroup(this, "Survivor",
|
||||
G1YoungSurvRateNumRegionsSummary)),
|
||||
// add here any more surv rate groups
|
||||
_recorded_survivor_regions(0),
|
||||
_recorded_survivor_head(NULL),
|
||||
|
@ -169,6 +161,22 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
|||
|
||||
_gc_overhead_perc(0.0) {
|
||||
|
||||
uintx confidence_perc = G1ConfidencePercent;
|
||||
// Put an artificial ceiling on this so that it's not set to a silly value.
|
||||
if (confidence_perc > 100) {
|
||||
confidence_perc = 100;
|
||||
warning("G1ConfidencePercent is set to a value that is too large, "
|
||||
"it's been updated to %u", confidence_perc);
|
||||
}
|
||||
// '_sigma' must be initialized before the SurvRateGroups below because they
|
||||
// indirecty access '_sigma' trough the 'this' pointer in their constructor.
|
||||
_sigma = (double) confidence_perc / 100.0;
|
||||
|
||||
_short_lived_surv_rate_group =
|
||||
new SurvRateGroup(this, "Short Lived", G1YoungSurvRateNumRegionsSummary);
|
||||
_survivor_surv_rate_group =
|
||||
new SurvRateGroup(this, "Survivor", G1YoungSurvRateNumRegionsSummary);
|
||||
|
||||
// Set up the region size and associated fields. Given that the
|
||||
// policy is created before the heap, we have to set this up here,
|
||||
// so it's done as soon as possible.
|
||||
|
@ -283,15 +291,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
|
|||
double time_slice = (double) GCPauseIntervalMillis / 1000.0;
|
||||
_mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time);
|
||||
|
||||
uintx confidence_perc = G1ConfidencePercent;
|
||||
// Put an artificial ceiling on this so that it's not set to a silly value.
|
||||
if (confidence_perc > 100) {
|
||||
confidence_perc = 100;
|
||||
warning("G1ConfidencePercent is set to a value that is too large, "
|
||||
"it's been updated to %u", confidence_perc);
|
||||
}
|
||||
_sigma = (double) confidence_perc / 100.0;
|
||||
|
||||
// start conservatively (around 50ms is about right)
|
||||
_concurrent_mark_remark_times_ms->add(0.05);
|
||||
_concurrent_mark_cleanup_times_ms->add(0.20);
|
||||
|
|
|
@ -46,9 +46,6 @@ class ReferenceProcessor;
|
|||
class G1PrepareCompactClosure;
|
||||
|
||||
class G1MarkSweep : AllStatic {
|
||||
friend class VM_G1MarkSweep;
|
||||
friend class Scavenge;
|
||||
|
||||
public:
|
||||
|
||||
static void invoke_at_safepoint(ReferenceProcessor* rp,
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
#include "utilities/bitMap.inline.hpp"
|
||||
|
||||
G1PageBasedVirtualSpace::G1PageBasedVirtualSpace() : _low_boundary(NULL),
|
||||
_high_boundary(NULL), _committed(), _page_size(0), _special(false), _executable(false) {
|
||||
_high_boundary(NULL), _committed(), _page_size(0), _special(false),
|
||||
_dirty(), _executable(false) {
|
||||
}
|
||||
|
||||
bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size_t page_size) {
|
||||
|
@ -66,6 +67,9 @@ bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size
|
|||
assert(_committed.size() == 0, "virtual space initialized more than once");
|
||||
uintx size_in_bits = rs.size() / page_size;
|
||||
_committed.resize(size_in_bits, /* in_resource_area */ false);
|
||||
if (_special) {
|
||||
_dirty.resize(size_in_bits, /* in_resource_area */ false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -84,6 +88,7 @@ void G1PageBasedVirtualSpace::release() {
|
|||
_executable = false;
|
||||
_page_size = 0;
|
||||
_committed.resize(0, false);
|
||||
_dirty.resize(0, false);
|
||||
}
|
||||
|
||||
size_t G1PageBasedVirtualSpace::committed_size() const {
|
||||
|
@ -120,34 +125,43 @@ size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) {
|
|||
return num * _page_size;
|
||||
}
|
||||
|
||||
MemRegion G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) {
|
||||
bool G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) {
|
||||
// We need to make sure to commit all pages covered by the given area.
|
||||
guarantee(is_area_uncommitted(start, size_in_pages), "Specified area is not uncommitted");
|
||||
|
||||
if (!_special) {
|
||||
bool zero_filled = true;
|
||||
uintptr_t end = start + size_in_pages;
|
||||
|
||||
if (_special) {
|
||||
// Check for dirty pages and update zero_filled if any found.
|
||||
if (_dirty.get_next_one_offset(start,end) < end) {
|
||||
zero_filled = false;
|
||||
_dirty.clear_range(start, end);
|
||||
}
|
||||
} else {
|
||||
os::commit_memory_or_exit(page_start(start), byte_size_for_pages(size_in_pages), _executable,
|
||||
err_msg("Failed to commit pages from "SIZE_FORMAT" of length "SIZE_FORMAT, start, size_in_pages));
|
||||
}
|
||||
_committed.set_range(start, start + size_in_pages);
|
||||
_committed.set_range(start, end);
|
||||
|
||||
MemRegion result((HeapWord*)page_start(start), byte_size_for_pages(size_in_pages) / HeapWordSize);
|
||||
if (AlwaysPreTouch) {
|
||||
os::pretouch_memory((char*)result.start(), (char*)result.end());
|
||||
os::pretouch_memory(page_start(start), page_start(end));
|
||||
}
|
||||
return result;
|
||||
return zero_filled;
|
||||
}
|
||||
|
||||
MemRegion G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) {
|
||||
void G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) {
|
||||
guarantee(is_area_committed(start, size_in_pages), "checking");
|
||||
|
||||
if (!_special) {
|
||||
if (_special) {
|
||||
// Mark that memory is dirty. If committed again the memory might
|
||||
// need to be cleared explicitly.
|
||||
_dirty.set_range(start, start + size_in_pages);
|
||||
} else {
|
||||
os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages));
|
||||
}
|
||||
|
||||
_committed.clear_range(start, start + size_in_pages);
|
||||
|
||||
MemRegion result((HeapWord*)page_start(start), byte_size_for_pages(size_in_pages) / HeapWordSize);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool G1PageBasedVirtualSpace::contains(const void* p) const {
|
||||
|
@ -157,7 +171,7 @@ bool G1PageBasedVirtualSpace::contains(const void* p) const {
|
|||
#ifndef PRODUCT
|
||||
void G1PageBasedVirtualSpace::print_on(outputStream* out) {
|
||||
out->print ("Virtual space:");
|
||||
if (special()) out->print(" (pinned in memory)");
|
||||
if (_special) out->print(" (pinned in memory)");
|
||||
out->cr();
|
||||
out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
|
||||
out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
|
||||
|
|
|
@ -49,6 +49,12 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
|
|||
// Bitmap used for verification of commit/uncommit operations.
|
||||
BitMap _committed;
|
||||
|
||||
// Bitmap used to keep track of which pages are dirty or not for _special
|
||||
// spaces. This is needed because for those spaces the underlying memory
|
||||
// will only be zero filled the first time it is committed. Calls to commit
|
||||
// will use this bitmap and return whether or not the memory is zero filled.
|
||||
BitMap _dirty;
|
||||
|
||||
// Indicates that the entire space has been committed and pinned in memory,
|
||||
// os::commit_memory() or os::uncommit_memory() have no function.
|
||||
bool _special;
|
||||
|
@ -71,12 +77,11 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
|
|||
public:
|
||||
|
||||
// Commit the given area of pages starting at start being size_in_pages large.
|
||||
MemRegion commit(uintptr_t start, size_t size_in_pages);
|
||||
// Returns true if the given area is zero filled upon completion.
|
||||
bool commit(uintptr_t start, size_t size_in_pages);
|
||||
|
||||
// Uncommit the given area of pages starting at start being size_in_pages large.
|
||||
MemRegion uncommit(uintptr_t start, size_t size_in_pages);
|
||||
|
||||
bool special() const { return _special; }
|
||||
void uncommit(uintptr_t start, size_t size_in_pages);
|
||||
|
||||
// Initialization
|
||||
G1PageBasedVirtualSpace();
|
||||
|
|
|
@ -67,9 +67,9 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
|
|||
}
|
||||
|
||||
virtual void commit_regions(uintptr_t start_idx, size_t num_regions) {
|
||||
_storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
|
||||
bool zero_filled = _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
|
||||
_commit_map.set_range(start_idx, start_idx + num_regions);
|
||||
fire_on_commit(start_idx, num_regions, true);
|
||||
fire_on_commit(start_idx, num_regions, zero_filled);
|
||||
}
|
||||
|
||||
virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) {
|
||||
|
@ -117,8 +117,7 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper {
|
|||
uint old_refcount = _refcounts.get_by_index(idx);
|
||||
bool zero_filled = false;
|
||||
if (old_refcount == 0) {
|
||||
_storage.commit(idx, 1);
|
||||
zero_filled = true;
|
||||
zero_filled = _storage.commit(idx, 1);
|
||||
}
|
||||
_refcounts.set_by_index(idx, old_refcount + 1);
|
||||
_commit_map.set_bit(i);
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
// collection set.
|
||||
|
||||
class G1CollectedHeap;
|
||||
class CardTableModRefBarrierSet;
|
||||
class ConcurrentG1Refine;
|
||||
class G1ParPushHeapRSClosure;
|
||||
|
||||
|
|
|
@ -3170,7 +3170,9 @@ void Metaspace::global_initialize() {
|
|||
}
|
||||
|
||||
// the min_misc_data_size and min_misc_code_size estimates are based on
|
||||
// MetaspaceShared::generate_vtable_methods()
|
||||
// MetaspaceShared::generate_vtable_methods().
|
||||
// The minimum size only accounts for the vtable methods. Any size less than the
|
||||
// minimum required size would cause vm crash when allocating the vtable methods.
|
||||
uint min_misc_data_size = align_size_up(
|
||||
MetaspaceShared::num_virtuals * MetaspaceShared::vtbl_list_size * sizeof(void*), max_alignment);
|
||||
|
||||
|
@ -3336,6 +3338,10 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
|||
Metachunk* new_chunk = get_initialization_chunk(NonClassType,
|
||||
word_size,
|
||||
vsm()->medium_chunk_bunch());
|
||||
// For dumping shared archive, report error if allocation has failed.
|
||||
if (DumpSharedSpaces && new_chunk == NULL) {
|
||||
report_insufficient_metaspace(MetaspaceAux::committed_bytes() + word_size * BytesPerWord);
|
||||
}
|
||||
assert(!DumpSharedSpaces || new_chunk != NULL, "should have enough space for both chunks");
|
||||
if (new_chunk != NULL) {
|
||||
// Add to this manager's list of chunks in use and current_chunk().
|
||||
|
@ -3349,6 +3355,11 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) {
|
|||
class_vsm()->medium_chunk_bunch());
|
||||
if (class_chunk != NULL) {
|
||||
class_vsm()->add_chunk(class_chunk, true);
|
||||
} else {
|
||||
// For dumping shared archive, report error if allocation has failed.
|
||||
if (DumpSharedSpaces) {
|
||||
report_insufficient_metaspace(MetaspaceAux::committed_bytes() + class_word_size * BytesPerWord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2951,10 +2951,6 @@ class CommandLineFlags {
|
|||
develop(intx, MallocCatchPtr, -1, \
|
||||
"Hit breakpoint when mallocing/freeing this pointer") \
|
||||
\
|
||||
notproduct(intx, AssertRepeat, 1, \
|
||||
"number of times to evaluate expression in assert " \
|
||||
"(to estimate overhead); only works with -DUSE_REPEATED_ASSERTS") \
|
||||
\
|
||||
notproduct(ccstrlist, SuppressErrorAt, "", \
|
||||
"List of assertions (file:line) to muzzle") \
|
||||
\
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
|
@ -547,20 +547,16 @@ static void verify_memory(void* ptr) {
|
|||
// This function supports testing of the malloc out of memory
|
||||
// condition without really running the system out of memory.
|
||||
//
|
||||
static u_char* testMalloc(size_t alloc_size) {
|
||||
assert(MallocMaxTestWords > 0, "sanity check");
|
||||
static bool has_reached_max_malloc_test_peak(size_t alloc_size) {
|
||||
if (MallocMaxTestWords > 0) {
|
||||
jint words = (jint)(alloc_size / BytesPerWord);
|
||||
|
||||
if ((cur_malloc_words + (alloc_size / BytesPerWord)) > MallocMaxTestWords) {
|
||||
return NULL;
|
||||
if ((cur_malloc_words + words) > MallocMaxTestWords) {
|
||||
return true;
|
||||
}
|
||||
Atomic::add(words, (volatile jint *)&cur_malloc_words);
|
||||
}
|
||||
|
||||
u_char* ptr = (u_char*)::malloc(alloc_size);
|
||||
|
||||
if (ptr != NULL) {
|
||||
Atomic::add(((jint) (alloc_size / BytesPerWord)),
|
||||
(volatile jint *) &cur_malloc_words);
|
||||
}
|
||||
return ptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
void* os::malloc(size_t size, MEMFLAGS flags) {
|
||||
|
@ -608,13 +604,14 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) {
|
|||
|
||||
NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
|
||||
|
||||
u_char* ptr;
|
||||
if (MallocMaxTestWords > 0) {
|
||||
ptr = testMalloc(alloc_size);
|
||||
} else {
|
||||
ptr = (u_char*)::malloc(alloc_size);
|
||||
// For the test flag -XX:MallocMaxTestWords
|
||||
if (has_reached_max_malloc_test_peak(size)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u_char* ptr;
|
||||
ptr = (u_char*)::malloc(alloc_size);
|
||||
|
||||
#ifdef ASSERT
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
|
@ -642,6 +639,11 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS flags) {
|
|||
|
||||
void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack) {
|
||||
|
||||
// For the test flag -XX:MallocMaxTestWords
|
||||
if (has_reached_max_malloc_test_peak(size)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef ASSERT
|
||||
NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
|
||||
NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
@ -87,30 +87,7 @@
|
|||
#undef assert
|
||||
#endif
|
||||
|
||||
// from hotspot/src/share/vm/utilities/debug.hpp
|
||||
#ifdef ASSERT
|
||||
#ifndef USE_REPEATED_ASSERTS
|
||||
#define assert(p, msg) \
|
||||
do { \
|
||||
if (!(p)) { \
|
||||
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \
|
||||
BREAKPOINT; \
|
||||
} \
|
||||
} while (0)
|
||||
#else // #ifndef USE_REPEATED_ASSERTS
|
||||
#define assert(p, msg)
|
||||
do { \
|
||||
for (int __i = 0; __i < AssertRepeat; __i++) { \
|
||||
if (!(p)) { \
|
||||
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \
|
||||
BREAKPOINT; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
#endif // #ifndef USE_REPEATED_ASSERTS
|
||||
#else
|
||||
#define assert(p, msg)
|
||||
#endif
|
||||
#define assert(p, msg) vmassert(p, msg)
|
||||
|
||||
#ifdef DEBUG
|
||||
#undef DEBUG
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
|
@ -273,6 +273,14 @@ void report_out_of_shared_space(SharedSpaceType shared_space) {
|
|||
exit(2);
|
||||
}
|
||||
|
||||
void report_insufficient_metaspace(size_t required_size) {
|
||||
warning("\nThe MaxMetaspaceSize of " UINTX_FORMAT " bytes is not large enough.\n"
|
||||
"Either don't specify the -XX:MaxMetaspaceSize=<size>\n"
|
||||
"or increase the size to at least " SIZE_FORMAT ".\n",
|
||||
MaxMetaspaceSize, required_size);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
void report_java_out_of_memory(const char* message) {
|
||||
static jint out_of_memory_reported = 0;
|
||||
|
||||
|
@ -326,9 +334,9 @@ void test_error_handler() {
|
|||
|
||||
// Keep this in sync with test/runtime/6888954/vmerrors.sh.
|
||||
switch (n) {
|
||||
case 1: assert(str == NULL, "expected null");
|
||||
case 2: assert(num == 1023 && *str == 'X',
|
||||
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));
|
||||
case 1: vmassert(str == NULL, "expected null");
|
||||
case 2: vmassert(num == 1023 && *str == 'X',
|
||||
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));
|
||||
case 3: guarantee(str == NULL, "expected null");
|
||||
case 4: guarantee(num == 1023 && *str == 'X',
|
||||
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
|
@ -105,58 +105,42 @@ void FormatBuffer<bufsz>::append(const char* format, ...) {
|
|||
va_end(argp);
|
||||
}
|
||||
|
||||
// Used to format messages for assert(), guarantee(), fatal(), etc.
|
||||
// Used to format messages for vmassert(), guarantee(), fatal(), etc.
|
||||
typedef FormatBuffer<> err_msg;
|
||||
typedef FormatBufferResource err_msg_res;
|
||||
|
||||
// assertions
|
||||
#ifdef ASSERT
|
||||
#ifndef USE_REPEATED_ASSERTS
|
||||
#define assert(p, msg) \
|
||||
#ifndef ASSERT
|
||||
#define vmassert(p, msg)
|
||||
#else
|
||||
// Note: message says "assert" rather than "vmassert" for backward
|
||||
// compatibility with tools that parse/match the message text.
|
||||
#define vmassert(p, msg) \
|
||||
do { \
|
||||
if (!(p)) { \
|
||||
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \
|
||||
BREAKPOINT; \
|
||||
} \
|
||||
} while (0)
|
||||
#else // #ifndef USE_REPEATED_ASSERTS
|
||||
#define assert(p, msg)
|
||||
do { \
|
||||
for (int __i = 0; __i < AssertRepeat; __i++) { \
|
||||
if (!(p)) { \
|
||||
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \
|
||||
BREAKPOINT; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
#endif // #ifndef USE_REPEATED_ASSERTS
|
||||
#endif
|
||||
|
||||
// This version of assert is for use with checking return status from
|
||||
// For backward compatibility.
|
||||
#define assert(p, msg) vmassert(p, msg)
|
||||
|
||||
// This version of vmassert is for use with checking return status from
|
||||
// library calls that return actual error values eg. EINVAL,
|
||||
// ENOMEM etc, rather than returning -1 and setting errno.
|
||||
// When the status is not what is expected it is very useful to know
|
||||
// what status was actually returned, so we pass the status variable as
|
||||
// an extra arg and use strerror to convert it to a meaningful string
|
||||
// like "Invalid argument", "out of memory" etc
|
||||
#define assert_status(p, status, msg) \
|
||||
do { \
|
||||
if (!(p)) { \
|
||||
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", \
|
||||
err_msg("error %s(%d) %s", strerror(status), \
|
||||
status, msg)); \
|
||||
BREAKPOINT; \
|
||||
} \
|
||||
} while (0)
|
||||
#define vmassert_status(p, status, msg) \
|
||||
vmassert(p, err_msg("error %s(%d), %s", strerror(status), status, msg))
|
||||
|
||||
// Do not assert this condition if there's already another error reported.
|
||||
#define assert_if_no_error(cond,msg) assert((cond) || is_error_reported(), msg)
|
||||
#else // #ifdef ASSERT
|
||||
#define assert(p,msg)
|
||||
#define assert_status(p,status,msg)
|
||||
#define assert_if_no_error(cond,msg)
|
||||
#endif // #ifdef ASSERT
|
||||
// For backward compatibility.
|
||||
#define assert_status(p, status, msg) vmassert_status(p, status, msg)
|
||||
|
||||
// guarantee is like assert except it's always executed -- use it for
|
||||
// guarantee is like vmassert except it's always executed -- use it for
|
||||
// cheap tests that catch errors that would otherwise be hard to find.
|
||||
// guarantee is also used for Verify options.
|
||||
#define guarantee(p, msg) \
|
||||
|
@ -225,21 +209,22 @@ void report_untested(const char* file, int line, const char* message);
|
|||
|
||||
void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
|
||||
|
||||
#ifdef ASSERT
|
||||
// Compile-time asserts.
|
||||
template <bool> struct StaticAssert;
|
||||
template <> struct StaticAssert<true> {};
|
||||
// Compile-time asserts. Cond must be a compile-time constant expression that
|
||||
// is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration
|
||||
// may appear.
|
||||
//
|
||||
// Implementation Note: STATIC_ASSERT_FAILURE<true> provides a value member
|
||||
// rather than type member that could be used directly in the typedef, because
|
||||
// a type member would require conditional use of "typename", depending on
|
||||
// whether Cond is dependent or not. The use of a value member leads to the
|
||||
// use of an array type.
|
||||
|
||||
// Only StaticAssert<true> is defined, so if cond evaluates to false we get
|
||||
// a compile time exception when trying to use StaticAssert<false>.
|
||||
#define STATIC_ASSERT(cond) \
|
||||
do { \
|
||||
StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \
|
||||
(void)DUMMY_STATIC_ASSERT; /* ignore */ \
|
||||
} while (false)
|
||||
#else
|
||||
#define STATIC_ASSERT(cond)
|
||||
#endif
|
||||
template<bool x> struct STATIC_ASSERT_FAILURE;
|
||||
template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };
|
||||
|
||||
#define STATIC_ASSERT(Cond) \
|
||||
typedef char STATIC_ASSERT_FAILURE_ ## __LINE__ [ \
|
||||
STATIC_ASSERT_FAILURE< (Cond) >::value ]
|
||||
|
||||
// out of shared space reporting
|
||||
enum SharedSpaceType {
|
||||
|
@ -251,6 +236,8 @@ enum SharedSpaceType {
|
|||
|
||||
void report_out_of_shared_space(SharedSpaceType space_type);
|
||||
|
||||
void report_insufficient_metaspace(size_t required_size);
|
||||
|
||||
// out of memory reporting
|
||||
void report_java_out_of_memory(const char* message);
|
||||
|
||||
|
@ -258,7 +245,7 @@ void report_java_out_of_memory(const char* message);
|
|||
bool is_error_reported();
|
||||
void set_error_reported();
|
||||
|
||||
/* Test assert(), fatal(), guarantee(), etc. */
|
||||
/* Test vmassert(), fatal(), guarantee(), etc. */
|
||||
NOT_PRODUCT(void test_error_handler();)
|
||||
|
||||
void pd_ps(frame f);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2015, 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
|
||||
|
@ -33,6 +33,10 @@
|
|||
#include "runtime/vmThread.hpp"
|
||||
#include "utilities/xmlstream.hpp"
|
||||
|
||||
// Do not assert this condition if there's already another error reported.
|
||||
#define assert_if_no_error(cond, msg) \
|
||||
vmassert((cond) || is_error_reported(), msg)
|
||||
|
||||
void xmlStream::initialize(outputStream* out) {
|
||||
_out = out;
|
||||
_last_flush = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -69,7 +69,6 @@ needs_jdk = \
|
|||
gc/metaspace/TestPerfCountersAndMemoryPools.java \
|
||||
runtime/6819213/TestBootNativeLibraryPath.java \
|
||||
runtime/7158988/FieldMonitor.java \
|
||||
runtime/7194254/Test7194254.java \
|
||||
runtime/Metaspace/FragmentMetaspace.java \
|
||||
runtime/NMT/BaselineWithParameter.java \
|
||||
runtime/NMT/JcmdBaselineDetail.java \
|
||||
|
@ -94,6 +93,7 @@ needs_jdk = \
|
|||
runtime/NMT/VirtualAllocTestType.java \
|
||||
runtime/RedefineObject/TestRedefineObject.java \
|
||||
runtime/Thread/TestThreadDumpMonitorContention.java \
|
||||
runtime/Thread/ThreadPriorities.java \
|
||||
runtime/XCheckJniJsig/XCheckJSig.java \
|
||||
serviceability/attach/AttachWithStalePidFile.java \
|
||||
serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \
|
||||
|
@ -232,7 +232,8 @@ needs_g1gc = \
|
|||
gc/g1/ \
|
||||
gc/metaspace/G1AddMetaspaceDependency.java \
|
||||
gc/metaspace/TestMetaspacePerfCounters.java \
|
||||
gc/startup_warnings/TestG1.java
|
||||
gc/startup_warnings/TestG1.java \
|
||||
gc/whitebox/TestConcMarkCycleWB.java
|
||||
|
||||
# All tests that explicitly set the serial GC
|
||||
#
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* @bug 8042235
|
||||
* @summary redefining method used by multiple MethodHandles crashes VM
|
||||
* @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java
|
||||
* @ignore 7076820
|
||||
* @run main RedefineMethodUsedByMultipleMethodHandles
|
||||
*/
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.oracle.java.testlibrary.*;
|
|||
* @bug 8038636
|
||||
* @library /testlibrary
|
||||
* @build Agent
|
||||
* @ignore 7076820
|
||||
* @run main ClassFileInstaller Agent
|
||||
* @run main Launcher
|
||||
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.oracle.java.testlibrary.*;
|
|||
* @bug 8040237
|
||||
* @library /testlibrary
|
||||
* @build Agent Test A B
|
||||
* @ignore 7076820
|
||||
* @run main ClassFileInstaller Agent
|
||||
* @run main Launcher
|
||||
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, 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
|
||||
|
@ -26,34 +26,46 @@
|
|||
* @bug 8067438
|
||||
* @requires vm.gc=="null"
|
||||
* @summary Verify that starting the VM with a small heap works
|
||||
* @library /testlibrary
|
||||
* @run main/othervm -Xmx4m -XX:+UseParallelGC TestSmallHeap
|
||||
* @run main/othervm -Xmx4m -XX:+UseSerialGC TestSmallHeap
|
||||
* @run main/othervm -Xmx4m -XX:+UseG1GC TestSmallHeap
|
||||
* @run main/othervm -Xmx4m -XX:+UseConcMarkSweepGC -XX:CMSMarkStackSizeMax=1032 TestSmallHeap
|
||||
* @library /testlibrary /../../test/lib
|
||||
* @build TestSmallHeap
|
||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseParallelGC TestSmallHeap
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseSerialGC TestSmallHeap
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseG1GC TestSmallHeap
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseConcMarkSweepGC TestSmallHeap
|
||||
*
|
||||
* Note: It would be nice to verify the minimal supported heap size (2m) here,
|
||||
* but we align the heap size based on the card table size. And the card table
|
||||
* size is aligned based on the minimal pages size provided by the os. This
|
||||
* means that on most platforms, where the minimal page size is 4k, we get a
|
||||
* minimal heap size of 2m but on Solaris/Sparc we have a page size of 8k and
|
||||
* get a minimal heap size of 4m. And on platforms where the page size is 64k
|
||||
* we get a minimal heap size of 32m. We never use large pages for the card table.
|
||||
*
|
||||
* Note: It would be nice to verify the minimal supported heap size here,
|
||||
* but that turns out to be quite tricky since we align the heap size based
|
||||
* on the card table size. And the card table size is aligned based on the
|
||||
* minimal pages size provided by the os. This means that on most platforms,
|
||||
* where the minimal page size is 4k, we get a minimal heap size of 2m but
|
||||
* on Solaris/Sparc we have a page size of 8k and get a minimal heap size
|
||||
* of 8m.
|
||||
* There is also no check in the VM for verifying that the maximum heap size
|
||||
* is larger than the supported minimal heap size. This means that specifying
|
||||
* -Xmx1m on the command line is fine but will give a heap of 2m (or 4m).
|
||||
* To work around these rather strange behaviors this test uses 4m for all
|
||||
* platforms.
|
||||
* -Xmx1m on the command line is fine but will give a heap of 2m (or 4m or 32m).
|
||||
*
|
||||
* To work around these rather strange behaviors this test uses -Xmx2m but then
|
||||
* calculates what the expected heap size should be. The calculation is a
|
||||
* simplified version of the code in the VM. We assume that the card table will
|
||||
* use one page. Each byte in the card table corresponds to 512 bytes on the heap.
|
||||
* So, the expected heap size is page_size * 512.
|
||||
*/
|
||||
|
||||
import sun.management.ManagementFactoryHelper;
|
||||
import com.oracle.java.testlibrary.*;
|
||||
import static com.oracle.java.testlibrary.Asserts.*;
|
||||
import sun.hotspot.WhiteBox;
|
||||
import sun.management.ManagementFactoryHelper;
|
||||
|
||||
public class TestSmallHeap {
|
||||
|
||||
public static void main(String[] args) {
|
||||
WhiteBox wb = WhiteBox.getWhiteBox();
|
||||
int pageSize = wb.getVMPageSize();
|
||||
int heapBytesPerCard = 512;
|
||||
long expectedMaxHeap = pageSize * heapBytesPerCard;
|
||||
String maxHeap = ManagementFactoryHelper.getDiagnosticMXBean().getVMOption("MaxHeapSize").getValue();
|
||||
String expectedMaxHeap = "4194304";
|
||||
assertEQ(maxHeap, expectedMaxHeap);
|
||||
assertEQ(Long.parseLong(maxHeap), expectedMaxHeap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
* @summary Test that you can decrease NMT tracking level but not increase it.
|
||||
* @key nmt
|
||||
* @library /testlibrary /../../test/lib
|
||||
* @ignore 8067167
|
||||
* @build ChangeTrackingLevel
|
||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||
* sun.hotspot.WhiteBox$WhiteBoxPermission
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
* @bug 8005936 8058606
|
||||
* @summary Verify PrintNMTStatistics on normal JVM exit for detail and summary tracking level
|
||||
* @library /testlibrary
|
||||
* @ignore 8067167
|
||||
*/
|
||||
|
||||
import com.oracle.java.testlibrary.*;
|
||||
|
|
41
hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java
Normal file
41
hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 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 8067187
|
||||
* @summary Testing CDS dumping with the -XX:MaxMetaspaceSize=<size> option
|
||||
* @library /testlibrary
|
||||
*/
|
||||
|
||||
import com.oracle.java.testlibrary.*;
|
||||
|
||||
public class MaxMetaspaceSize {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:MaxMetaspaceSize=20m", "-Xshare:dump");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("is not large enough.\nEither don't specify the -XX:MaxMetaspaceSize=<size>\nor increase the size to at least");
|
||||
output.shouldHaveExitValue(2);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015 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
|
||||
|
@ -27,23 +27,21 @@
|
|||
* @summary Creates several threads with different java priorities and checks
|
||||
* whether jstack reports correct priorities for them.
|
||||
*
|
||||
* @ignore 8060219
|
||||
* @run main Test7194254
|
||||
* @library /testlibrary
|
||||
* @run main ThreadPriorities
|
||||
*/
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Test7194254 {
|
||||
import com.oracle.java.testlibrary.*;
|
||||
import static com.oracle.java.testlibrary.Asserts.*;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
public class ThreadPriorities {
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
final int NUMBER_OF_JAVA_PRIORITIES =
|
||||
Thread.MAX_PRIORITY - Thread.MIN_PRIORITY + 1;
|
||||
final CyclicBarrier barrier =
|
||||
|
@ -68,53 +66,31 @@ public class Test7194254 {
|
|||
barrier.await(); // 1st
|
||||
|
||||
int matches = 0;
|
||||
List<String> failed = new ArrayList<>();
|
||||
try {
|
||||
String pid = getPid();
|
||||
String jstack = System.getProperty("java.home") + "/../bin/jstack";
|
||||
Process process = new ProcessBuilder(jstack, pid)
|
||||
.redirectErrorStream(true).start();
|
||||
Pattern pattern = Pattern.compile(
|
||||
"\\\"Priority=(\\d+)\\\".* prio=(\\d+).*");
|
||||
try (BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(process.getInputStream()))) {
|
||||
String line;
|
||||
while((line = reader.readLine()) != null) {
|
||||
Matcher matcher = pattern.matcher(line);
|
||||
if (matcher.matches()) {
|
||||
matches += 1;
|
||||
String expected = matcher.group(1);
|
||||
String actual = matcher.group(2);
|
||||
if (!expected.equals(actual)) {
|
||||
failed.add(line);
|
||||
}
|
||||
}
|
||||
ArrayList<String> failed = new ArrayList<>();
|
||||
ProcessBuilder pb = new ProcessBuilder(
|
||||
JDKToolFinder.getJDKTool("jstack"),
|
||||
String.valueOf(ProcessTools.getProcessId()));
|
||||
|
||||
String[] output = new OutputAnalyzer(pb.start()).getOutput().split("\\n+");
|
||||
|
||||
Pattern pattern = Pattern.compile(
|
||||
"\\\"Priority=(\\d+)\\\".* prio=(\\d+).*");
|
||||
for (String line : output) {
|
||||
Matcher matcher = pattern.matcher(line);
|
||||
if (matcher.matches()) {
|
||||
matches += 1;
|
||||
String expected = matcher.group(1);
|
||||
String actual = matcher.group(2);
|
||||
if (!expected.equals(actual)) {
|
||||
failed.add(line);
|
||||
}
|
||||
}
|
||||
barrier.await(); // 2nd
|
||||
} finally {
|
||||
barrier.reset();
|
||||
}
|
||||
barrier.await(); // 2nd
|
||||
barrier.reset();
|
||||
|
||||
if (matches != NUMBER_OF_JAVA_PRIORITIES) {
|
||||
throw new AssertionError("matches: expected " +
|
||||
NUMBER_OF_JAVA_PRIORITIES + ", but was " + matches);
|
||||
}
|
||||
if (!failed.isEmpty()) {
|
||||
throw new AssertionError(failed.size() + ":" + failed);
|
||||
}
|
||||
System.out.println("Test passes.");
|
||||
assertEquals(matches, NUMBER_OF_JAVA_PRIORITIES);
|
||||
assertTrue(failed.isEmpty(), failed.size() + ":" + failed);
|
||||
}
|
||||
|
||||
static String getPid() {
|
||||
RuntimeMXBean runtimebean = ManagementFactory.getRuntimeMXBean();
|
||||
String vmname = runtimebean.getName();
|
||||
int i = vmname.indexOf('@');
|
||||
if (i != -1) {
|
||||
vmname = vmname.substring(0, i);
|
||||
}
|
||||
return vmname;
|
||||
}
|
||||
|
||||
}
|
||||
|
67
hotspot/test/runtime/Unsafe/Reallocate.java
Normal file
67
hotspot/test/runtime/Unsafe/Reallocate.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 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 8058897
|
||||
* @library /testlibrary
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
|
||||
*/
|
||||
|
||||
import com.oracle.java.testlibrary.*;
|
||||
import sun.misc.Unsafe;
|
||||
import static com.oracle.java.testlibrary.Asserts.*;
|
||||
|
||||
public class Reallocate {
|
||||
public static void main(String args[]) throws Exception {
|
||||
Unsafe unsafe = Utils.getUnsafe();
|
||||
|
||||
long address = unsafe.allocateMemory(1);
|
||||
assertNotEquals(address, 0L);
|
||||
|
||||
// Make sure we reallocate correctly
|
||||
unsafe.putByte(address, Byte.MAX_VALUE);
|
||||
address = unsafe.reallocateMemory(address, 2);
|
||||
assertNotEquals(address, 0L);
|
||||
assertEquals(unsafe.getByte(address), Byte.MAX_VALUE);
|
||||
|
||||
// Reallocating with a 0 size should return a null pointer
|
||||
address = unsafe.reallocateMemory(address, 0);
|
||||
assertEquals(address, 0L);
|
||||
|
||||
// Reallocating with a null pointer should result in a normal allocation
|
||||
address = unsafe.reallocateMemory(0L, 1);
|
||||
assertNotEquals(address, 0L);
|
||||
unsafe.putByte(address, Byte.MAX_VALUE);
|
||||
assertEquals(unsafe.getByte(address), Byte.MAX_VALUE);
|
||||
|
||||
// Make sure we can throw an OOME when we fail to reallocate due to OOM
|
||||
try {
|
||||
unsafe.reallocateMemory(address, 100 * 1024 * 1024 * 8);
|
||||
} catch (OutOfMemoryError e) {
|
||||
// Expected
|
||||
return;
|
||||
}
|
||||
throw new RuntimeException("Did not get expected OOM");
|
||||
}
|
||||
}
|
|
@ -287,3 +287,4 @@ a12d347f84176200593999f4da91ae2bb86865b2 jdk9-b39
|
|||
47b0d3fa4118b9d56870cf4004987438c501f5c0 jdk9-b42
|
||||
40b242363040229a05224fbc5dc203a3f46a8f8f jdk9-b43
|
||||
0cb0844b58924d6086d2850c22087d06679d5eef jdk9-b44
|
||||
0dab3e848229127c7aca4c58b98e2d90ba70372f jdk9-b45
|
||||
|
|
|
@ -290,3 +290,4 @@ dd4ba422dba858b1c3c4b38f49a3e514be4e2790 jdk9-b38
|
|||
301ddb4478fb36d1f025d14e7e48c2a434e9e6ff jdk9-b42
|
||||
edc13d27dc871be57d7ca77eef77e6d04972fee2 jdk9-b43
|
||||
2a03baa4d849818ff6d635f110c2813b12fc2326 jdk9-b44
|
||||
e529374fbe526dbd668e5e98fc047b42b3bc6d33 jdk9-b45
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue