This commit is contained in:
Dean Long 2015-01-16 05:02:11 -05:00
commit 2bd7efd60e
438 changed files with 10176 additions and 2121 deletions

View file

@ -287,3 +287,4 @@ b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37
3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42 3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42
6494b13f88a867026ee316b444d9a4fa589dd6bd jdk9-b43 6494b13f88a867026ee316b444d9a4fa589dd6bd jdk9-b43
abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44 abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44
bfc24ae2b900187585079bb11e66e459d1e525fe jdk9-b45

View file

@ -287,3 +287,4 @@ cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42 f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42
02ee8c65622e8bd97496d584e22fc7dcf0edc4ae jdk9-b43 02ee8c65622e8bd97496d584e22fc7dcf0edc4ae jdk9-b43
8994f5d87b3bb5e8d317d4e8ccb326da1a73684a jdk9-b44 8994f5d87b3bb5e8d317d4e8ccb326da1a73684a jdk9-b44
3dd628fde2086218d548841022ee8436b6b88185 jdk9-b45

View file

@ -54,8 +54,11 @@ ifneq ($(findstring qp,$(MAKEFLAGS)),)
# Duplication of global targets, needed before ParseConfAndSpec in case we have # Duplication of global targets, needed before ParseConfAndSpec in case we have
# no configurations. # no configurations.
help: help:
# If CONF is not set, look for all available configurations # If both CONF and SPEC are unset, look for all available configurations by
CONF?= # setting CONF to the empty string.
ifeq ($(SPEC), )
CONF?=
endif
endif endif
# ... and then we can include our helper functions # ... and then we can include our helper functions

View file

@ -4329,7 +4329,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # 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 # 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. # 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_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_INCLUDE="'\"$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_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 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
$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

View file

@ -690,10 +690,15 @@ OS_VERSION_MICRO:=@OS_VERSION_MICRO@
# Images directory definitions # Images directory definitions
JDK_IMAGE_SUBDIR:=jdk JDK_IMAGE_SUBDIR:=jdk
JRE_IMAGE_SUBDIR:=jre JRE_IMAGE_SUBDIR:=jre
# Colon left out to be able to override output dir for bootcycle-images # Colon left out to be able to override output dir for bootcycle-images
JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR) JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_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 # Macosx bundles directory definitions
JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents

View file

@ -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 # 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. # 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_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_INCLUDE="'\"$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_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 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
$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

View 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/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/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/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/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.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 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/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 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/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/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.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.ws/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/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/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/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 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.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/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/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/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/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 jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal : jdk/src/share/classes/org/jcp/xml/dsig/internal

View file

@ -287,3 +287,4 @@ e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
078bb11af876fe528d4b516f33ad4dd9bb60549e jdk9-b42 078bb11af876fe528d4b516f33ad4dd9bb60549e jdk9-b42
9645e35616b60c5c07b4fdf11a132afc8081dfa8 jdk9-b43 9645e35616b60c5c07b4fdf11a132afc8081dfa8 jdk9-b43
1f57bd728c9e6865ccb9d43ccd80a1c11230a32f jdk9-b44 1f57bd728c9e6865ccb9d43ccd80a1c11230a32f jdk9-b44
9e3f2bed80c0e5a84a256ce41f1d10c5ade48466 jdk9-b45

View file

@ -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;
}

View file

@ -447,3 +447,4 @@ c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
38cb4fbd47e3472bd1b5ebac83bda96fe4869c4f jdk9-b42 38cb4fbd47e3472bd1b5ebac83bda96fe4869c4f jdk9-b42
65a9747147b8090037541040ba67156ec914db6a jdk9-b43 65a9747147b8090037541040ba67156ec914db6a jdk9-b43
43a44b56dca61a4d766a20f0528fdd8b5ceff873 jdk9-b44 43a44b56dca61a4d766a20f0528fdd8b5ceff873 jdk9-b44
5dc8184af1e2bb30b0103113d1f1a58a21a80c37 jdk9-b45

View file

@ -264,11 +264,11 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
__ cmpdi(CCR0, Rmdo, 0); __ cmpdi(CCR0, Rmdo, 0);
__ beq(CCR0, no_mdo); __ beq(CCR0, no_mdo);
// Increment backedge counter in the MDO. // Increment invocation counter in the MDO.
const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
__ lwz(Rscratch2, mdo_bc_offs, Rmdo); __ lwz(Rscratch2, mdo_ic_offs, Rmdo);
__ addi(Rscratch2, Rscratch2, increment); __ addi(Rscratch2, Rscratch2, increment);
__ stw(Rscratch2, mdo_bc_offs, Rmdo); __ stw(Rscratch2, mdo_ic_offs, Rmdo);
__ load_const_optimized(Rscratch1, mask, R0); __ load_const_optimized(Rscratch1, mask, R0);
__ and_(Rscratch1, Rscratch2, Rscratch1); __ and_(Rscratch1, Rscratch2, Rscratch1);
__ bne(CCR0, done); __ bne(CCR0, done);
@ -276,12 +276,12 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
} }
// Increment counter in MethodCounters*. // 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); __ bind(no_mdo);
__ get_method_counters(R19_method, R3_counters, done); __ 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); __ addi(Rscratch2, Rscratch2, increment);
__ stw(Rscratch2, mo_bc_offs, R3_counters); __ stw(Rscratch2, mo_ic_offs, R3_counters);
__ load_const_optimized(Rscratch1, mask, R0); __ load_const_optimized(Rscratch1, mask, R0);
__ and_(Rscratch1, Rscratch2, Rscratch1); __ and_(Rscratch1, Rscratch2, Rscratch1);
__ beq(CCR0, *overflow); __ beq(CCR0, *overflow);

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -237,7 +237,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
// operation. Note that some platforms only support this with the // operation. Note that some platforms only support this with the
// limitation that the only valid value to store is the immediate // limitation that the only valid value to store is the immediate
// constant 1. There is a test for this in JNI_CreateJavaVM(). // 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 // M68K
#endif // ARM #endif // ARM
} }
@ -250,7 +256,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
#ifdef M68K #ifdef M68K
return m68k_lock_test_and_set(dest, exchange_value); return m68k_lock_test_and_set(dest, exchange_value);
#else #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 // M68K
#endif // ARM #endif // ARM
} }

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -231,7 +231,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
// operation. Note that some platforms only support this with the // operation. Note that some platforms only support this with the
// limitation that the only valid value to store is the immediate // limitation that the only valid value to store is the immediate
// constant 1. There is a test for this in JNI_CreateJavaVM(). // 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 // M68K
#endif // ARM #endif // ARM
} }
@ -244,7 +250,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
#ifdef M68K #ifdef M68K
return m68k_lock_test_and_set(dest, exchange_value); return m68k_lock_test_and_set(dest, exchange_value);
#else #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 // M68K
#endif // ARM #endif // ARM
} }

View file

@ -1910,7 +1910,6 @@ public:
} }
void work(uint worker_id) { void work(uint worker_id) {
double start = os::elapsedTime();
FreeRegionList local_cleanup_list("Local Cleanup List"); FreeRegionList local_cleanup_list("Local Cleanup List");
HRRSCleanupTask hrrs_cleanup_task; HRRSCleanupTask hrrs_cleanup_task;
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list, G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,

View file

@ -1229,7 +1229,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
TraceCollectorStats tcs(g1mm()->full_collection_counters()); TraceCollectorStats tcs(g1mm()->full_collection_counters());
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
double start = os::elapsedTime();
g1_policy()->record_full_collection_start(); g1_policy()->record_full_collection_start();
// Note: When we have a more flexible GC logging framework that // 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(); _allocator->init_mutator_alloc_region();
double end = os::elapsedTime();
g1_policy()->record_full_collection_end(); g1_policy()->record_full_collection_end();
if (G1Log::fine()) { if (G1Log::fine()) {

View file

@ -56,7 +56,6 @@ class HRRSCleanupTask;
class GenerationSpec; class GenerationSpec;
class OopsInHeapRegionClosure; class OopsInHeapRegionClosure;
class G1KlassScanClosure; class G1KlassScanClosure;
class G1ScanHeapEvacClosure;
class ObjectClosure; class ObjectClosure;
class SpaceClosure; class SpaceClosure;
class CompactibleSpaceClosure; class CompactibleSpaceClosure;

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -153,14 +153,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
_inc_cset_predicted_elapsed_time_ms(0.0), _inc_cset_predicted_elapsed_time_ms(0.0),
_inc_cset_predicted_elapsed_time_ms_diffs(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 // add here any more surv rate groups
_recorded_survivor_regions(0), _recorded_survivor_regions(0),
_recorded_survivor_head(NULL), _recorded_survivor_head(NULL),
@ -169,6 +161,22 @@ G1CollectorPolicy::G1CollectorPolicy() :
_gc_overhead_perc(0.0) { _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 // Set up the region size and associated fields. Given that the
// policy is created before the heap, we have to set this up here, // policy is created before the heap, we have to set this up here,
// so it's done as soon as possible. // so it's done as soon as possible.
@ -283,15 +291,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
double time_slice = (double) GCPauseIntervalMillis / 1000.0; double time_slice = (double) GCPauseIntervalMillis / 1000.0;
_mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time); _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) // start conservatively (around 50ms is about right)
_concurrent_mark_remark_times_ms->add(0.05); _concurrent_mark_remark_times_ms->add(0.05);
_concurrent_mark_cleanup_times_ms->add(0.20); _concurrent_mark_cleanup_times_ms->add(0.20);

View file

@ -46,9 +46,6 @@ class ReferenceProcessor;
class G1PrepareCompactClosure; class G1PrepareCompactClosure;
class G1MarkSweep : AllStatic { class G1MarkSweep : AllStatic {
friend class VM_G1MarkSweep;
friend class Scavenge;
public: public:
static void invoke_at_safepoint(ReferenceProcessor* rp, static void invoke_at_safepoint(ReferenceProcessor* rp,

View file

@ -45,7 +45,8 @@
#include "utilities/bitMap.inline.hpp" #include "utilities/bitMap.inline.hpp"
G1PageBasedVirtualSpace::G1PageBasedVirtualSpace() : _low_boundary(NULL), 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) { 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"); assert(_committed.size() == 0, "virtual space initialized more than once");
uintx size_in_bits = rs.size() / page_size; uintx size_in_bits = rs.size() / page_size;
_committed.resize(size_in_bits, /* in_resource_area */ false); _committed.resize(size_in_bits, /* in_resource_area */ false);
if (_special) {
_dirty.resize(size_in_bits, /* in_resource_area */ false);
}
return true; return true;
} }
@ -84,6 +88,7 @@ void G1PageBasedVirtualSpace::release() {
_executable = false; _executable = false;
_page_size = 0; _page_size = 0;
_committed.resize(0, false); _committed.resize(0, false);
_dirty.resize(0, false);
} }
size_t G1PageBasedVirtualSpace::committed_size() const { size_t G1PageBasedVirtualSpace::committed_size() const {
@ -120,34 +125,43 @@ size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) {
return num * _page_size; 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. // 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"); 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, 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)); 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) { 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"); 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)); os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages));
} }
_committed.clear_range(start, start + 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 { bool G1PageBasedVirtualSpace::contains(const void* p) const {
@ -157,7 +171,7 @@ bool G1PageBasedVirtualSpace::contains(const void* p) const {
#ifndef PRODUCT #ifndef PRODUCT
void G1PageBasedVirtualSpace::print_on(outputStream* out) { void G1PageBasedVirtualSpace::print_on(outputStream* out) {
out->print ("Virtual space:"); out->print ("Virtual space:");
if (special()) out->print(" (pinned in memory)"); if (_special) out->print(" (pinned in memory)");
out->cr(); out->cr();
out->print_cr(" - committed: " SIZE_FORMAT, committed_size()); out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size()); out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());

View file

@ -49,6 +49,12 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
// Bitmap used for verification of commit/uncommit operations. // Bitmap used for verification of commit/uncommit operations.
BitMap _committed; 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, // Indicates that the entire space has been committed and pinned in memory,
// os::commit_memory() or os::uncommit_memory() have no function. // os::commit_memory() or os::uncommit_memory() have no function.
bool _special; bool _special;
@ -71,12 +77,11 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
public: public:
// Commit the given area of pages starting at start being size_in_pages large. // 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. // Uncommit the given area of pages starting at start being size_in_pages large.
MemRegion uncommit(uintptr_t start, size_t size_in_pages); void uncommit(uintptr_t start, size_t size_in_pages);
bool special() const { return _special; }
// Initialization // Initialization
G1PageBasedVirtualSpace(); G1PageBasedVirtualSpace();

View file

@ -67,9 +67,9 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
} }
virtual void commit_regions(uintptr_t start_idx, size_t num_regions) { 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); _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) { 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); uint old_refcount = _refcounts.get_by_index(idx);
bool zero_filled = false; bool zero_filled = false;
if (old_refcount == 0) { if (old_refcount == 0) {
_storage.commit(idx, 1); zero_filled = _storage.commit(idx, 1);
zero_filled = true;
} }
_refcounts.set_by_index(idx, old_refcount + 1); _refcounts.set_by_index(idx, old_refcount + 1);
_commit_map.set_bit(i); _commit_map.set_bit(i);

View file

@ -31,7 +31,6 @@
// collection set. // collection set.
class G1CollectedHeap; class G1CollectedHeap;
class CardTableModRefBarrierSet;
class ConcurrentG1Refine; class ConcurrentG1Refine;
class G1ParPushHeapRSClosure; class G1ParPushHeapRSClosure;

View file

@ -3170,7 +3170,9 @@ void Metaspace::global_initialize() {
} }
// the min_misc_data_size and min_misc_code_size estimates are based on // 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( uint min_misc_data_size = align_size_up(
MetaspaceShared::num_virtuals * MetaspaceShared::vtbl_list_size * sizeof(void*), max_alignment); 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, Metachunk* new_chunk = get_initialization_chunk(NonClassType,
word_size, word_size,
vsm()->medium_chunk_bunch()); 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"); assert(!DumpSharedSpaces || new_chunk != NULL, "should have enough space for both chunks");
if (new_chunk != NULL) { if (new_chunk != NULL) {
// Add to this manager's list of chunks in use and current_chunk(). // 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()); class_vsm()->medium_chunk_bunch());
if (class_chunk != NULL) { if (class_chunk != NULL) {
class_vsm()->add_chunk(class_chunk, true); 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);
}
} }
} }

View file

@ -2951,10 +2951,6 @@ class CommandLineFlags {
develop(intx, MallocCatchPtr, -1, \ develop(intx, MallocCatchPtr, -1, \
"Hit breakpoint when mallocing/freeing this pointer") \ "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, "", \ notproduct(ccstrlist, SuppressErrorAt, "", \
"List of assertions (file:line) to muzzle") \ "List of assertions (file:line) to muzzle") \
\ \

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -547,20 +547,16 @@ static void verify_memory(void* ptr) {
// This function supports testing of the malloc out of memory // This function supports testing of the malloc out of memory
// condition without really running the system out of memory. // condition without really running the system out of memory.
// //
static u_char* testMalloc(size_t alloc_size) { static bool has_reached_max_malloc_test_peak(size_t alloc_size) {
assert(MallocMaxTestWords > 0, "sanity check"); if (MallocMaxTestWords > 0) {
jint words = (jint)(alloc_size / BytesPerWord);
if ((cur_malloc_words + (alloc_size / BytesPerWord)) > MallocMaxTestWords) { if ((cur_malloc_words + words) > MallocMaxTestWords) {
return NULL; return true;
}
Atomic::add(words, (volatile jint *)&cur_malloc_words);
} }
return false;
u_char* ptr = (u_char*)::malloc(alloc_size);
if (ptr != NULL) {
Atomic::add(((jint) (alloc_size / BytesPerWord)),
(volatile jint *) &cur_malloc_words);
}
return ptr;
} }
void* os::malloc(size_t size, MEMFLAGS flags) { 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()); NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
u_char* ptr; // For the test flag -XX:MallocMaxTestWords
if (MallocMaxTestWords > 0) { if (has_reached_max_malloc_test_peak(size)) {
ptr = testMalloc(alloc_size); return NULL;
} else {
ptr = (u_char*)::malloc(alloc_size);
} }
u_char* ptr;
ptr = (u_char*)::malloc(alloc_size);
#ifdef ASSERT #ifdef ASSERT
if (ptr == NULL) { if (ptr == NULL) {
return 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) { 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 #ifndef ASSERT
NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1)); NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size)); NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));

View file

@ -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. * Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -87,30 +87,7 @@
#undef assert #undef assert
#endif #endif
// from hotspot/src/share/vm/utilities/debug.hpp #define assert(p, msg) vmassert(p, msg)
#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
#ifdef DEBUG #ifdef DEBUG
#undef DEBUG #undef DEBUG

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -273,6 +273,14 @@ void report_out_of_shared_space(SharedSpaceType shared_space) {
exit(2); 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) { void report_java_out_of_memory(const char* message) {
static jint out_of_memory_reported = 0; 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. // Keep this in sync with test/runtime/6888954/vmerrors.sh.
switch (n) { switch (n) {
case 1: assert(str == NULL, "expected null"); case 1: vmassert(str == NULL, "expected null");
case 2: assert(num == 1023 && *str == 'X', case 2: vmassert(num == 1023 && *str == 'X',
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str)); err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));
case 3: guarantee(str == NULL, "expected null"); case 3: guarantee(str == NULL, "expected null");
case 4: guarantee(num == 1023 && *str == 'X', case 4: guarantee(num == 1023 && *str == 'X',
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str)); err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -105,58 +105,42 @@ void FormatBuffer<bufsz>::append(const char* format, ...) {
va_end(argp); 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 FormatBuffer<> err_msg;
typedef FormatBufferResource err_msg_res; typedef FormatBufferResource err_msg_res;
// assertions // assertions
#ifdef ASSERT #ifndef ASSERT
#ifndef USE_REPEATED_ASSERTS #define vmassert(p, msg)
#define assert(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 { \ do { \
if (!(p)) { \ if (!(p)) { \
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \
BREAKPOINT; \ BREAKPOINT; \
} \ } \
} while (0) } while (0)
#else // #ifndef USE_REPEATED_ASSERTS #endif
#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
// 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, // library calls that return actual error values eg. EINVAL,
// ENOMEM etc, rather than returning -1 and setting errno. // ENOMEM etc, rather than returning -1 and setting errno.
// When the status is not what is expected it is very useful to know // 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 // 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 // an extra arg and use strerror to convert it to a meaningful string
// like "Invalid argument", "out of memory" etc // like "Invalid argument", "out of memory" etc
#define assert_status(p, status, msg) \ #define vmassert_status(p, status, msg) \
do { \ vmassert(p, err_msg("error %s(%d), %s", strerror(status), status, msg))
if (!(p)) { \
report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", \
err_msg("error %s(%d) %s", strerror(status), \
status, msg)); \
BREAKPOINT; \
} \
} while (0)
// Do not assert this condition if there's already another error reported. // For backward compatibility.
#define assert_if_no_error(cond,msg) assert((cond) || is_error_reported(), msg) #define assert_status(p, status, msg) vmassert_status(p, status, msg)
#else // #ifdef ASSERT
#define assert(p,msg)
#define assert_status(p,status,msg)
#define assert_if_no_error(cond,msg)
#endif // #ifdef ASSERT
// 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. // cheap tests that catch errors that would otherwise be hard to find.
// guarantee is also used for Verify options. // guarantee is also used for Verify options.
#define guarantee(p, msg) \ #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); void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
#ifdef ASSERT // Compile-time asserts. Cond must be a compile-time constant expression that
// Compile-time asserts. // is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration
template <bool> struct StaticAssert; // may appear.
template <> struct StaticAssert<true> {}; //
// 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 template<bool x> struct STATIC_ASSERT_FAILURE;
// a compile time exception when trying to use StaticAssert<false>. template<> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };
#define STATIC_ASSERT(cond) \
do { \ #define STATIC_ASSERT(Cond) \
StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \ typedef char STATIC_ASSERT_FAILURE_ ## __LINE__ [ \
(void)DUMMY_STATIC_ASSERT; /* ignore */ \ STATIC_ASSERT_FAILURE< (Cond) >::value ]
} while (false)
#else
#define STATIC_ASSERT(cond)
#endif
// out of shared space reporting // out of shared space reporting
enum SharedSpaceType { enum SharedSpaceType {
@ -251,6 +236,8 @@ enum SharedSpaceType {
void report_out_of_shared_space(SharedSpaceType space_type); void report_out_of_shared_space(SharedSpaceType space_type);
void report_insufficient_metaspace(size_t required_size);
// out of memory reporting // out of memory reporting
void report_java_out_of_memory(const char* message); 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(); bool is_error_reported();
void set_error_reported(); void set_error_reported();
/* Test assert(), fatal(), guarantee(), etc. */ /* Test vmassert(), fatal(), guarantee(), etc. */
NOT_PRODUCT(void test_error_handler();) NOT_PRODUCT(void test_error_handler();)
void pd_ps(frame f); void pd_ps(frame f);

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,6 +33,10 @@
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
#include "utilities/xmlstream.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) { void xmlStream::initialize(outputStream* out) {
_out = out; _out = out;
_last_flush = 0; _last_flush = 0;

View file

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -69,7 +69,6 @@ needs_jdk = \
gc/metaspace/TestPerfCountersAndMemoryPools.java \ gc/metaspace/TestPerfCountersAndMemoryPools.java \
runtime/6819213/TestBootNativeLibraryPath.java \ runtime/6819213/TestBootNativeLibraryPath.java \
runtime/7158988/FieldMonitor.java \ runtime/7158988/FieldMonitor.java \
runtime/7194254/Test7194254.java \
runtime/Metaspace/FragmentMetaspace.java \ runtime/Metaspace/FragmentMetaspace.java \
runtime/NMT/BaselineWithParameter.java \ runtime/NMT/BaselineWithParameter.java \
runtime/NMT/JcmdBaselineDetail.java \ runtime/NMT/JcmdBaselineDetail.java \
@ -94,6 +93,7 @@ needs_jdk = \
runtime/NMT/VirtualAllocTestType.java \ runtime/NMT/VirtualAllocTestType.java \
runtime/RedefineObject/TestRedefineObject.java \ runtime/RedefineObject/TestRedefineObject.java \
runtime/Thread/TestThreadDumpMonitorContention.java \ runtime/Thread/TestThreadDumpMonitorContention.java \
runtime/Thread/ThreadPriorities.java \
runtime/XCheckJniJsig/XCheckJSig.java \ runtime/XCheckJniJsig/XCheckJSig.java \
serviceability/attach/AttachWithStalePidFile.java \ serviceability/attach/AttachWithStalePidFile.java \
serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \ serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \
@ -232,7 +232,8 @@ needs_g1gc = \
gc/g1/ \ gc/g1/ \
gc/metaspace/G1AddMetaspaceDependency.java \ gc/metaspace/G1AddMetaspaceDependency.java \
gc/metaspace/TestMetaspacePerfCounters.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 # All tests that explicitly set the serial GC
# #

View file

@ -26,6 +26,7 @@
* @bug 8042235 * @bug 8042235
* @summary redefining method used by multiple MethodHandles crashes VM * @summary redefining method used by multiple MethodHandles crashes VM
* @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java
* @ignore 7076820
* @run main RedefineMethodUsedByMultipleMethodHandles * @run main RedefineMethodUsedByMultipleMethodHandles
*/ */

View file

@ -28,6 +28,7 @@ import com.oracle.java.testlibrary.*;
* @bug 8038636 * @bug 8038636
* @library /testlibrary * @library /testlibrary
* @build Agent * @build Agent
* @ignore 7076820
* @run main ClassFileInstaller Agent * @run main ClassFileInstaller Agent
* @run main Launcher * @run main Launcher
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent

View file

@ -28,6 +28,7 @@ import com.oracle.java.testlibrary.*;
* @bug 8040237 * @bug 8040237
* @library /testlibrary * @library /testlibrary
* @build Agent Test A B * @build Agent Test A B
* @ignore 7076820
* @run main ClassFileInstaller Agent * @run main ClassFileInstaller Agent
* @run main Launcher * @run main Launcher
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,34 +26,46 @@
* @bug 8067438 * @bug 8067438
* @requires vm.gc=="null" * @requires vm.gc=="null"
* @summary Verify that starting the VM with a small heap works * @summary Verify that starting the VM with a small heap works
* @library /testlibrary * @library /testlibrary /../../test/lib
* @run main/othervm -Xmx4m -XX:+UseParallelGC TestSmallHeap * @build TestSmallHeap
* @run main/othervm -Xmx4m -XX:+UseSerialGC TestSmallHeap * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xmx4m -XX:+UseG1GC TestSmallHeap * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseParallelGC TestSmallHeap
* @run main/othervm -Xmx4m -XX:+UseConcMarkSweepGC -XX:CMSMarkStackSizeMax=1032 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 * 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 * 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). * -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 4m for all *
* platforms. * 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 static com.oracle.java.testlibrary.Asserts.*;
import sun.hotspot.WhiteBox;
import sun.management.ManagementFactoryHelper;
public class TestSmallHeap { public class TestSmallHeap {
public static void main(String[] args) { 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 maxHeap = ManagementFactoryHelper.getDiagnosticMXBean().getVMOption("MaxHeapSize").getValue();
String expectedMaxHeap = "4194304"; assertEQ(Long.parseLong(maxHeap), expectedMaxHeap);
assertEQ(maxHeap, expectedMaxHeap);
} }
} }

View file

@ -27,6 +27,7 @@
* @summary Test that you can decrease NMT tracking level but not increase it. * @summary Test that you can decrease NMT tracking level but not increase it.
* @key nmt * @key nmt
* @library /testlibrary /../../test/lib * @library /testlibrary /../../test/lib
* @ignore 8067167
* @build ChangeTrackingLevel * @build ChangeTrackingLevel
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission

View file

@ -27,6 +27,7 @@
* @bug 8005936 8058606 * @bug 8005936 8058606
* @summary Verify PrintNMTStatistics on normal JVM exit for detail and summary tracking level * @summary Verify PrintNMTStatistics on normal JVM exit for detail and summary tracking level
* @library /testlibrary * @library /testlibrary
* @ignore 8067167
*/ */
import com.oracle.java.testlibrary.*; import com.oracle.java.testlibrary.*;

View 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);
}
}

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,23 +27,21 @@
* @summary Creates several threads with different java priorities and checks * @summary Creates several threads with different java priorities and checks
* whether jstack reports correct priorities for them. * whether jstack reports correct priorities for them.
* *
* @ignore 8060219 * @library /testlibrary
* @run main Test7194254 * @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.ArrayList;
import java.util.List;
import java.util.concurrent.CyclicBarrier; import java.util.concurrent.CyclicBarrier;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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 = final int NUMBER_OF_JAVA_PRIORITIES =
Thread.MAX_PRIORITY - Thread.MIN_PRIORITY + 1; Thread.MAX_PRIORITY - Thread.MIN_PRIORITY + 1;
final CyclicBarrier barrier = final CyclicBarrier barrier =
@ -68,53 +66,31 @@ public class Test7194254 {
barrier.await(); // 1st barrier.await(); // 1st
int matches = 0; int matches = 0;
List<String> failed = new ArrayList<>(); ArrayList<String> failed = new ArrayList<>();
try { ProcessBuilder pb = new ProcessBuilder(
String pid = getPid(); JDKToolFinder.getJDKTool("jstack"),
String jstack = System.getProperty("java.home") + "/../bin/jstack"; String.valueOf(ProcessTools.getProcessId()));
Process process = new ProcessBuilder(jstack, pid)
.redirectErrorStream(true).start(); String[] output = new OutputAnalyzer(pb.start()).getOutput().split("\\n+");
Pattern pattern = Pattern.compile(
"\\\"Priority=(\\d+)\\\".* prio=(\\d+).*"); Pattern pattern = Pattern.compile(
try (BufferedReader reader = new BufferedReader( "\\\"Priority=(\\d+)\\\".* prio=(\\d+).*");
new InputStreamReader(process.getInputStream()))) { for (String line : output) {
String line; Matcher matcher = pattern.matcher(line);
while((line = reader.readLine()) != null) { if (matcher.matches()) {
Matcher matcher = pattern.matcher(line); matches += 1;
if (matcher.matches()) { String expected = matcher.group(1);
matches += 1; String actual = matcher.group(2);
String expected = matcher.group(1); if (!expected.equals(actual)) {
String actual = matcher.group(2); failed.add(line);
if (!expected.equals(actual)) {
failed.add(line);
}
}
} }
} }
barrier.await(); // 2nd
} finally {
barrier.reset();
} }
barrier.await(); // 2nd
barrier.reset();
if (matches != NUMBER_OF_JAVA_PRIORITIES) { assertEquals(matches, NUMBER_OF_JAVA_PRIORITIES);
throw new AssertionError("matches: expected " + assertTrue(failed.isEmpty(), failed.size() + ":" + failed);
NUMBER_OF_JAVA_PRIORITIES + ", but was " + matches);
}
if (!failed.isEmpty()) {
throw new AssertionError(failed.size() + ":" + failed);
}
System.out.println("Test passes.");
} }
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;
}
} }

View 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");
}
}

View file

@ -287,3 +287,4 @@ a12d347f84176200593999f4da91ae2bb86865b2 jdk9-b39
47b0d3fa4118b9d56870cf4004987438c501f5c0 jdk9-b42 47b0d3fa4118b9d56870cf4004987438c501f5c0 jdk9-b42
40b242363040229a05224fbc5dc203a3f46a8f8f jdk9-b43 40b242363040229a05224fbc5dc203a3f46a8f8f jdk9-b43
0cb0844b58924d6086d2850c22087d06679d5eef jdk9-b44 0cb0844b58924d6086d2850c22087d06679d5eef jdk9-b44
0dab3e848229127c7aca4c58b98e2d90ba70372f jdk9-b45

View file

@ -290,3 +290,4 @@ dd4ba422dba858b1c3c4b38f49a3e514be4e2790 jdk9-b38
301ddb4478fb36d1f025d14e7e48c2a434e9e6ff jdk9-b42 301ddb4478fb36d1f025d14e7e48c2a434e9e6ff jdk9-b42
edc13d27dc871be57d7ca77eef77e6d04972fee2 jdk9-b43 edc13d27dc871be57d7ca77eef77e6d04972fee2 jdk9-b43
2a03baa4d849818ff6d635f110c2813b12fc2326 jdk9-b44 2a03baa4d849818ff6d635f110c2813b12fc2326 jdk9-b44
e529374fbe526dbd668e5e98fc047b42b3bc6d33 jdk9-b45

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